2021-07-20 16:51:57 +08:00
<?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.charging.station.mapper.XhpcRateTimeMapper" >
<resultMap id= "BaseResultMap" type= "com.xhpc.charging.station.domain.XhpcRateTime" >
<result property= "rateTimeId" column= "rate_time_id" />
<result property= "chargingStationId" column= "charging_station_id" />
<result property= "rateId" column= "rate_id" />
<result property= "startTime" column= "start_time" />
<result property= "endTime" column= "end_time" />
<result property= "status" column= "status" />
<result property= "delFlag" column= "del_flag" />
<result property= "rateModelId" column= "rate_model_id" />
<result property= "delFlag" column= "del_flag" />
<result property= "createTime" column= "create_time" />
<result property= "createBy" column= "create_by" />
<result property= "updateTime" column= "update_time" />
<result property= "updateBy" column= "update_by" />
<result property= "remark" column= "remark" />
2021-07-22 20:08:33 +08:00
<result property= "sort" column= "sort" />
2021-07-20 16:51:57 +08:00
</resultMap>
2021-07-22 13:52:21 +08:00
<select id= "getXhpcRateTime" resultType= "map" >
select
rate_time_id as rateTimeId,
rate_id as rateId,
start_time as startTime,
end_time as endTime
2021-07-22 20:08:33 +08:00
from xhpc_rate_time where charging_station_id =#{datchargingStationId} and start_time < =#{date} and end_time > =#{date} and status=0 and del_flag=0
2021-07-20 16:51:57 +08:00
</select>
<select id= "getXhpcTimeType" resultType= "map" >
select
ra.power_fee as powerFee,
ra.service_fee as serviceFee
from xhpc_rate as ra
where ra.charging_station_id =#{datchargingStationId} and ra.status=0 and ra.del_flag=0 and ra.rate_id=#{rateId}
</select>
<select id= "getXhpcRateTimeType" resultType= "map" >
select
ra.power_fee as powerFee,
ra.service_fee as serviceFee
from xhpc_rate as ra
2021-07-22 20:08:33 +08:00
where ra.charging_station_id =#{datchargingStationId} and ra.status=0 and ra.del_flag=0 and ra.rate_id=(select rate_id from xhpc_rate_time where status=0 and del_flag=0 and charging_station_id =#{datchargingStationId} LIMIT 1)
2021-07-20 16:51:57 +08:00
</select>
</mapper>