45 lines
2.3 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">
<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" />
</resultMap>
<select id="getXhpcRateTime" resultType="Long">
select rate_id as rateId 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 and type=0
</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
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 type=1 and charging_station_id =#{datchargingStationId} LIMIT 1)
</select>
</mapper>