洪城义警-正式版后台
Administrator
2021-07-20 38d9c95058d449fca8ab314d04a32672f285c607
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -94,6 +94,8 @@
        </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
@@ -102,7 +104,7 @@
        blade_role br
        on
        s.role_id=br.id
        where s.is_deleted = 0 and br.role_alias ='处警员'
        where s.is_deleted = 0 and br.role_alias ='qfqkdw'
        <if test="user.account!=null and user.account != ''">
            and s.account = #{user.account}
        </if>
@@ -133,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
            *
@@ -169,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+'%'"/>
@@ -190,4 +233,18 @@
    <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>