liyong
9 小时以前 1ca5584d7e3200a9af65a099bd26d3593e2ba702
src/main/resources/mapper/system/SysUserMapper.xml
@@ -15,6 +15,7 @@
        <result property="password"     column="password"     />
        <result property="status"       column="status"       />
        <result property="delFlag"      column="del_flag"     />
        <result property="aiEnabled"    column="ai_enabled"   />
        <result property="loginIp"      column="login_ip"     />
        <result property="loginDate"    column="login_date"   />
        <result property="createBy"     column="create_by"    />
@@ -48,7 +49,7 @@
    </resultMap>
   <sql id="selectUserVo">
        select u.user_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
        select u.user_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.ai_enabled, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
        r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.tenant_id
        from sys_user u
          left join sys_user_role ur on u.user_id = ur.user_id
@@ -88,7 +89,7 @@
      <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
         AND date_format(u.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
      </if>
      <if test="params.deptId != null">
      <if test="deptId != null">
         AND u.user_id IN
         (
         SELECT user_id FROM sys_user_dept WHERE dept_id = #{deptId}
@@ -139,6 +140,7 @@
   <select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
      <include refid="selectUserVo"/>
      where u.user_id = #{userId}
      and u.del_flag = '0'
   </select>
   <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
@@ -152,13 +154,19 @@
   <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="selectUserByIds" resultType="com.ruoyi.project.system.domain.SysUser">
      <include refid="selectUserVo"/>
      where u.user_id in <foreach collection="userIds" item="item" open="(" separator="," close=")">
          #{item}
        </foreach>
   </select>
   <select id="selectList" resultType="com.ruoyi.project.system.domain.SysUser">
    <select id="selectUserByIds" resultType="com.ruoyi.project.system.domain.SysUser">
        <include refid="selectUserVo"/>
        <where>
            <if test="userIds != null and userIds.size > 0">
                and u.user_id in
                <foreach collection="userIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            and u.del_flag = '0'
        </where>
    </select>
   <select id="selectRegistrantIds" resultType="com.ruoyi.project.system.domain.SysUser">
      SELECT user_id, nick_name FROM sys_user
      <where>
         <if test="list != null and list.size() > 0">
@@ -179,6 +187,7 @@
      <foreach collection="userIds" item="id" open="(" separator="," close=")">
         #{id}
      </foreach>
      and del_flag = '0'
   </select>
   <select id="selectUserByNickName" resultType="com.ruoyi.project.system.domain.SysUser"
         parameterType="java.lang.String">
@@ -190,7 +199,6 @@
   <insert id="insertUser" parameterType="com.ruoyi.project.system.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
       insert into sys_user(
          <if test="userId != null and userId != 0">user_id,</if>
          <if test="deptId != null and deptId != 0">dept_id,</if>
          <if test="userName != null and userName != ''">user_name,</if>
          <if test="nickName != null and nickName != ''">nick_name,</if>
          <if test="email != null and email != ''">email,</if>
@@ -205,7 +213,6 @@
          create_time
       )values(
          <if test="userId != null and userId != ''">#{userId},</if>
          <if test="deptId != null and deptId != ''">#{deptId},</if>
          <if test="userName != null and userName != ''">#{userName},</if>
          <if test="nickName != null and nickName != ''">#{nickName},</if>
          <if test="email != null and email != ''">#{email},</if>