吉安感知网项目-后端
linwei
2026-01-23 fefe259f19a251d90d17d8a42e04f6332a4cad3e
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
<?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.sxkj.gd.workorder.mapper.GdManageDeviceMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="gdManageDeviceResultMap" type="org.sxkj.gd.workorder.entity.GdManageDeviceEntity">
        <result column="id" property="id"/>
        <result column="device_sn" property="deviceSn"/>
        <result column="device_name" property="deviceName"/>
        <result column="nickname" property="nickname"/>
        <result column="device_type" property="deviceType"/>
        <result column="device_payload" property="devicePayload"/>
        <result column="longitude" property="longitude"/>
        <result column="latitude" property="latitude"/>
        <result column="firmware_version" property="firmwareVersion"/>
        <result column="child_sn" property="childSn"/>
         <result column="mode_code" property="modeCode"/>
        <result column="insure_expired_time" property="insureExpiredTime"/>
        <result column="traffic_remaining" property="trafficRemaining"/>
        <result column="traffic_expire_time" property="trafficExpireTime"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
 
 
    <select id="selectGdManageDevicePage" resultMap="gdManageDeviceResultMap">
        select
            id,
            device_sn,
            device_name,
            nickname,
            device_payload,
            longitude,
            latitude,
            location
        from
            ja_gd_manage_device
        <where>
            <if test="deviceName != null and deviceName != ''">
                and device_name like concat('%',#{deviceName},'%')
            </if>
            <if test="nickname != null and nickname != ''">
                and nickname like concat('%',#{nickname},'%')
            </if>
            <if test="deptId != null">
                and create_dept = #{deptId}
            </if>
            <if test="location != null and location != ''">
                and location like concat('%',#{location},'%')
            </if>
                and is_deleted = 0
        </where>
    </select>
 
 
    <select id="exportGdManageDevice" resultType="org.sxkj.gd.workorder.excel.GdManageDeviceExcel">
        SELECT
            *
        FROM
            ja_gd_manage_device ${ew.customSqlSegment}
    </select>
 
    <select id="selectGdManageDevice" resultType="org.sxkj.gd.workorder.vo.GdManageDeviceVO">
        select
            id,
            device_sn,
            device_name,
            nickname,
            device_payload,
            longitude,
            latitude,
            geom
        from
            ja_gd_manage_device
        <where>
            <if test="deviceIds != null and deviceIds.size() > 0">
                and id in
                <foreach item="item" collection="deviceIds" index="index" open="(" close=")" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="devicePayload != null and devicePayload != ''">
                and device_payload like concat('%',#{devicePayload},'%')
            </if>
            <if test="geom != null and geom != ''">
                and ST_Intersects(geom, ST_GeomFromText(#{geom}))
            </if>
                and is_deleted = 0
        </where>
 
 
                <if test="isDeleted != null">
                and is_deleted = #{isDeleted}
            </if></select>
 
</mapper>