智慧保安后台管理-外网-验收版本
Administrator
2021-12-02 6b052be0122ab8df9a48752ab2adfa1b35a48ea9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.modules.social.mapper.SocialMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="socialResultMap" type="org.springblade.modules.social.vo.SocialVO">
        <id column="id" property="id"/>
        <result column="namb" property="namb"/>
        <result column="sex" property="sex"/>
        <result column="nation" property="nation"/>
        <result column="birthday" property="birthday"/>
        <result column="telephone" property="telephone"/>
        <result column="cardid" property="cardid"/>
        <result column="residence" property="residence"/>
        <result column="address" property="address"/>
        <result column="nature" property="nature"/>
        <result column="amount" property="amount"/>
        <result column="insuredtime" property="insuredtime"/>
        <result column="deptid" property="deptid"/>
        <result column="jurisdiction" property="jurisdiction"/>
    </resultMap>
 
 
    <select id="selectSocialPage" resultMap="socialResultMap">
        SELECT
        distinct u.id sid,
        s.*,
        u.real_name as realname
        FROM
        blade_user u
        LEFT JOIN
        sys_socil s
        ON
        s.cardid = u.cardid
        left join
        sys_jurisdiction sj
        on
        sj.id = s.jurisdiction
        where 1=1
        and u.is_deleted = 0
        AND u.status = 1
        and u.soil = 0
        AND u.role_id = '1412226235153731586'
        <if test="social.jurisdiction!=null and social.jurisdiction!='' and social.jurisdiction!='1372091709474910209'">
            and (sj.id=#{social.jurisdiction} or sj.parent_id = #{social.jurisdiction})
        </if>
        <if test="social.realname!=null and social.realname!=''">
            and u.real_name like concat(concat('%', #{social.realname}),'%')
        </if>
        <if test="social.cardid!=null and social.cardid!=''">
            and s.cardid like concat(concat('%', #{social.cardid}),'%')
        </if>
        <if test="social.namb!=null and social.namb!=''">
            and s.namb like concat('%',#{social.namb},'%')
        </if>
        <if test="social.deptid!=null and social.deptid!=''">
            and s.deptid=#{social.deptid}
        </if>
    </select>
 
    <update id="upSoil">
        update blade_user
        set soil=0
        where cardid = #{cardid}
    </update>
 
</mapper>