|
|
@@ -58,6 +58,46 @@
|
|
|
id, user_id, station_id, start_charge_seq, connector_id, start_time, end_time, soc, total_power, total_money, elec_money, service_money, sum_period, charge_detail, order_status, charge_status, stop_reason, invoice_status,invoice_id,create_time, update_time
|
|
|
</sql>
|
|
|
|
|
|
+ <select id="statChargeOrders" resultType="java.util.Map"
|
|
|
+ parameterType="com.kym.entity.admin.queryParams.CustomChargeOrdersQueryParam">
|
|
|
+ SELECT
|
|
|
+ count(*) totalOrders,
|
|
|
+ sum(t1.total_power) totalPower,
|
|
|
+ sum(t1.total_money) totalMoney,
|
|
|
+ sum(t1.elec_money) elecMoney,
|
|
|
+ sum(t1.service_money) serviceMoney
|
|
|
+ FROM
|
|
|
+ t_charge_order t1
|
|
|
+ LEFT JOIN t_user t2
|
|
|
+ ON t1.user_id = t2.id
|
|
|
+ <where>
|
|
|
+ <if test="params.userId != null">
|
|
|
+ and t2.user_id = #{params.userId}
|
|
|
+ </if>
|
|
|
+ <if test="params.mobilePhone != null and params.mobilePhone != ''">
|
|
|
+ and t2.mobile_phone = "#{params.mobilePhone}"
|
|
|
+ </if>
|
|
|
+ <if test="params.connectorId != null and params.connectorId != ''">
|
|
|
+ and t1.connector_id = "#{params.connectorId}"
|
|
|
+ </if>
|
|
|
+ <if test="params.startChargeSeq != null and params.startChargeSeq != ''">
|
|
|
+ and t1.start_charge_seq = "#{params.startChargeSeq}"
|
|
|
+ </if>
|
|
|
+ <if test="params.stationId != null and params.stationId != ''">
|
|
|
+ and t1.station_id = "#{params.stationId}"
|
|
|
+ </if>
|
|
|
+ <if test="params.orderStatus != null">
|
|
|
+ and t1.order_status = #{params.orderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="params.startDate != null and params.startDate != ''">
|
|
|
+ and t1.start_time >= "#{params.startDate}"
|
|
|
+ </if>
|
|
|
+ <if test="params.endDate != null and params.endDate != ''">
|
|
|
+ and t1.end_time <= "#{params.endDate}"
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="listChargeOrders" resultMap="CustomChargeOrderMap"
|
|
|
parameterType="com.kym.entity.admin.queryParams.CustomChargeOrdersQueryParam">
|
|
|
SELECT
|
|
|
@@ -80,28 +120,28 @@
|
|
|
ON t1.user_id = t2.id
|
|
|
<where>
|
|
|
<if test="params.userId != null">
|
|
|
- and t2.user_id = ${params.userId}
|
|
|
+ and t2.user_id = #{params.userId}
|
|
|
</if>
|
|
|
<if test="params.mobilePhone != null and params.mobilePhone != ''">
|
|
|
- and t2.mobile_phone = "${params.mobilePhone}"
|
|
|
+ and t2.mobile_phone = "#{params.mobilePhone}"
|
|
|
</if>
|
|
|
<if test="params.connectorId != null and params.connectorId != ''">
|
|
|
- and t1.connector_id = "${params.connectorId}"
|
|
|
+ and t1.connector_id = "#{params.connectorId}"
|
|
|
</if>
|
|
|
<if test="params.stationId != null and params.stationId != ''">
|
|
|
- and t1.station_id = "${params.stationId}"
|
|
|
+ and t1.station_id = "#{params.stationId}"
|
|
|
</if>
|
|
|
<if test="params.startChargeSeq != null and params.startChargeSeq != ''">
|
|
|
- and t1.start_charge_seq = "${params.startChargeSeq}"
|
|
|
+ and t1.start_charge_seq = "#{params.startChargeSeq}"
|
|
|
</if>
|
|
|
<if test="params.orderStatus != null">
|
|
|
- and t1.order_status = ${params.orderStatus}
|
|
|
+ and t1.order_status = #{params.orderStatus}
|
|
|
</if>
|
|
|
<if test="params.startDate != null and params.startDate != ''">
|
|
|
- and t1.start_time >= "${params.startDate}"
|
|
|
+ and t1.start_time >= "#{params.startDate}"
|
|
|
</if>
|
|
|
<if test="params.endDate != null and params.endDate != ''">
|
|
|
- and t1.end_time <= "${params.endDate}"
|
|
|
+ and t1.end_time <= "#{params.endDate}"
|
|
|
</if>
|
|
|
</where>
|
|
|
order by t1.start_time desc
|