fuliqi
2023-11-30 e5bf0d08d05f5c58224fe28cdf743a1bae88e3f0
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
<?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="name" property="name"/>
        <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
        , name, longitude, latitude, ip_address, port, description
    </sql>
 
    <select id="selectEquipmentPage" resultType="com.ycl.vo.equipment.EquipmentBayonetVO">
        SELECT
        t1.id,
        t1.name,
        t1.description,
        t1.ip_address,
        t1.latitude,
        t1.longitude,
        t1.`port`,
        t1.belong_area,
        t1.front_end_type frontEndType,
        t1.in_out_city_type inOutCityType,
        t2.`name` as frontEndTypeName,
        t3.`name` as inOutCityTypeName
        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 !='' ">
                t1.name like CONCAT('%',#{bayonetName},'%')
            </if>
        </where>
        order by t1.id desc
    </select>
</mapper>