南昌市物联网技防平台-学校版后台
zengh
2021-06-03 723946c6b272e5aa4c7ec110ff1395f6c2b23e89
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?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.jfpt.suser.mapper.SuserMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="suserResultMap" type="org.springblade.jfpt.suser.entity.Suser">
        <id column="id" property="id"/>
        <result column="ynumber" property="ynumber"/>
        <result column="yname" property="yname"/>
        <result column="phone" property="phone"/>
        <result column="address" property="address"/>
        <result column="type" property="type"/>
        <result column="dj" property="dj"/>
        <result column="information" property="information"/>
        <result column="createtime" property="createtime"/>
        <result column="is_delete" property="isDelete"/>
        <result column="coordinate" property="coordinate"/>
        <result column="addvcd" property="addvcd"/>
    </resultMap>
 
    <resultMap id="suserResultMaps" type="org.springblade.jfpt.suser.vo.SuserVOs">
        <id column="id" property="id"/>
        <result column="ynumber" property="ynumber"/>
        <result column="yname" property="yname"/>
        <result column="phone" property="phone"/>
        <result column="address" property="address"/>
        <result column="type" property="type"/>
        <result column="dj" property="dj"/>
        <result column="jd" property="jd"/>
        <result column="wd" property="wd"/>
        <result column="information" property="information"/>
        <result column="createtime" property="createtime"/>
        <result column="is_delete" property="isDelete"/>
        <result column="coordinate" property="coordinate"/>
        <result column="addvcd" property="addvcd"/>
        <result column="province" property="province"/>
        <result column="city" property="city"/>
        <result column="district" property="district"/>
    </resultMap>
 
    <resultMap id="ss" type="org.springblade.jfpt.suser.vo.SuserVOs">
        <id column="id" property="id"/>
        <result column="ynumber" property="ynumber"/>
        <result column="aaa" property="aaa"/>
        <result column="phone" property="phone"/>
        <result column="address" property="address"/>
        <result column="type" property="type"/>
        <result column="dj" property="dj"/>
        <result column="information" property="information"/>
        <result column="createtime" property="createtime"/>
        <result column="is_delete" property="isDelete"/>
        <result column="coordinate" property="coordinate"/>
        <result column="addvcd" property="addvcd"/>
    </resultMap>
 
 
    <select id="selectSuserPage" resultMap="suserResultMaps">
        select s.id,s.ynumber,ST_ASTEXT(s.coordinate) as coordinate,s.yname,s.phone,s.address,s.type,s.dj,s.information,s.createtime,s.addvcd,province,city,district
        from sys_suser s left join sys_district d on d.addvcds=s.addvcd  where is_delete=0
        <if test="suser.yname!=null">
            and s.yname like concat(concat('%', #{suser.yname}), '%')
        </if>
        <if test="suser.dj!=null">
            and s.dj like concat(concat('%', #{suser.dj}), '%')
        </if>
        <if test="suser.type!=null">
            and s.type like concat(concat('%', #{suser.type}), '%')
        </if>
        <if test="suser.addvcd!=null">
            and s.addvcd like concat(concat('%', #{suser.addvcd}), '%')
        </if>
        <if test="suser.dj!=null">
            and s.dj like concat(concat('%', #{suser.dj}), '%')
        </if>
        <if test="suser.province!=null">
            and s.province like concat(concat('%', #{suser.province}), '%')
        </if> <if test="suser.city!=null">
        and s.city like concat(concat('%', #{suser.city}), '%')
    </if> <if test="suser.district!=null">
        and s.district like concat(concat('%', #{suser.district}), '%')
    </if>
        order  by s.createtime
    </select>
 
    <select id="selectInfo" resultMap="suserResultMaps">
        select s.id,ynumber,ST_ASTEXT(s.coordinate) as coordinate,s.yname,s.phone,s.address,s.type,s.dj,s.information,s.createtime,s.addvcd from sys_suser s left join sys_district d on d.addvcds=s.addvcd where is_delete=0 and s.id=#{id}
    </select>
 
    <insert id="s">
       INSERT INTO sys_suser (ynumber,yname,phone,address,type,dj,information,coordinate,createtime,addvcd) VALUES (#{ynumber},#{yname},#{phone},#{address},#{type},#{dj},#{information},POINT(#{jd},#{wd}),#{createtime},#{addvcd})
    </insert>
 
    <update id="updateOne">
 update sys_suser SET ynumber=#{ynumber},yname=#{yname},phone=#{phone},address=#{address},type=#{type},dj=#{dj},information=#{information},coordinate=POINT(#{jd},#{wd}),createtime=#{createtime},addvcd=#{addvcd} where id=#{id}
</update>
 
    <select id="selectName" resultMap="ss">
        select ynumber,yname as aaa from sys_suser
    </select>
 
    <select id="selectNames" resultType="java.lang.String">
        select yname from sys_suser where ynumber=#{ud}
    </select>
 
 
    <select id="selectList" resultMap="suserResultMaps">
        select s.id,ynumber,s.jd,s.wd,ST_ASTEXT(s.coordinate) as coordinate,s.yname,s.phone,s.address,l.types as type,s.dj,s.information,s.createtime,d.addvnm as addvcd from sys_suser s left join sys_district d on d.addvcds=s.addvcd LEFT JOIN sys_lx l on l.tnumber=s.type  where is_delete=0
        <if test="type!=null and type!=''">
            and s.type =#{type}
        </if>
        <if test="dj!=null and dj!=''">
            and s.dj =#{dj}
        </if>
    </select>
 
    <!--查询业主总数-->
    <select id="selectSuserCount" resultType="java.lang.Integer">
        select count(*) from sys_suser  where is_delete=0
    </select>
 
    <update id="updateUser">
        update jfpth0.blade_user SET online_status=#{online_status},work_status=#{workSt} where id=#{account}
    </update>
 
</mapper>