luodangjia
2024-08-07 980d0d6571f4b50b51502ee60094a3dbdf1fb2f7
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
<?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.ruoyi.chargingPile.mapper.TMonitoringEquipmentMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.chargingPile.api.model.TMonitoringEquipment">
        <id column="id" property="id" />
        <result column="`name`" property="name" />
        <result column="code" property="code" />
        <result column="parking_lot_id" property="parkingLotId" />
        <result column="location" property="location" />
        <result column="url_link" property="urlLink" />
        <result column="create_time" property="createTime" />
        <result column="del_flag" property="delFlag" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, `name`, code, parking_lot_id, location, url_link, create_time, del_flag
    </sql>
    <select id="pageList" resultType="com.ruoyi.chargingPile.api.vo.TMonitoringEquipmentVO">
        SELECT
        tme.id, tme.`name`, tme.code, tme.parking_lot_id, tme.location, tme.url_link, tme.create_time, tme.del_flag, tpl.name AS parkingLotName
        FROM t_monitoring_equipment tme
        LEFT JOIN t_parking_lot tpl ON tme.parking_lot_id = tpl.id
        <where>
            <if test="query.parkingLotId != null">
                AND tme.parking_lot_id = #{query.parkingLotId}
            </if>
            AND tme.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
        </where>
        ORDER BY tme.create_time DESC
    </select>
 
</mapper>