朱俊杰
2022-02-10 37a84e66917d6e22e03e31b0a115e2c16d23ed21
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
<?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="com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="treeNodeResultMap" type="com.genersoft.iot.vmp.vmanager.bean.DeviceChannelTreeNode">
        <id column="id" property="id"/>
        <result column="parentId" property="parentId"/>
        <result column="status" property="status"/>
        <result column="title" property="title"/>
        <result column="value" property="value"/>
        <result column="key" property="key"/>
        <result column="deviceId" property="deviceId"/>
        <result column="channelId" property="channelId"/>
        <result column="longitude" property="lng"/>
        <result column="latitude" property="lat"/>
    </resultMap>
 
 
    <select id="tree" resultMap="treeNodeResultMap">
        SELECT
        channelId,
        channelId as id,
        deviceId,
        parentId,
        status,
        name as title,
        channelId as "value",
        channelId as "key",
        channelId,
        longitude,
        latitude
        from device_channel
        where deviceId = #{deviceId}
    </select>
 
</mapper>