洪城义警-正式版后台
zengh
2021-08-10 030cc847e46dcaa687f961785b458c6f9714ed49
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -62,7 +62,7 @@
    </resultMap>
    <select id="selectUserPage" resultMap="userResultMap">
        select *  from blade_user
        select * from blade_user
        where is_deleted = 0
        <if test="tenantId!=null and tenantId != ''">
            and tenant_id = #{tenantId}
@@ -97,7 +97,7 @@
    <select id="selectUserPages" resultMap="userResultMaps">
        select s.*,p.jd,p.wd,ST_ASTEXT ( e.coordinate )  from blade_user s
        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
@@ -137,7 +137,7 @@
    </select>
    <select id="selectUserPagetxl" resultMap="userResultMaps">
        select s.*,p.jd,p.wd,ST_ASTEXT ( e.coordinate )  from blade_user s
        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
@@ -247,4 +247,61 @@
            where bu.region_id is not null
        group by bu.region_id
    </select>
    <!-- 统计六大队伍数量 -->
    <select id="getUserTypeCount" resultType="org.springblade.modules.system.vo.UserRegisterStatisVO">
        SELECT
            '治保会队伍' AS region,
            count( * ) num
        FROM
            blade_user bu
            LEFT JOIN blade_dept dept ON substring_index( substring_index( bu.dept_id, ',', 3 ), ',',- 1 ) = dept.id
        WHERE
            dept.id = '1424615693403414529'
            UNION ALL
            SELECT
            '内保干部队伍' AS region,
            count( * ) num
        FROM
            blade_user bu
            LEFT JOIN blade_dept dept ON substring_index( substring_index( bu.dept_id, ',', 3 ), ',',- 1 ) = dept.id
        WHERE
            dept.id = '1424615773594312705'
            UNION ALL
            SELECT
            '治安巡防队伍' AS region,
            count( * ) num
        FROM
            blade_user bu
            LEFT JOIN blade_dept dept ON substring_index( substring_index( bu.dept_id, ',', 3 ), ',',- 1 ) = dept.id
        WHERE
            dept.id = '1424615835435130881'
            UNION ALL
            SELECT
            '信息员队伍' AS region,
            count( * ) num
        FROM
            blade_user bu
            LEFT JOIN blade_dept dept ON substring_index( substring_index( bu.dept_id, ',', 3 ), ',',- 1 ) = dept.id
        WHERE
            dept.id = '1424615909959524354'
            UNION ALL
            SELECT
            '保安员队伍' AS region,
            count( * ) num
        FROM
            blade_user bu
            LEFT JOIN blade_dept dept ON substring_index( substring_index( bu.dept_id, ',', 3 ), ',',- 1 ) = dept.id
        WHERE
            dept.id = '1424615972718895106'
            UNION ALL
            SELECT
            '警务辅助队伍' AS region,
            count( * ) num
        FROM
            blade_user bu
            LEFT JOIN blade_dept dept ON substring_index( substring_index( bu.dept_id, ',', 3 ), ',',- 1 ) = dept.id
        WHERE
            dept.id = '1424616047083905026'
    </select>
</mapper>