南昌市物联网技防平台-后台
zengh
2021-03-24 260a1b31ff18a19227804390d56e6404b59e3dfb
blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml
@@ -3,7 +3,7 @@
<mapper namespace="org.springblade.system.user.mapper.UserMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="userResultMap" type="org.springblade.system.user.entity.User">
    <resultMap id="userResultMap" type="org.springblade.system.user.vo.UserVO">
        <result column="id" property="id"/>
        <result column="tenant_id" property="tenantId"/>
        <result column="create_user" property="createUser"/>
@@ -25,10 +25,18 @@
        <result column="role_id" property="roleId"/>
        <result column="dept_id" property="deptId"/>
        <result column="post_id" property="postId"/>
        <result column="online_status" property="online_status"/>
        <result column="work_status" property="work_status"/>
        <result column="jd" property="jd"/>
        <result column="wd" property="wd"/>
    </resultMap>
    <select id="selectUserPage" resultMap="userResultMap">
        select * from blade_user where is_deleted = 0
        select s.*,p.jd,p.wd,ST_ASTEXT ( e.coordinate )  from blade_user s
        LEFT JOIN jfpt.sys_position p ON p.snumber = s.CODE
        LEFT JOIN jfpt.sys_enclosure e ON e.anumber = s.CODE
        where is_deleted = 0
        <if test="tenantId!=null and tenantId != ''">
            and tenant_id = #{tenantId}
        </if>
@@ -73,4 +81,23 @@
        SELECT id, tenant_id, user_type, account, name, real_name, email, phone, birthday, role_id, dept_id, post_id FROM blade_user ${ew.customSqlSegment}
    </select>
    <!--查询处警人员列表-->
    <select id="selectSecurityUserPageList" resultType="org.springblade.system.user.vo.UsersVo">
        SELECT bu.*,p.jd,p.wd FROM blade_user bu
            LEFT JOIN
        jfpt.sys_position p
            on
        p.snumber=bu.code
            where
        role_id = #{user.roleId}
        <if test="user.realName!=null and user.realName !=''">
            <bind name="realName" value="'%'+user.realName+'%'"/>
            and bu.real_name like #{realName}
        </if>
        <if test="user.code!=null">
            <bind name="code" value="'%'+user.code+'%'"/>
            and bu.code like #{code}
        </if>
        order by bu.code asc
    </select>
</mapper>