|
@@ -309,6 +309,41 @@
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+ <select id="deficitLossAmountByDriver" resultType="java.lang.Double" parameterType="java.util.Map">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ FORMAT(sum(deficitLossAmount), 2) deficitLossAmount
|
|
|
|
|
+ from (
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ ( deficitAmount - FORMAT((loadAmount * loss / lossUnit),2) ) deficitLossAmount
|
|
|
|
|
+ from (
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ IFNULL(wo.deficit_amount, 0.0) deficitAmount,
|
|
|
|
|
+ IFNULL(lo.loss, 0.0) loss,
|
|
|
|
|
+ IFNULL(wo.load_amount, 0.0) loadAmount,
|
|
|
|
|
+ case when lo.loss_unit = 0 then 1000 when lo.loss_unit = 0 then 100 ELSE 0 end as lossUnit
|
|
|
|
|
+ from kwt_waybill_order wo
|
|
|
|
|
+ left join kwt_logistics_order lo on lo.id = wo.l_order_id
|
|
|
|
|
+ where wo.del_flag = 0 and lo.del_flag = 0
|
|
|
|
|
+ <if test="busStatus != null and busStatus == 4">
|
|
|
|
|
+ and wo.status in (7, 8, 9, 10, 12, 13)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="driverId != null and driverId != ''">
|
|
|
|
|
+ and wo.driver_id = #{driverId, jdbcType=BIGINT}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="month != null and month != ''">
|
|
|
|
|
+ and LEFT(wo.create_time, 7) = #{month, jdbcType=TIMESTAMP}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
|
|
+ and DATE(wo.create_time) <![CDATA[ >= ]]> #{startTime,jdbcType=TIMESTAMP}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
|
|
+ and DATE(wo.create_time) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ ) tab
|
|
|
|
|
+ ) tab1
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
<select id="findWaitWaybillOrderByDriver" resultType="com.sckw.transport.model.vo.WaybillOrderDriverVo"
|
|
<select id="findWaitWaybillOrderByDriver" resultType="com.sckw.transport.model.vo.WaybillOrderDriverVo"
|
|
|
parameterType="java.util.Map">
|
|
parameterType="java.util.Map">
|
|
|
SELECT *
|
|
SELECT *
|