- 模糊查询(%#{queryText}%),concat() 方法用于连接两个或多个数组。
select * from t_user
<where>
<if test="queryText != null">
and loginacct like concat('%',#{queryText},'%')
</if>
</where>
limit #{start},#{pagesize}
- map集合循环遍历删除,其中userids为map集合,中间要用(,)拼接
<delete id="deleteUsers">
delete from t_user where id in
<foreach collection="userids" item="userid" open="(" close=")" separator=",">
#{userid}
</foreach>
</delete>