<?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="status" property="status" />
|
<result column="faultTime" property="faultTime" />
|
<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,status,faultTime, 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.status,tme.faultTime, 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>
|
<if test="parkingLotIds != null and parkingLotIds.size()>0">
|
AND tme.parking_lot_id IN
|
<foreach collection="parkingLotIds" item="parkingLotId" open="(" separator="," close=")">
|
#{parkingLotId}
|
</foreach>
|
</if>
|
AND tme.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
|
</where>
|
ORDER BY tme.create_time DESC
|
</select>
|
|
</mapper>
|