<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<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>
|
is_deleted=0
|
<if test="idList != null and idList.size() > 0">
|
and (1=2 or
|
<foreach collection="idList" item="item" separator=" OR ">
|
<bind name="pattern" value="'%' + item + '%'"/>
|
role_id like '%${item}%'
|
</foreach>
|
)
|
</if>
|
<!-- 如果列表为空,可以加一个永假条件避免全表扫描,例如:-->
|
<if test="idList == null or idList.size() == 0">
|
AND 1 = 0
|
</if>
|
</where>
|
</select>
|
</mapper>
|