#{mchntCd}
mapper接口 ---》 list方式
int queryDiscDerateCount(ListmchntCds) ;mapper映射xml:
select count(*) from t_mchnt_disc_config where mchnt_cd in"list" index="index" item="mchntCd" open="(" close=")" separator=","> #{mchntCd}
实体类:
@Data public class MchntDiscDerateDto { private String mchntCd = ""; }mapper接口ListgetDiscDerateList(List discDto) ;mapper映射xml:
select t_mchnt_disc_derate_config where mchnt_cd in"list" index="index" item="user" open="(" close=")" separator=","> #{user.mchntCd}
mapper 接口
int queryDiscDerateCount(String[] mchntCds);mapper映射xml:
select count(*) from t_mchnt_disc_derate_config where mchnt_cd in"array" index="index" item="mchntCd" open="(" close=")" separator=","> #{mchntCd}
实体类:
@Data public class UserVo { private Long id; private Long supplierId; private Long[] ids; private ListclientIdList; }mapper接口
ListqueryList(UserVo select); mapper映射文件xml
select * from bms_bills_memo and id in"ids" open="(" close=")" item="id" separator=","> #{id} and client_id in"clientIdList" separator="," item="detail" open="(" close=")" > #{detail}
mapper接口
ListqueryList(@Param("idArray") Long[] array, @Param("clientIdList") List list) ;mapper映射文件xml
select * from t_user_inf and id in"idArray" open="(" close=")" item="id" separator=","> #{id} and client_id in"clientIdList" separator="," item="detail" open="(" close=")" > #{detail}
1、mapper 接口中添加 @Param注解的场合,list,array将会失效;
2、使用了 @Param注解 collection的内容需要使用Param中的别名来指定你需要用到的list或者array