71 lines
2.7 KiB
XML
Raw Normal View History

2021-12-28 16:30:37 +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.activity.mapper.XhpcChargingStationMapper">
2021-12-28 16:30:37 +08:00
<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,
2022-04-28 14:44:31 +08:00
SUBSTRING_INDEX(cs.img_id,',',1) as url,
2021-12-28 16:30:37 +08:00
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
2022-01-04 15:36:00 +08:00
<if test="params.number == 1">
and cs.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{params.operatorId})
2021-12-28 16:30:37 +08:00
</if>
2022-01-04 15:36:00 +08:00
<if test="params.number == 2">
and cs.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{params.operatorId})
</if>
<if test="params.tenantId != null and params.tenantId != ''">
and cs.tenant_id=#{params.tenantId}
2021-12-28 16:30:37 +08:00
</if>
</select>
<select id="selectRateListByStationId" resultType="map">
select
rate_model_id as 'rateId',
2022-01-12 18:19:25 +08:00
create_time as 'createTime',
create_by as 'createBy'
2021-12-28 16:30:37 +08:00
from xhpc_rate_time
where charging_station_id=#{stationId}
group by rate_model_id
order by create_time desc
2021-12-28 16:30:37 +08:00
</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>
2022-01-12 18:19:25 +08:00
2022-01-12 18:27:20 +08:00
2022-01-12 18:19:25 +08:00
<select id="selectBaseRateTimeListByRateId" resultType="map">
SELECT
name as 'name',
power_fee as 'powerFee',
service_fee as 'serviceFee'
FROM xhpc_rate
WHERE rate_model_id=#{rateId};
</select>
<select id="selectAll" resultType="com.xhpc.common.domain.XhpcChargingStation">
select * from xhpc_charging_station
</select>
2021-12-28 16:30:37 +08:00
</mapper>