|
|
@@ -82,22 +82,25 @@
|
|
|
<if test="params.userId != null">
|
|
|
and t2.user_id = ${params.userId}
|
|
|
</if>
|
|
|
- <if test="params.mobilePhone != null">
|
|
|
+ <if test="params.mobilePhone != null and params.mobilePhone != ''">
|
|
|
and t2.mobile_phone = "${params.mobilePhone}"
|
|
|
</if>
|
|
|
- <if test="params.connectorId != null">
|
|
|
+ <if test="params.connectorId != null and params.connectorId != ''">
|
|
|
and t1.connector_id = "${params.connectorId}"
|
|
|
</if>
|
|
|
- <if test="params.startChargeSeq != null">
|
|
|
+ <if test="params.stationId != null and params.stationId != ''">
|
|
|
+ and t1.station_id = "${params.stationId}"
|
|
|
+ </if>
|
|
|
+ <if test="params.startChargeSeq != null and params.startChargeSeq != ''">
|
|
|
and t1.start_charge_seq = "${params.startChargeSeq}"
|
|
|
</if>
|
|
|
<if test="params.orderStatus != null">
|
|
|
and t1.order_status = ${params.orderStatus}
|
|
|
</if>
|
|
|
- <if test="params.startDate != null">
|
|
|
+ <if test="params.startDate != null and params.startDate != ''">
|
|
|
and t1.start_time >= "${params.startDate}"
|
|
|
</if>
|
|
|
- <if test="params.endDate != null">
|
|
|
+ <if test="params.endDate != null and params.endDate != ''">
|
|
|
and t1.end_time <= "${params.endDate}"
|
|
|
</if>
|
|
|
</where>
|
|
|
@@ -106,7 +109,7 @@
|
|
|
|
|
|
<select id="stationStat" resultMap="StationStatMap" parameterType="com.kym.entity.admin.queryParams.StatQueryParam">
|
|
|
SELECT
|
|
|
- <if test="params.stationId != null">
|
|
|
+ <if test="params.stationId != null and params.stationId != ''">
|
|
|
t1.station_id,
|
|
|
</if>
|
|
|
<if test="params.type == null or params.type == 'day'">
|
|
|
@@ -127,17 +130,17 @@
|
|
|
FROM
|
|
|
t_charge_order
|
|
|
<where>
|
|
|
- <if test="params.stationId != null">
|
|
|
+ <if test="params.stationId != null and params.stationId != ''">
|
|
|
and station_id = #{params.stationId}
|
|
|
</if>
|
|
|
</where>
|
|
|
) t1
|
|
|
GROUP BY stat_time
|
|
|
<trim prefix="having" suffixOverrides="and">
|
|
|
- <if test="params.startTime != null">
|
|
|
+ <if test="params.startTime != null and params.startTime != ''">
|
|
|
stat_time >= #{params.startTime} and
|
|
|
</if>
|
|
|
- <if test="params.endTime != null">
|
|
|
+ <if test="params.endTime != null and params.endTime != ''">
|
|
|
stat_time <= #{params.endTime} and
|
|
|
</if>
|
|
|
</trim>
|
|
|
@@ -158,7 +161,7 @@
|
|
|
FROM
|
|
|
t_charge_order
|
|
|
<where>
|
|
|
- <if test="stationId != null">
|
|
|
+ <if test="stationId != null and stationId != ''">
|
|
|
AND station_id = #{stationId}
|
|
|
</if>
|
|
|
AND start_time >= DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00')
|