From e3241a8a2b867fb60cd63edd64744a1fbfae0d1d Mon Sep 17 00:00:00 2001
From: heheng <heheng@123456>
Date: Wed, 11 Dec 2024 17:14:30 +0800
Subject: [PATCH] 更改查询方式
---
assess-system/src/main/resources/mapper/SysUserMapper.xml | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/assess-system/src/main/resources/mapper/SysUserMapper.xml b/assess-system/src/main/resources/mapper/SysUserMapper.xml
index 5ebd431..89759fb 100644
--- a/assess-system/src/main/resources/mapper/SysUserMapper.xml
+++ b/assess-system/src/main/resources/mapper/SysUserMapper.xml
@@ -46,13 +46,14 @@
<id property="id" column="agency_id" />
<result property="name" column="agency_name" />
<result property="creditCode" column="credit_code" />
+ <result property="attribute" column="attribute" />
</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,u.level,u.id_photo,u.certificate_no,
- a.id as agency_id,a.name as agency_name,a.credit_code
+ a.id as agency_id,a.name as agency_name,a.credit_code,a.attribute
from sys_user u
left join sys_agency a on u.agency_id=a.id
</sql>
@@ -90,8 +91,17 @@
<if test="status != null">
AND u.status = #{status}
</if>
+ <if test="state != null">
+ AND u.state = #{state}
+ </if>
+ <if test="attribute != null">
+ AND a.attribute = #{attribute}
+ </if>
<if test="phone != null and phone != ''">
AND u.phone like concat('%', #{phone}, '%')
+ </if>
+ <if test="agencyName != null and agencyName != ''">
+ AND a.name like concat('%', #{agencyName}, '%')
</if>
</where>
order by u.create_time desc
@@ -128,6 +138,9 @@
<if test="post != null and post != ''">
AND u.post =#{post}
</if>
+ <if test="agencyName != null and agencyName != ''">
+ AND a.name like concat('%', #{agencyName}, '%')
+ </if>
</where>
order by u.create_time desc
@@ -155,7 +168,7 @@
</select>
<select id="checkPhoneUnique" resultType="com.gkhy.assess.system.domain.SysUser">
- select id,phone from sys_user where phone=#{phone} and del_flag=0 limit 1
+ select id,phone from sys_user where phone=#{phone} and identity=#{identity} and del_flag=0 limit 1
</select>
<select id="checkEmailUnique" resultType="com.gkhy.assess.system.domain.SysUser">
@@ -163,8 +176,8 @@
</select>
<select id="getUserByUsernamePhone" resultType="com.gkhy.assess.system.domain.SysUser">
- 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 id,username,name,password,salt,identity,id_photo,state,status,del_flag,agency_id from sys_user
+ where (username=#{username} or phone=#{username}) and del_flag=0 and identity=#{identity}
</select>
--
Gitblit v1.9.2