|
|
|
@ -146,6 +146,8 @@
|
|
|
|
|
a2.spec,
|
|
|
|
|
a2.measname,
|
|
|
|
|
a2.bindRlFk,
|
|
|
|
|
a2.nameCode,
|
|
|
|
|
a1.invCode,
|
|
|
|
|
SUM(
|
|
|
|
|
CASE
|
|
|
|
|
WHEN a1.mainAction = 'WareHouseOut' THEN
|
|
|
|
@ -159,9 +161,15 @@
|
|
|
|
|
FROM auth_warehouse aw
|
|
|
|
|
LEFT JOIN io_order a1 ON a1.fromInvCode = aw.CODE
|
|
|
|
|
LEFT JOIN io_order_detail_result a2 ON a1.billNo = a2.orderIdFk
|
|
|
|
|
LEFT JOIN basic_udirel bu ON a2.bindRlFk = bu.id
|
|
|
|
|
<where>
|
|
|
|
|
a1.status = 7
|
|
|
|
|
and a2.bindRlFk is not null
|
|
|
|
|
|
|
|
|
|
<if test="hcType != null and hcType != ''">
|
|
|
|
|
AND bu.hcType = #{hcType}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="invCode != null and invCode != ''">
|
|
|
|
|
AND a1.invCode = #{invCode}
|
|
|
|
|
</if>
|
|
|
|
@ -192,6 +200,58 @@
|
|
|
|
|
group by a2.bindRlFk
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="filterInvProductDetailOutList" resultType="com.glxp.api.res.inv.InvProductDetailResponse">
|
|
|
|
|
SELECT a2.coName,
|
|
|
|
|
a2.spec,
|
|
|
|
|
a2.measname,
|
|
|
|
|
a2.bindRlFk,
|
|
|
|
|
a2.nameCode,
|
|
|
|
|
a2.batchNo,
|
|
|
|
|
a2.productDate as produceDate,
|
|
|
|
|
a2.expireDate,
|
|
|
|
|
a1.invCode,
|
|
|
|
|
a2.price,
|
|
|
|
|
a2.count as outCount,
|
|
|
|
|
a1.billNo as orderId,
|
|
|
|
|
a1.mainAction,
|
|
|
|
|
a1.auditTime as orderTime
|
|
|
|
|
FROM auth_warehouse aw
|
|
|
|
|
LEFT JOIN io_order a1 ON a1.fromInvCode = aw.CODE
|
|
|
|
|
LEFT JOIN io_order_detail_result a2 ON a1.billNo = a2.orderIdFk
|
|
|
|
|
LEFT JOIN basic_udirel bu ON a2.bindRlFk = bu.id
|
|
|
|
|
<where>
|
|
|
|
|
a1.status = 7
|
|
|
|
|
and a2.bindRlFk is not null
|
|
|
|
|
|
|
|
|
|
<if test="hcType != null and hcType != ''">
|
|
|
|
|
AND bu.hcType = #{hcType}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="invCode != null and invCode != ''">
|
|
|
|
|
AND a1.invCode = #{invCode}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="relId != null and relId != ''">
|
|
|
|
|
AND a2.bindRlFk = #{relId}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="mainAction != null and mainAction != ''">
|
|
|
|
|
AND a1.mainAction = #{mainAction}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="action != null and action != ''">
|
|
|
|
|
AND a1.action = #{action}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="mainAction != null and mainAction != ''">
|
|
|
|
|
AND a1.mainAction = #{mainAction}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
|
|
|
|
AND date_format(a1.auditTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and
|
|
|
|
|
date_format(#{endTime}, '%Y-%m-%d')
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectStatDataByTime" resultType="com.glxp.api.res.inv.IoOrderDetailStatRsponse">
|
|
|
|
|
select orderIdFk,
|
|
|
|
|
bindRlFk,
|
|
|
|
|