puzhibing
2025-01-08 b22df417e0bc423c788b013feaad686531d69eed
ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml
@@ -132,28 +132,30 @@
      select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
   </select>
    <select id="getList" resultMap="SysUserResult">
      select * from sys_user where 1=1
      <if test="req.search !=null and req.search !=''">
         and (phonenumber like concat("%", #{req.search},"%") or nick_name like concat("%", #{req.search},"%"))
      select * from sys_user where del_flag = '0' and status = '0'
      <if test="null != req.phonenumber and '' != req.phonenumber">
         and phonenumber like CONCAT('%', #{req.phonenumber}, '%')
      </if>
      <if test="null != req.siteId">
         and user_id in (select user_id from t_user_site where site_id = #{req.siteId})
          and user_id in (select user_id from sys_user_role where role_id in (select role_id from t_role_site where site_id = #{req.siteId}))
      </if>
       <if test="null != req.roleIds and req.roleIds.size() > 0">
          and user_id in (select user_id from sys_user_role where role_id in
          <foreach collection="req.roleIds" item="item" index="index" open="(" separator="," close=")">
             #{item}
          </foreach>
          )
       </if>
      <if test="null != req.status">
         and status = #{req.status}
      </if>
      <if test="null != req.objectId">
         and objectId = #{req.objectId}
      </if>
      and del_flag = '0'
      <choose>
         <when test="null != req.objectId">
            and user_id in (select user_id from t_user_shop where shop_id = #{req.objectId}
            <if test="null != req.deptId">
               and dept_id = #{req.deptId}
            </if>
            <if test="req.search !=null and req.search !=''">
               and nick_name like concat("%", #{req.search},"%")
            </if>
            )
         </when>
         <otherwise>
            <if test="null != req.deptId">
               and dept_id = #{req.deptId}
            </if>
            <if test="req.search !=null and req.search !=''">
               and nick_name like concat("%", #{req.search},"%")
            </if>
         </otherwise>
      </choose>
      order by create_time desc
   </select>
   <select id="getAllList" resultType="com.ruoyi.system.api.domain.SysUser">