|
|
@@ -29,17 +29,43 @@
|
|
|
load_amount, total_load_amount, total_unload_amount, remark, `status`, create_by,
|
|
|
create_time, update_by, update_time, del_flag
|
|
|
</sql>
|
|
|
+
|
|
|
<select id="findGoodsUnit" resultType="com.sckw.transport.model.KwtLogisticsOrderGoodsUnit" parameterType="java.util.Map" >
|
|
|
SELECT
|
|
|
id, l_order_id lOrderId, goods_id goodsId, from_unit fromUnit, to_unit toUnit,
|
|
|
- conversion_value conversionValue, unit, unload_amount unloadAmount,
|
|
|
- load_amount loadAmount, total_load_amount totalLoadAmount, total_unload_amount totalUnloadAmount,
|
|
|
+ conversion_value conversionValue, unit, IFNULL(SUM(unload_amount), 0.0) unloadAmount,
|
|
|
+ IFNULL(SUM(load_amount), 0.0) loadAmount, IFNULL(SUM(total_load_amount), 0.0) totalLoadAmount,
|
|
|
+ IFNULL(SUM(total_unload_amount), 0.0) totalUnloadAmount,
|
|
|
remark, status, create_by createBy, create_time createTime, update_by updateBy, update_time updateTime
|
|
|
from kwt_logistics_order_goods_unit
|
|
|
where del_flag = 0
|
|
|
<if test="lOrderId != null and goodsId != ''">
|
|
|
and l_order_id = #{lOrderId, jdbcType=BIGINT}
|
|
|
</if>
|
|
|
+ <if test="unit != null and unit != ''">
|
|
|
+ and unit = #{unit, jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
ORDER BY create_time desc
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="findGoodsUnitCount" resultType="com.sckw.transport.model.KwtLogisticsOrderGoodsUnit" parameterType="java.util.Map" >
|
|
|
+ SELECT
|
|
|
+ IFNULL(SUM(logu.load_amount), 0.0) loadAmount,
|
|
|
+ IFNULL(SUM(logu.unload_amount), 0.0) unloadAmount,
|
|
|
+ IFNULL(SUM(logu.total_load_amount), 0.0) totalLoadAmount,
|
|
|
+ IFNULL(SUM(logu.total_unload_amount), 0.0) totalUnloadAmount
|
|
|
+ from kwt_logistics_order_goods_unit logu
|
|
|
+ left join kwt_logistics_order lo on lo.id = logu.l_order_id
|
|
|
+ where logu.del_flag = 0 and lo.del_flag = 0
|
|
|
+ <if test="belowlOrderId != null and belowlOrderId != ''">
|
|
|
+ and FIND_IN_SET(#{belowlOrderId, jdbcType=BIGINT}, lo.pids)
|
|
|
+ and logu.l_order_id != #{belowlOrderId, jdbcType=BIGINT}
|
|
|
+ </if>
|
|
|
+ <if test="upperlOrderId != null and upperlOrderId != ''">
|
|
|
+ and FIND_IN_SET(#{upperlOrderId, jdbcType=BIGINT}, lo.pids)
|
|
|
+ </if>
|
|
|
+ <if test="unit != null and unit != ''">
|
|
|
+ and logu.unit = #{unit}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|