You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
5.6 KiB

<?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.charge.task.dao.StationChargeDayReportDOMapper" >
<resultMap id="BaseResultMap" type="com.charge.task.model.StationChargeDayReportDO" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="BIGINT" />
<result column="station_id" property="stationId" jdbcType="BIGINT" />
<result column="charge_day" property="chargeDay" jdbcType="DATE" />
<result column="charge_month" property="chargeMonth" jdbcType="INTEGER" />
<result column="tip_charge_degree" property="tipChargeDegree" jdbcType="DECIMAL" />
<result column="tip_service_fee" property="tipServiceFee" jdbcType="DECIMAL" />
<result column="tip_elec_fee" property="tipElecFee" jdbcType="DECIMAL" />
<result column="tip_total_fee" property="tipTotalFee" jdbcType="DECIMAL" />
<result column="tip_elec_cost" property="tipElecCost" jdbcType="DECIMAL" />
<result column="peak_charge_degree" property="peakChargeDegree" jdbcType="DECIMAL" />
<result column="peak_service_fee" property="peakServiceFee" jdbcType="DECIMAL" />
<result column="peak_elec_fee" property="peakElecFee" jdbcType="DECIMAL" />
<result column="peak_total_fee" property="peakTotalFee" jdbcType="DECIMAL" />
<result column="peak_elec_cost" property="peakElecCost" jdbcType="DECIMAL" />
<result column="flat_charge_degree" property="flatChargeDegree" jdbcType="DECIMAL" />
<result column="flat_service_fee" property="flatServiceFee" jdbcType="DECIMAL" />
<result column="flat_elec_fee" property="flatElecFee" jdbcType="DECIMAL" />
<result column="flat_total_fee" property="flatTotalFee" jdbcType="DECIMAL" />
<result column="flat_elec_cost" property="flatElecCost" jdbcType="DECIMAL" />
<result column="valley_charge_degree" property="valleyChargeDegree" jdbcType="DECIMAL" />
<result column="valley_service_fee" property="valleyServiceFee" jdbcType="DECIMAL" />
<result column="valley_elec_fee" property="valleyElecFee" jdbcType="DECIMAL" />
<result column="valley_total_fee" property="valleyTotalFee" jdbcType="DECIMAL" />
<result column="valley_elec_cost" property="valleyElecCost" jdbcType="DECIMAL" />
<result column="total_degree" property="totalDegree" jdbcType="DECIMAL" />
<result column="total_fee" property="totalFee" jdbcType="DECIMAL" />
<result column="total_cost" property="totalCost" jdbcType="DECIMAL" />
<result column="zero" property="zero" jdbcType="DECIMAL" />
<result column="one" property="one" jdbcType="DECIMAL" />
<result column="two" property="two" jdbcType="DECIMAL" />
<result column="three" property="three" jdbcType="DECIMAL" />
<result column="four" property="four" jdbcType="DECIMAL" />
<result column="five" property="five" jdbcType="DECIMAL" />
<result column="six" property="six" jdbcType="DECIMAL" />
<result column="seven" property="seven" jdbcType="DECIMAL" />
<result column="eight" property="eight" jdbcType="DECIMAL" />
<result column="nine" property="nine" jdbcType="DECIMAL" />
<result column="ten" property="ten" jdbcType="DECIMAL" />
<result column="eleven" property="eleven" jdbcType="DECIMAL" />
<result column="twelve" property="twelve" jdbcType="DECIMAL" />
<result column="thirteen" property="thirteen" jdbcType="DECIMAL" />
<result column="fourteen" property="fourteen" jdbcType="DECIMAL" />
<result column="fifteen" property="fifteen" jdbcType="DECIMAL" />
<result column="sixteen" property="sixteen" jdbcType="DECIMAL" />
<result column="seventeen" property="seventeen" jdbcType="DECIMAL" />
<result column="eighteen" property="eighteen" jdbcType="DECIMAL" />
<result column="nineteen" property="nineteen" jdbcType="DECIMAL" />
<result column="twenty" property="twenty" jdbcType="DECIMAL" />
<result column="twenty_one" property="twentyOne" jdbcType="DECIMAL" />
<result column="twenty_two" property="twentyTwo" jdbcType="DECIMAL" />
<result column="twenty_three" property="twentyThree" jdbcType="DECIMAL" />
<result column="hour_sum_degree" property="hourSumDegree" jdbcType="DECIMAL" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<select id="queryTimeFlagInfo" resultType="com.charge.task.model.ChargeInfo">
SELECT
eco.station_id stationId,
sum( ecod.charge_degree ) chargeDegree,
sum( ecod.service_fee ) serviceFee,
sum( ecod.electric_fee ) electricFee,
sum( ( ecod.service_fee + ecod.electric_fee ) ) AS totalFee,
sum( ecod.cost_fee ) cost,
ecod.time_flag timeFlag
FROM
t_equipment_charge_order eco
LEFT JOIN t_equipment_charge_order_detail ecod ON eco.order_no = ecod.order_no
LEFT JOIN t_station s on eco.station_id = s.id
WHERE
eco.state = 3
AND s.is_hlht = 0
AND ecod.charge_startr_time >= #{startTime}
AND ecod.charge_startr_time &lt;= #{endTime}
AND eco.charge_settle_type = 2
AND eco.`charge_degree` > 0
AND eco.`actual_pay_amount` > 0
GROUP BY
stationId,time_flag
ORDER BY
station_id DESC
</select>
<select id="queryZeroStationId" resultType="java.lang.Long">
SELECT
id AS stationId
FROM
t_station
WHERE
is_hlht = 0
AND id NOT IN ( SELECT station_id FROM t_station_charge_day_report WHERE charge_day = #{yesterday} )
</select>
</mapper>