|
@@ -673,7 +673,7 @@
|
|
|
<if test="loginDate != null">login_date = #{loginDate},</if>
|
|
<if test="loginDate != null">login_date = #{loginDate},</if>
|
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
|
- <if test="userType != null ">user_type = #{userType},</if>
|
|
|
|
|
|
|
+ <if test="userType != null and userType !=''">user_type = #{userType},</if>
|
|
|
<if test="major != null and major != ''">major = #{major},</if>
|
|
<if test="major != null and major != ''">major = #{major},</if>
|
|
|
<if test="majorId != null">major_id = #{majorId},</if>
|
|
<if test="majorId != null">major_id = #{majorId},</if>
|
|
|
<if test="grade != null and grade!=''">grade = #{grade},</if>
|
|
<if test="grade != null and grade!=''">grade = #{grade},</if>
|
|
@@ -703,7 +703,7 @@
|
|
|
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
|
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
|
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
|
|
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
|
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
|
|
- <if test="email != null ">email = #{email},</if>
|
|
|
|
|
|
|
+ <if test="email != null and email != ''">email = #{email},</if>
|
|
|
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
|
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
|
|
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
|
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
|
|
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
|
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
|
@@ -713,7 +713,7 @@
|
|
|
<if test="loginDate != null">login_date = #{loginDate},</if>
|
|
<if test="loginDate != null">login_date = #{loginDate},</if>
|
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
|
- <if test="userType != null ">user_type = #{userType},</if>
|
|
|
|
|
|
|
+ <if test="userType != null and userType !=''">user_type = #{userType},</if>
|
|
|
<if test="major != null and major != ''">major = #{major},</if>
|
|
<if test="major != null and major != ''">major = #{major},</if>
|
|
|
<if test="majorId != null">major_id = #{majorId},</if>
|
|
<if test="majorId != null">major_id = #{majorId},</if>
|
|
|
<if test="grade != null and grade!=''">grade = #{grade},</if>
|
|
<if test="grade != null and grade!=''">grade = #{grade},</if>
|
|
@@ -742,7 +742,7 @@
|
|
|
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
|
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
|
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
|
|
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
|
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
|
|
- <if test="email != null ">email = #{email},</if>
|
|
|
|
|
|
|
+ <if test="email != null and email != ''">email = #{email},</if>
|
|
|
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
|
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
|
|
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
|
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
|
|
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
|
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
|
@@ -752,7 +752,7 @@
|
|
|
<if test="loginDate != null">login_date = #{loginDate},</if>
|
|
<if test="loginDate != null">login_date = #{loginDate},</if>
|
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
|
- <if test="userType != null ">user_type = #{userType},</if>
|
|
|
|
|
|
|
+ <if test="userType != null and userType !=''">user_type = #{userType},</if>
|
|
|
<if test="major != null and major != ''">major = #{major},</if>
|
|
<if test="major != null and major != ''">major = #{major},</if>
|
|
|
<if test="majorId != null">major_id = #{majorId},</if>
|
|
<if test="majorId != null">major_id = #{majorId},</if>
|
|
|
<if test="grade != null and grade!=''">grade = #{grade},</if>
|
|
<if test="grade != null and grade!=''">grade = #{grade},</if>
|
|
@@ -1145,4 +1145,108 @@
|
|
|
SELECT user_type userType,nick_name userName,user_id userId,avatar,dept_id deptId,(SELECT dept_name FROM sys_dept sd WHERE sd.dept_id=su.dept_id) deptName FROM `sys_user` su WHERE del_flag=0 AND user_id=#{userId}
|
|
SELECT user_type userType,nick_name userName,user_id userId,avatar,dept_id deptId,(SELECT dept_name FROM sys_dept sd WHERE sd.dept_id=su.dept_id) deptName FROM `sys_user` su WHERE del_flag=0 AND user_id=#{userId}
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <select id="getUserByIdentityType" resultType="com.zd.system.domain.vo.SysUserVo">
|
|
|
|
|
+ <if test="subAdmin != null and subAdmin != ''">
|
|
|
|
|
+ SELECT s.id subId,s.`name` subName,s.`room` subRomm,d.`dept_id` deptId,d.`dept_name` deptName,u.`user_id` userId,u.`nick_name` nickName,1 attriType FROM lab_subject s
|
|
|
|
|
+ INNER JOIN sys_user u ON s.`admin_id` = u.`user_id` INNER JOIN sys_dept d ON s.`dept_id` = d.`dept_id`
|
|
|
|
|
+ WHERE u.del_flag=0 AND s.is_del=0
|
|
|
|
|
+ <if test="(subSafe != null and subSafe != '') or (subWhite != null and subWhite != '')">
|
|
|
|
|
+ UNION
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="subSafe != null and subSafe != ''">
|
|
|
|
|
+ SELECT s.id subId,s.`name` subName,s.`room` subRomm,d.`dept_id` deptId,d.`dept_name` deptName,u.`user_id` userId,u.`nick_name` nickName,2 attriType FROM lab_subject s INNER JOIN sys_user u ON u.`user_id`
|
|
|
|
|
+ IN (
|
|
|
|
|
+ SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(s.safe_user_id, ',', b.help_topic_id + 1), ',',
|
|
|
|
|
+ -1) result
|
|
|
|
|
+ FROM mysql.help_topic b
|
|
|
|
|
+ WHERE b.help_topic_id <
|
|
|
|
|
+ (LENGTH(s.safe_user_id) - LENGTH(REPLACE(s.safe_user_id, ',', '')) + 1)
|
|
|
|
|
+ )
|
|
|
|
|
+ INNER JOIN sys_dept d ON s.`dept_id` = d.`dept_id`
|
|
|
|
|
+ WHERE u.del_flag=0 AND s.is_del=0
|
|
|
|
|
+ <if test="(subWhite != null and subWhite != '')">
|
|
|
|
|
+ UNION
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="subWhite != null and subWhite != ''">
|
|
|
|
|
+ SELECT s.id subId,s.`name` subName,s.`room` subRomm,d.`dept_id` deptId,d.`dept_name` deptName,u.`user_id` userId,u.`nick_name` nickName,3 attriType FROM lab_subject s INNER JOIN lab_white_join_sublist js ON s.`id` = js.subject_id
|
|
|
|
|
+ INNER JOIN sys_user u ON js.white_user_id = u.`user_id` INNER JOIN sys_dept d ON s.`dept_id` = d.`dept_id`
|
|
|
|
|
+ WHERE u.del_flag=0 AND s.is_del=0
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="findUserList" resultType="com.zd.system.api.vo.CheckUserVo">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ su.user_name,
|
|
|
|
|
+ su.nick_name,
|
|
|
|
|
+ su.user_type,
|
|
|
|
|
+ su.user_id,
|
|
|
|
|
+ su.dept_id,
|
|
|
|
|
+ sd.dept_name
|
|
|
|
|
+ FROM
|
|
|
|
|
+ `sys_user` su
|
|
|
|
|
+ LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id
|
|
|
|
|
+ <where>
|
|
|
|
|
+ su.user_type = "11" and su.del_flag = 0
|
|
|
|
|
+ <if test="sysUserPageDto.deptId != null and sysUserPageDto.deptId != 0">
|
|
|
|
|
+ and ( su.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{sysUserPageDto.deptId}
|
|
|
|
|
+ ,ancestors )) or su.dept_id = #{sysUserPageDto.deptId} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="sysUserPageDto.userIds != null and sysUserPageDto.userIds.length != 0">
|
|
|
|
|
+ <foreach collection="sysUserPageDto.userIds" item="id" open=" and su.user_id in(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="(sysUserPageDto.userIds == null or sysUserPageDto.userIds.length == 0) and sysUserPageDto.filtType == 2">
|
|
|
|
|
+ and su.user_id = -999999
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="sysUserPageDto.selectedUserIds != null and sysUserPageDto.selectedUserIds.length != 0">
|
|
|
|
|
+ <foreach collection="sysUserPageDto.selectedUserIds" item="id" open=" and su.user_id not in(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="sysUserPageDto.searchValue != null and sysUserPageDto.searchValue != ''">
|
|
|
|
|
+ and (su.nick_name like concat('%',#{sysUserPageDto.searchValue},'%') or su.user_name like concat('%',#{sysUserPageDto.searchValue},'%'))
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectUserListByBatch" parameterType="com.zd.model.entity.SysUser" resultMap="SysUserResult">
|
|
|
|
|
+ select user_id, dept_id, nick_name, user_name, email, avatar, phonenumber, sex,
|
|
|
|
|
+ status, del_flag, create_by, create_time, remark
|
|
|
|
|
+ from sys_user
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="userId != null ">
|
|
|
|
|
+ AND user_id = #{userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="deptId != null ">
|
|
|
|
|
+ AND dept_id = #{deptId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
|
|
+ AND u.user_name like concat('%', #{userName}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="nickName != null and nickName != ''">
|
|
|
|
|
+ AND u.nick_name like concat('%', #{nickName}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="cardNum != null and cardNum != ''">
|
|
|
|
|
+ AND u.card_num = #{cardNum}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="delFlag != null ">
|
|
|
|
|
+ AND del_flag = #{delFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="status != null ">
|
|
|
|
|
+ AND status = #{status}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="deptIds != null and deptIds.size > 0">
|
|
|
|
|
+ <foreach collection="deptIds" item="item" open="AND dept_id IN(" separator="," close=")">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
</mapper>
|
|
</mapper>
|