From 38d9c95058d449fca8ab314d04a32672f285c607 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Tue, 20 Jul 2021 23:52:59 +0800
Subject: [PATCH] 巡逻任务接口修改

---
 src/main/java/org/springblade/modules/system/mapper/UserMapper.xml |   77 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 74 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml b/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
index 65916f8..9f4dbea 100644
--- a/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
+++ b/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -27,6 +27,8 @@
         <result column="post_id" property="postId"/>
         <result column="online_status" property="online_status"/>
         <result column="work_status" property="work_status"/>
+        <result column="examination_type" property="examination_type"/>
+        <result column="examination_mx" property="examination_mx"/>
     </resultMap>
     <resultMap id="userResultMaps" type="org.springblade.modules.system.vo.UsersVo">
         <result column="id" property="id"/>
@@ -54,6 +56,8 @@
         <result column="work_status" property="work_status"/>
         <result column="jd" property="jd"/>
         <result column="wd" property="wd"/>
+        <result column="examination_type" property="examination_type"/>
+        <result column="examination_mx" property="examination_mx"/>
         <result column="dept_name" property="deptName"/>
     </resultMap>
 
@@ -90,12 +94,17 @@
         </if>
         ORDER BY id
     </select>
+
+
     <select id="selectUserPages" resultMap="userResultMaps">
         select s.*,p.jd,p.wd,ST_ASTEXT ( e.coordinate )  from blade_user s
         LEFT JOIN sys_position p ON p.snumber = s.CODE
         LEFT JOIN sys_enclosure e ON e.anumber = s.CODE
-
-        where s.is_deleted = 0
+        left join
+        blade_role br
+        on
+        s.role_id=br.id
+        where s.is_deleted = 0 and br.role_alias ='qfqkdw'
         <if test="user.account!=null and user.account != ''">
             and s.account = #{user.account}
         </if>
@@ -107,6 +116,9 @@
         </if>
         <if test="user.userType!=null and user.userType != ''">
             and s.user_type = #{user.userType}
+        </if>
+        <if test="user.examination_type!=null and user.examination_type != ''">
+            and s.examination_type = #{user.examination_type}
         </if>
         <if test="deptIdList!=null and deptIdList.size>0">
             and s.id in (
@@ -123,6 +135,47 @@
         </if>
         ORDER BY id
     </select>
+
+    <select id="selectUserPagetxl" resultMap="userResultMaps">
+        select s.*,p.jd,p.wd,ST_ASTEXT ( e.coordinate )  from blade_user s
+        LEFT JOIN sys_position p ON p.snumber = s.CODE
+        LEFT JOIN sys_enclosure e ON e.anumber = s.CODE
+        left join
+        blade_role br
+        on
+        s.role_id=br.id
+        where s.is_deleted = 0 AND br.role_name NOT LIKE '%管理员%'
+        <if test="user.account!=null and user.account != ''">
+            and s.account = #{user.account}
+        </if>
+        <if test="user.id!=null and user.id != ''">
+            and s.id = #{user.id}
+        </if>
+        <if test="user.realName!=null and user.realName != ''">
+            and s.real_name = #{user.realName}
+        </if>
+        <if test="user.userType!=null and user.userType != ''">
+            and s.user_type = #{user.userType}
+        </if>
+        <if test="user.examination_type!=null and user.examination_type != ''">
+            and s.examination_type = #{user.examination_type}
+        </if>
+        <if test="deptIdList!=null and deptIdList.size>0">
+            and s.id in (
+            SELECT
+            user_id
+            FROM
+            blade_user_dept
+            WHERE
+            dept_id IN
+            <foreach collection="deptIdList" index="index" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+            )
+        </if>
+        ORDER BY id
+    </select>
+
     <select id="getUser" resultMap="userResultMap">
         SELECT
             *
@@ -159,7 +212,7 @@
         on
         bu.role_id=br.id
         where
-        br.role_alias ='处警员'
+        br.role_alias ='qfqkdw'
         and bu.is_deleted=0
         <if test="user.realName!=null and user.realName !=''">
             <bind name="realName" value="'%'+user.realName+'%'"/>
@@ -176,4 +229,22 @@
         order by bu.code asc
     </select>
 
+
+    <select id="selectUser" resultType="java.util.HashMap">
+        select CAST(id AS CHAR) as groupmember,real_name as rname from blade_user
+    </select>
+
+    <!--统计用户注册数据-->
+    <select id="getUserRegisterStatisticsData" resultType="org.springblade.modules.system.vo.UserRegisterStatisVO">
+        SELECT
+            br.name as region,
+            count(*) num
+        FROM  blade_user bu
+            left join
+        blade_region br
+            on
+        bu.region_id = br.code
+            where bu.region_id is not null
+        group by bu.region_id
+    </select>
 </mapper>

--
Gitblit v1.9.3