本人项目使用baomidou的mybatis-plus
mapper是否支持方法重载,还是有待考证。因为同样的代码,似乎昨天没问题,今天不行了。
首先是mapper定义了两个方法重载,
@Select(" select id,custom_group_id,custom_group_name,custom_group_parent_id from sys_device_group " +
"where custom_group_id = #{customGroupId}")
DeviceGroupEntity selectByCustomGroupId(@Param("customGroupId") String customGroupId);
@Select("")
DeviceGroupEntity selectByCustomGroupIdAppId(@Param("customGroupId") String customGroupId, @Param("appId") Long appId);
具体的使用:
public DeviceGroupEntity selectByCustomGroupIdAppId(String customGroupId, Long appId) {
log.info("updateDeviceGroup.4444444.appId:{}", appId);
return baseMapper.selectByCustomGroupIdAppId(customGroupId, appId);
}
暑期编程PK赛 得CSDN机械键盘等精美礼品!重启了几次应用服务器,结构还是一直调用带有一个参数的方法,迫不得己把方法名字改了。



