是不可以重載的。。。
在dao層中的接口:
public interface BaseMapper<T> {
int deleteByPrimaryKey(Long id);
xml中的配置
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select id, document_id, operateuser, destorytime, reason, remark,sn
from t_destory
where id = #{id,jdbcType=BIGINT}
</select>
通過以上兩個對比可知:
dao層中接口的方法名與xml中的標簽id值是一致的,所以一旦出現方法重載之后就可會出現相同的方法名,xml中的id也是重名的了,一運行系統就會報錯,,,,
所以mybaits中的dao層接口是不能進行方法重載的。。。。