luodangjia
2024-08-13 4d54d652b4bdb4ab2f3ee6ba670348fab9b07365
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -13,7 +13,6 @@
        <result property="phonenumber"  column="phonenumber"  />
        <result property="sex"          column="sex"          />
        <result property="avatar"       column="avatar"       />
       <result property="account"      column="account"      />
        <result property="password"     column="password"     />
        <result property="status"       column="status"       />
        <result property="delFlag"      column="del_flag"     />
@@ -121,18 +120,27 @@
      select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
   </select>
   
   <select id="checkAccountUnique" resultMap="SysUserResult">
      select user_id, account from sys_user where account = #{account} and del_flag = '0' limit 1
   </select>
   <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
      select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
   </select>
    <select id="getList" resultType="com.ruoyi.system.api.domain.SysUser">
      select *,nick_name nickName,login_date loginDate,create_time createTime,user_id userId from sys_user where 1=1
      <if test="phonenumber !=null and phonenumber !=''">
         and phonenumber like concat("%", #{phonenumber},"%")
      <if test="req.search !=null and req.search !=''">
         and (phonenumber like concat("%", #{phonenumber},"%") or nick_name like concat("%", #{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>
       and del_flag = '0' and roleType =1
      order by create_time desc