参考:
https://www.cnblogs.com/seeusmile-cnblog/p/6221340.html
https://www.cnblogs.com/huzi007/p/5969711.html
方式一:
mybatis更新sql语句:
update test
set createdate = #{createdate},
creator = #{creator}
where id in
#{ids}
传入map参数类型:
HashMap map = new HashMap();
map.put("creator", "creator");
map.put("createdate", "createdate");
String[] ids = {"1","2"};
map.put("ids", ids );
方式二:
第一步在你的mapper写上:
List findweixinUserLocations(@Param("params") Map map);
注意就是注解@param 这个,是mybatis的
然后在xml中这样写:
and a.accountid=#{params.accountId}
and a.nickname like '%${params.nickname}%'
and date_format(a.createtime,'%Y-%m-%d')>=${params.beginDate}
${params.nickname}这种写法参数默认是传字符串,
#{params.accountId}可以取Long,Integer之类的。