<?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.TChargingPileMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ruoyi.chargingPile.api.model.TChargingPile">
|
<id column="id" property="id" />
|
<result column="code" property="code" />
|
<result column="name" property="name" />
|
<result column="number" property="number" />
|
<result column="type" property="type" />
|
<result column="site_id" property="siteId" />
|
<result column="partner_id" property="partnerId" />
|
<result column="manufacturer_code" property="manufacturerCode" />
|
<result column="manufacturer" property="manufacturer" />
|
<result column="equipment_type" property="equipmentType" />
|
<result column="production_date" property="productionDate" />
|
<result column="rated_power" property="ratedPower" />
|
<result column="charging_station_number" property="chargingStationNumber" />
|
<result column="status" property="status" />
|
<result column="create_time" property="createTime" />
|
<result column="del_flag" property="delFlag" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, code, `name`, `number`, `type`, site_id, partner_id, manufacturer_code, manufacturer, equipment_type, production_date, rated_power, charging_station_number, status, create_time, del_flag
|
</sql>
|
|
|
|
<select id="pageChargingPileList" resultType="com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO">
|
select
|
a.id,
|
a.code,
|
a.name,
|
a.number,
|
a.type,
|
a.site_id as siteId,
|
b.name as siteName,
|
a.partner_id as partnerId,
|
c.name as partnerName,
|
a.manufacturer,
|
a.equipment_type as equipmentType,
|
a.rated_power as ratedPower
|
from t_charging_pile a
|
left join t_site b on (a.site_id = b.id)
|
left join t_partner c on (a.partner_id = c.id)
|
where a.del_flag = 0
|
<if test="null != item.siteId">
|
and a.site_id = #{item.siteId}
|
</if>
|
<if test="null != item.name and '' != item.name">
|
and a.name like CONCAT('%', #{item.name}, '%')
|
</if>
|
<if test="null != item.type">
|
and a.type = #{item.type}
|
</if>
|
<if test="null != siteIds">
|
and a.site_id in
|
<foreach collection="siteIds" item="itemm" index="index" open="(" separator="," close=")">
|
#{itemm}
|
</foreach>
|
</if>
|
order by a.create_time desc
|
</select>
|
|
|
<select id="getChargingPile" resultMap="BaseResultMap">
|
select
|
a.*,
|
b.name as siteName,
|
c.name as partnerName
|
from t_charging_pile a
|
left join t_site b on (a.site_id = b.id)
|
left join t_partner c on (a.partner_id = c.id)
|
where a.id = #{id}
|
</select>
|
<select id="getChargingGunList" resultType="com.ruoyi.chargingPile.api.vo.TChargingPileVO">
|
select id,code, `name`, `number` from t_charging_pile
|
where del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} and site_id = #{siteId}
|
</select>
|
|
|
|
<select id="getChargingGunMonitoring" resultType="com.ruoyi.chargingPile.dto.ChargingGunMonitoring">
|
select
|
a.id,
|
a.status,
|
CONCAT(b.number, a.name) as name,
|
a.parking_number as parkingNumber
|
from t_charging_gun a
|
left join t_charging_pile b on (a.charging_pile_id = b.id)
|
where a.del_flag = 0
|
<if test="null != siteIds and siteIds.size() > 0">
|
and a.site_id in
|
<foreach collection="siteIds" item="item" index="index" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
<if test="null != query.status and query.status.size() > 0">
|
and a.status in
|
<foreach collection="query.status" item="item" index="index" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
<if test="null != query.name and '' != query.name">
|
and a.name like CONCAT('%', #{query.name}, '%')
|
</if>
|
</select>
|
</mapper>
|