xml
wl
2022-11-14 c00d2abcf1209e29e76644910a89cfc7de1bdcad
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
<?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.ycl.mapper.equipment.EquipmentBayonetMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.entity.equipment.EquipmentBayonet">
        <id column="id" property="id" />
        <result column="bayonet_name" property="bayonetName" />
        <result column="longitude" property="longitude" />
        <result column="latitude" property="latitude" />
        <result column="ip_address" property="ipAddress" />
        <result column="port" property="port" />
        <result column="description" property="description" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, bayonet_name, longitude, latitude, ip_address, port, description
    </sql>
 
    <select id="selectEquipmentPage" resultType="com.ycl.vo.equipment.EquipmentBayonetVO">
        SELECT
            t1.id,
            t1.bayonet_name,
            t1.description,
            t1.ip_address,
            t1.latitude,
            t1.longitude,
            t1.`port`,
            t2.`name` as frontEndType,
            t3.`name` as inOutCityType,
            t4.region_name as belongArea
        FROM
            `ums_equipment_bayonet` t1
                LEFT JOIN
            ums_data_dictionary t2 on t1.front_end_type=t2.id
                LEFT JOIN
            ums_data_dictionary t3 on  t1.in_out_city_type=t3.id
                LEFT JOIN
            ums_sccg_region t4 on  t4.id=t1.belong_area
        <where>
            <if test="bayonetName !=null and bayonetName !='' ">
                bayonet_name like CONCAT('%',#{bayonetName},'%')
            </if>
        </where>
    </select>
</mapper>