是不可以重载的。。。

在dao层中的接口:

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
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层接口是不能进行方法重载的。。。。
 
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄