From de001cc030da9c4b8660d72c024e9b8de1b8567c Mon Sep 17 00:00:00 2001
From: liyj <15602261488@163.com>
Date: Mon, 28 Oct 2024 22:00:59 +0800
Subject: [PATCH] 1、镇街直属部门组织人员登录单位显示
---
dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/dao/mapper/xml/CtUserMapper.xml | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 102 insertions(+), 2 deletions(-)
diff --git a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/dao/mapper/xml/CtUserMapper.xml b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/dao/mapper/xml/CtUserMapper.xml
index 5bf0e64..1d2763f 100644
--- a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/dao/mapper/xml/CtUserMapper.xml
+++ b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/dao/mapper/xml/CtUserMapper.xml
@@ -5,7 +5,7 @@
* @description: 自定义sql,请自行实现业务逻辑
* @company: hugeinfo
* @author: liyj
- * @time:2024-08-17 15:30:57
+ * @time:2024-08-19 20:04:19
* @version 1.0.0
-->
<mapper namespace="cn.huge.module.ctuser.dao.mapper.CtUserMapper">
@@ -240,7 +240,7 @@
and disp_status = #{terms.dispStatus}
</if>
<if test="terms.deleteStatus = null and terms.deleteStatus =''">
- and delete_status = '1'
+ and delete_status = 0
</if>
<if test="terms.deleteStatus != null and terms.deleteStatus !=''">
and delete_status = #{terms.deleteStatus}
@@ -325,4 +325,104 @@
limit #{page.offset}, #{page.size}
</select>
+ <!-- 根据条件统计 -->
+ <select id="countQueryCtUser" resultType="java.lang.Long">
+ SELECT COUNT(distinct t1.id)
+ FROM dyh_ct_user t1
+ LEFT JOIN dyh_ct_userole t2 on t1.id = t2.user_id
+ <if test="terms != null">
+ <where>
+ <if test="terms.trueName != null and terms.trueName !=''">
+ and t1.true_name like concat('%', #{terms.trueName}, '%')
+ </if>
+ <if test="terms.acc != null and terms.acc !=''">
+ and t1.acc like concat('%', #{terms.acc}, '%')
+ </if>
+ <if test="terms.unitId != null and terms.unitId !=''">
+ and t1.unit_id = #{terms.unitId}
+ </if>
+ <if test="terms.deptId != null and terms.deptId !=''">
+ and t1.dept_id = #{terms.deptId}
+ </if>
+ <if test="terms.status != null and terms.status !=''">
+ and t1.status = #{terms.status}
+ </if>
+ <if test="terms.deleteStatus = null and terms.deleteStatus =''">
+ and t1.delete_status = 0
+ </if>
+ <if test="terms.deleteStatus != null and terms.deleteStatus !=''">
+ and t1.delete_status = #{terms.deleteStatus}
+ </if>
+ <if test="terms.roleId != null and terms.roleId !=''">
+ and t2.role_id = #{terms.roleId}
+ </if>
+ </where>
+ </if>
+ </select>
+
+ <!-- 根据条件分页查询 -->
+ <select id="pageQueryCtUser" resultMap="dataResult">
+ SELECT t1.*
+ FROM dyh_ct_user t1
+ LEFT JOIN dyh_ct_userole t2 on t1.id = t2.user_id
+ <if test="terms != null">
+ <where>
+ <if test="terms.trueName != null and terms.trueName !=''">
+ and t1.true_name like concat('%', #{terms.trueName}, '%')
+ </if>
+ <if test="terms.acc != null and terms.acc !=''">
+ and t1.acc like concat('%', #{terms.acc}, '%')
+ </if>
+ <if test="terms.unitId != null and terms.unitId !=''">
+ and t1.unit_id = #{terms.unitId}
+ </if>
+ <if test="terms.deptId != null and terms.deptId !=''">
+ and t1.dept_id = #{terms.deptId}
+ </if>
+ <if test="terms.status != null and terms.status !=''">
+ and t1.status = #{terms.status}
+ </if>
+ <if test="terms.deleteStatus = null and terms.deleteStatus =''">
+ and t1.delete_status = 0
+ </if>
+ <if test="terms.deleteStatus != null and terms.deleteStatus !=''">
+ and t1.delete_status = #{terms.deleteStatus}
+ </if>
+ <if test="terms.roleId != null and terms.roleId !=''">
+ and t2.role_id = #{terms.roleId}
+ </if>
+ <if test="terms.roleCode != null and terms.roleCode !=''">
+ and t2.role_code = #{terms.roleCode}
+ </if>
+ </where>
+ </if>
+ GROUP BY t1.id
+ <if test="page.sort != null">
+ <foreach collection="page.sort" item="s" index="index" separator="," open="order by ">
+ isnull(${s.property}), ${s.property} ${s.direction}
+ </foreach>
+ </if>
+ <if test="page.sort == null">
+ order by isnull(t1.create_time), t1.create_time desc
+ </if>
+ limit #{page.offset}, #{page.size}
+ </select>
+
+ <!-- 根据部门和角色查询 -->
+ <select id="listUserByUnitRoleList" resultMap="dataResult">
+ SELECT t1.id, t1.true_name, t1.dept_id
+ FROM dyh_ct_user t1 LEFT JOIN dyh_ct_userole t2 ON t1.id = t2.user_id
+ WHERE
+ t1.delete_status = '0'
+ AND t2.role_code = #{roleCode}
+ AND t1.status = '1'
+ AND t1.unit_id = #{unitId}
+ </select>
+
+ <select id="selectByIdCard" resultMap="dataResult">
+ SELECT * FROM dyh_ct_user
+ WHERE
+ delete_status = '0'
+ and status = '1' and idcard=#{idCard}
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0