XH-Power-Cloud/xhpc-modules/xhpc-log/src/main/resources/mapper/XhpcChargingStationMapper.xml
panshuling321 cbb55697e5 1、增加设备运行日志写入DB;
2、实现桩运行日志接口
2021-12-31 16:31:03 +08:00

51 lines
2.1 KiB
XML

<?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.xhpc.log.mapper.XhpcChargingStationMapper">
<select id="selectXhpcChargingStationList" resultType="java.util.Map">
select
cs.charging_station_id as chargingStationId,
cs.name as name,
ope.name as operatorName,
cs.address as address,
(select url from xhpc_img where img_id = cs.img_id and del_flag =0 limit 1) as url,
cs.client_visible as clientVisible,
cs.status as status
from xhpc_charging_station as cs
left join xhpc_operator as ope on cs.operator_id = ope.operator_id
where cs.del_flag =0
<if test="type == 1">
and cs.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{operatorId})
</if>
<if test="type == 2">
and cs.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{operatorId})
</if>
</select>
<select id="selectRateListByStationId" resultType="map">
select
rate_model_id as 'rateId',
create_time as 'createTime'
from xhpc_rate_time
where charging_station_id=#{stationId}
group by rate_model_id
</select>
<select id="selectRateTimeListByRateId" resultType="map">
select rt.start_time as startTime,
replace(rt.end_time, '00:00:00', '24:00:00') AS endTime,
rt.rate_id as rateId,
rt.rate_value as id,
ra.name as rateName,
ra.power_fee as powerFee,
ra.service_fee as serviceFee
from xhpc_rate_time as rt
left join xhpc_rate as ra on ra.rate_id = rt.rate_id
where rt.rate_model_id =#{rateId}
</select>
</mapper>