65 lines
2.6 KiB
XML
Raw Normal View History

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">
2021-07-20 16:51:57 +08:00
<mapper namespace="com.xhpc.charging.station.mapper.XhpcRateTimeMapper">
2021-07-28 18:07:25 +08:00
<resultMap id="BaseResultMap" type="com.xhpc.common.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"/>
<result property="sort" column="sort"/>
<result property="type" column="type"/>
<result property="rateValue" column="rate_value"/>
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
from xhpc_rate_time
where charging_station_id = #{datchargingStationId}
and start_time &lt;= #{date}
and end_time &gt;= #{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
2021-07-20 16:51:57 +08:00
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}
2021-07-20 16:51:57 +08:00
</select>
<select id="getXhpcRateTimeType" resultType="map">
select ra.power_fee as powerFee,
ra.service_fee as serviceFee
2021-07-20 16:51:57 +08:00
from xhpc_rate as ra
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>
2021-07-28 18:07:25 +08:00
</mapper>