From 983bdb5b89932b38d08a11ad1eed6ea89d1597e1 Mon Sep 17 00:00:00 2001 From: kongzy <kongzy> Date: 星期一, 29 一月 2024 10:07:31 +0800 Subject: [PATCH] 更新 --- assess-system/src/main/resources/mapper/SysUserMapper.xml | 57 +++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 39 insertions(+), 18 deletions(-) diff --git a/assess-system/src/main/resources/mapper/system/SysUserMapper.xml b/assess-system/src/main/resources/mapper/SysUserMapper.xml similarity index 80% rename from assess-system/src/main/resources/mapper/system/SysUserMapper.xml rename to assess-system/src/main/resources/mapper/SysUserMapper.xml index f42a7e2..5ebd431 100644 --- a/assess-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/assess-system/src/main/resources/mapper/SysUserMapper.xml @@ -22,6 +22,9 @@ <result property="expertType" column="expert_type" /> <result property="jobTitle" column="job_title" /> <result property="major" column="major" /> + <result property="level" column="level" /> + <result property="idPhoto" column="id_photo" /> + <result property="certificateNo" column="certificate_no" /> <result property="state" column="state" /> <result property="loginIp" column="login_ip" /> <result property="loginDate" column="login_date" /> @@ -35,6 +38,7 @@ <collection property="socialAttach" ofType="com.gkhy.assess.system.domain.SysAttach" select="getSocialAttachByUserId" column="{userId=id}"/> <collection property="medicalAttach" ofType="com.gkhy.assess.system.domain.SysAttach" select="getMedicalAttachByUserId" column="{userId=id}"/> <collection property="salaryAttach" ofType="com.gkhy.assess.system.domain.SysAttach" select="getSalaryAttachByUserId" column="{userId=id}"/> + <collection property="majorNames" ofType="java.lang.String" select="getMajorById" column="{major=major}"/> </resultMap> @@ -45,23 +49,17 @@ </resultMap> <sql id="selectUserVo"> - select u.id,u.username, u.name,u.identity,u.user_type,u.phone,u.sex,u.status,u.del_flag,u.manage_region,u.expert_type,u.agency_id,u.post,u.job_title,u.major,u.state,u.create_time,u.remark,a.id as agency_id,a.name as agency_name,a.credit_code + select u.id,u.username, u.name,u.identity,u.user_type,u.phone,u.sex,u.status, + u.del_flag,u.manage_region,u.expert_type,u.agency_id,u.post,u.job_title, + u.major,u.state,u.create_time,u.remark,u.level,u.id_photo,u.certificate_no, + a.id as agency_id,a.name as agency_name,a.credit_code from sys_user u left join sys_agency a on u.agency_id=a.id </sql> - <delete id="deleteUserById" parameterType="java.lang.Long"> - update sys_user set del_flag=1 where id=#{userId} - </delete> - <delete id="deleteUserByIds"> - update sys_user set del_flag = 1 where id in - <foreach collection="userIds" item="userId" open="(" separator="," close=")"> - #{userId} - </foreach> - </delete> <select id="getUserByUsername" resultMap="SysUserResult"> - select id,username,name,password,salt,identity,state,status,del_flag from sys_user + select id,username,name,password,salt,identity,state,status,del_flag,agency_id,major from sys_user where username=#{username} and del_flag=0 </select> @@ -72,7 +70,7 @@ <if test="username != null and username != ''"> AND u.username like concat('%', #{username}, '%') </if> - <if test="status != null and status != ''"> + <if test="status != null"> AND u.status = #{status} </if> <if test="phone != null and phone != ''"> @@ -89,7 +87,7 @@ <if test="username != null and username != ''"> AND u.username like concat('%', #{username}, '%') </if> - <if test="status != null and status != ''"> + <if test="status != null"> AND u.status = #{status} </if> <if test="phone != null and phone != ''"> @@ -106,8 +104,14 @@ <if test="username != null and username != ''"> AND u.username like concat('%', #{username}, '%') </if> - <if test="status != null and status != ''"> + <if test="name != null and name != ''"> + AND u.name like concat('%', #{name}, '%') + </if> + <if test="status != null"> AND u.status = #{status} + </if> + <if test="level != null and level!=''"> + AND u.level = #{level} </if> <if test="phone != null and phone != ''"> AND u.phone like concat('%', #{phone}, '%') @@ -115,6 +119,16 @@ <if test="expertType != null and expertType != ''"> AND u.expert_type =#{expertType} </if> + <if test="agencyId != null and agencyId != ''"> + AND u.agency_id =#{agencyId} + </if> + <if test="major != null and major != ''"> + AND u.major like concat("%",#{major},"%") + </if> + <if test="post != null and post != ''"> + AND u.post =#{post} + </if> + </where> order by u.create_time desc </select> @@ -122,17 +136,17 @@ <select id="getUserByPhone" resultMap="SysUserResult"> - select id,username,name,password,salt,identity,state,status,del_flag from sys_user + select id,username,name,password,salt,identity,state,status,del_flag,major from sys_user where phone=#{phone} and del_flag=0 </select> <select id="getUserByEmail" resultMap="SysUserResult"> - select id,username,name,password,salt,identity,state,status,del_flag from sys_user + select id,username,name,password,salt,identity,state,status,del_flag,major from sys_user where email=#{email} and del_flag=0 </select> <select id="getUserById" resultMap="SysUserResult"> - select id,username,name,password,salt,identity,status,del_flag,agency_id from sys_user + select id,username,name,password,salt,identity,status,del_flag,agency_id,major from sys_user where id=#{userId} </select> @@ -149,7 +163,7 @@ </select> <select id="getUserByUsernamePhone" resultType="com.gkhy.assess.system.domain.SysUser"> - select id,username,name,password,salt,identity,state,status,del_flag from sys_user + select id,username,name,password,salt,identity,state,status,del_flag,agency_id from sys_user where (username=#{username} or phone=#{username}) and del_flag=0 </select> @@ -166,6 +180,13 @@ select id,name,path,type,user_id,create_time from sys_attach where user_id=#{userId} and type=3 order by create_time desc </select> + <select id="getMajorById" resultType="java.lang.String"> + select label from sys_dict_data where id in + <foreach item="item" index="index" collection="major.split(',')" open="(" separator="," close=")"> + #{item} + </foreach> + </select> + <select id="getUserInfoById" resultMap="SysUserResult"> <include refid="selectUserVo"/> where u.id=#{userId} -- Gitblit v1.9.2