|
|
@@ -279,7 +279,7 @@
|
|
|
|
|
|
<select id="findTicketCountByAddress" resultType="com.sckw.transport.model.vo.WaybillCountVo">
|
|
|
SELECT
|
|
|
- sum(wot.amount) amount,
|
|
|
+ IFNULL(sum(wot.amount), 0.0) amount,
|
|
|
MIN(wot.operate_time) loadTime,
|
|
|
MAX(wot.operate_time) unloadTime
|
|
|
from kwt_waybill_order_ticket wot
|
|
|
@@ -337,4 +337,42 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="findWaybillOrder" resultType="com.sckw.transport.model.KwtWaybillOrderV1" parameterType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ kwo.id, kwo.id wOrderId, kwo.w_order_no worderNo, kwo.type, kwo.ent_id carrierEntId, kwo.truck_id truckId, kwo.truck_no truckNo, kwo.status,
|
|
|
+ kwo.create_time createTime, kwo.driver_id driverId, kwo.driver_name driverName, kwo.driver_phone driverPhone, kwo.ent_id entId
|
|
|
+ FROM kwt_waybill_order kwo
|
|
|
+ where kwo.del_flag = 0
|
|
|
+ <if test="driverId != null and driverId != ''">
|
|
|
+ and kwo.driver_id = #{driverId, jdbcType=BIGINT}
|
|
|
+ </if>
|
|
|
+ <if test="truckNo != null and truckNo != ''">
|
|
|
+ and kwo.truck_no = #{truckNo, jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ and kwo.status = #{status, jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="busStatus != null and busStatus == 2">
|
|
|
+ and kwo.status = 201
|
|
|
+ </if>
|
|
|
+ <if test="busStatus != null and busStatus == 3">
|
|
|
+ and kwo.status in (203, 301, 302, 401, 402)
|
|
|
+ </if>
|
|
|
+ <if test="busStatus != null and busStatus == 4">
|
|
|
+ and kwo.status in (102, 103, 202, 501, 502, 503, 504)
|
|
|
+ </if>
|
|
|
+ <if test="lOrderId != null and lOrderId != ''">
|
|
|
+ and kwo.id in (SELECT w_order_id from kwt_waybill_order_subtask where del_flag = 0 and l_order_id = #{lOrderId, jdbcType=BIGINT} ))
|
|
|
+ </if>
|
|
|
+ <choose>
|
|
|
+ <when test="lOrderIds != null and lOrderIds != '' and lOrderIds.size() > 0">
|
|
|
+ and kwo.id in (
|
|
|
+ SELECT w_order_id from kwt_waybill_order_subtask where del_flag = 0 and l_order_id in
|
|
|
+ <foreach collection="lOrderIds" item="lOrderId" open="(" close=")" separator=",">
|
|
|
+ #{lOrderId,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
</mapper>
|