fix: 修复

lh_dev_fifo
chenhc 10 months ago
parent 5f184d3013
commit d74fa6d603

@ -36,6 +36,7 @@ public class FilterOrderDetailDeptResultRequest extends ListPageRequest {
private String confirmStarTime; //发票确认起始日期 private String confirmStarTime; //发票确认起始日期
private String confirmEndTime; //发票确认结束日期 private String confirmEndTime; //发票确认结束日期
private String corpName;//供应商名字 private String corpName;//供应商名字
private String fromInvCode;//供应商名字
private Boolean groupBuy; //是否集采产品 private Boolean groupBuy; //是否集采产品

@ -120,15 +120,17 @@
<select id="filterOrderDeptList" resultType="com.glxp.api.res.inout.IoOrderDetailDeptResultResponse"> <select id="filterOrderDeptList" resultType="com.glxp.api.res.inout.IoOrderDetailDeptResultResponse">
SELECT SELECT
aw.code as fromInvCode, aw.code as fromInvCode,
SUM(CASE WHEN a1.mainAction = 'WareHouseIn' THEN COALESCE(a2.price,0) * COALESCE(a2.count,0) aw.name as fromInvName,
WHEN a1.mainAction = 'WareHouseOut' THEN -(COALESCE(a2.price,0) * COALESCE(a2.count,0)) SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN COALESCE(a2.price,0) * COALESCE(a2.count,0)
WHEN a1.mainAction = 'WareHouseIn' THEN -(COALESCE(a2.price,0) * COALESCE(a2.count,0))
ELSE 0 ELSE 0
END) AS amount, END) AS amount,
SUM(CASE WHEN a1.mainAction = 'WareHouseIn' THEN COALESCE(a2.count,0)
WHEN a1.mainAction = 'WareHouseOut' THEN -(COALESCE(a2.count,0)) SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN COALESCE(a2.count,0)
WHEN a1.mainAction = 'WareHouseIn' THEN -(COALESCE(a2.count,0))
ELSE 0 ELSE 0
END) AS `count`, END) AS `count`
aw.name as fromInvName
FROM auth_warehouse aw FROM auth_warehouse aw
LEFT JOIN io_order a1 ON a1.fromInvCode = aw.CODE LEFT JOIN io_order a1 ON a1.fromInvCode = aw.CODE
LEFT JOIN io_order_detail_result a2 ON a1.billNo = a2.orderIdFk LEFT JOIN io_order_detail_result a2 ON a1.billNo = a2.orderIdFk
@ -137,6 +139,9 @@
<if test="invCode != null and invCode != ''"> <if test="invCode != null and invCode != ''">
AND a1.invCode = #{invCode} AND a1.invCode = #{invCode}
</if> </if>
<if test="mainAction != null and mainAction != ''">
AND a1.mainAction = #{mainAction}
</if>
<if test="action != null and action != ''"> <if test="action != null and action != ''">
AND a1.action = #{action} AND a1.action = #{action}
</if> </if>
@ -146,6 +151,9 @@
<if test="fromCorp != null and fromCorp != ''"> <if test="fromCorp != null and fromCorp != ''">
AND a1.fromCorp = #{fromCorp} AND a1.fromCorp = #{fromCorp}
</if> </if>
<if test="fromInvCode != null and fromInvCode != ''">
AND a1.fromInvCode = #{fromInvCode}
</if>
<if test="startAduditTime != null and startAduditTime != '' and endAduditTime != null and endAduditTime != ''"> <if test="startAduditTime != null and startAduditTime != '' and endAduditTime != null and endAduditTime != ''">
AND date_format(a1.auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and AND date_format(a1.auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and
date_format(#{endAduditTime}, '%Y-%m-%d') date_format(#{endAduditTime}, '%Y-%m-%d')

Loading…
Cancel
Save