智慧农业后台管理
guoshilong
2022-10-26 7de9fef9839d5411f28d7021515563766a3ee503
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
<?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.remoteType.mapper.TypeMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="typeResultMap" type="org.springblade.modules.remoteType.entity.Type">
        <result column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="longtitude" property="longtitude"/>
        <result column="latitude" property="latitude"/>
    </resultMap>
 
 
    <select id="selectTypePage" resultMap="typeResultMap">
        select * from sys_remote_type where is_deleted = 0
    </select>
 
    <resultMap id="typeDTO" type="org.springblade.modules.remoteType.dto.TypeDTO">
        <id column="id" property="id" jdbcType="INTEGER"/>
        <result column="name" property="name" jdbcType="VARCHAR"/>
        <result column="longitude" property="longitude" jdbcType="VARCHAR"/>
        <result column="latitude" property="latitude" jdbcType="VARCHAR"/>
        <collection property="remoteList" javaType="java.util.List" ofType="org.springblade.modules.remote.entity.Remote">
            <result column="rid" property="id"/>
            <result column="re_name" property="reName"/>
            <result column="re_url" property="reUrl"/>
            <result column="re_type" property="reType"/>
        </collection>
    </resultMap>
 
    <select id="getRemoteDetailsList" resultMap="typeDTO">
        select t.id,t.name,t.longitude,t.latitude,r.id rid,r.re_name,r.re_url,r.re_type
        FROM sys_remote_type t
        LEFT JOIN sys_remote r ON r.type = t.id
        WHERE r.is_deleted = 0
    </select>
 
 
</mapper>