| | |
| | | <mapper namespace="org.springblade.mdm.basesetting.producedivision.mapper.MdmUserMapper"> |
| | | |
| | | |
| | | <select id="selectByRoleIds" resultType="org.springblade.mdm.basesetting.producedivision.entity.MdmUser"> |
| | | SELECT id,account,name,real_name,role_id,dept_id FROM blade_user |
| | | <where> |
| | | <if test="idList != null and idList.size() > 0"> |
| | | |
| | | <foreach collection="idList" item="item" separator=" OR "> |
| | | role_id like ${item} |
| | | </foreach> |
| | | </if> |
| | | <!-- 如果列表为空,可以加一个永假条件避免全表扫描,例如:--> |
| | | <if test="idList == null or idList.size() == 0"> |
| | | AND 1 = 0 |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |