mybatis的xml文件中使用for循环遍历
一般遍历会有两种,一个是单个属性,另外一个是多个属性
单个属性的:
select * from user a where a.del_flag = 0
and a.account in
#{account}
这边如果a.del_flag没有要求的话,可以用
多个属性的:
( a.account=#{item.account} and a.name={item.userName} )
核心就是那个
这里代码层要先处理userAccountList不能为空,如果为空直接返回,不执行该SQL;