|
|
@ -34,6 +34,7 @@
|
|
|
|
<result column="EMPLOYEE" property="employee" />
|
|
|
|
<result column="EMPLOYEE" property="employee" />
|
|
|
|
<result column="SOURCE_RESOURCE" property="sourceResource" />
|
|
|
|
<result column="SOURCE_RESOURCE" property="sourceResource" />
|
|
|
|
<result column="WORK_ORDER" property="workOrder" />
|
|
|
|
<result column="WORK_ORDER" property="workOrder" />
|
|
|
|
|
|
|
|
<result column="ITEM_NUMBER" property="itemNumber" />
|
|
|
|
<result column="WORK_CENTER" property="workCenter" />
|
|
|
|
<result column="WORK_CENTER" property="workCenter" />
|
|
|
|
<result column="DISPATCH_NO" property="dispatchNo" />
|
|
|
|
<result column="DISPATCH_NO" property="dispatchNo" />
|
|
|
|
<result column="DISPATCH_QTY" property="dispatchQty" />
|
|
|
|
<result column="DISPATCH_QTY" property="dispatchQty" />
|
|
|
@ -629,54 +630,71 @@
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="findCallItemList" resultMap="FullResultMap">
|
|
|
|
<select id="findCallItemList" resultMap="FullResultMap">
|
|
|
|
SELECT ZCI.HANDLE, ZCI.SITE, CF.VALUE WORK_ORDER, ZSD.WORK_CENTER, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, IT.ITEM, ITT.DESCRIPTION ITEM_DESCRIPTION, ZSD.BLANKING_SIZE,
|
|
|
|
SELECT *
|
|
|
|
ZSD.STEP_ID, ZCI.SFC_DISPATCH_BO, ZSD.DISPATCH_STATUS, ZCI.OPERATION, OPT.DESCRIPTION OPERATION_DESCRIPTION, ZSD.RESOURCE_TYPE, ZCI.RESRCE, ZSD.DISPATCH_QTY, ZSD.PLANNED_START_DATE, ZSD.REMARK,
|
|
|
|
FROM (
|
|
|
|
CASE WHEN VP.NEWS = '1' AND VP.CALLES = '0' AND VP.ISSUED = '0' THEN N'未叫料'
|
|
|
|
SELECT ZCI.SITE, CF.VALUE WORK_ORDER, CS.VALUE ITEM_NUMBER, ZSD.WORK_CENTER, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, IT.ITEM, ITT.DESCRIPTION ITEM_DESCRIPTION, ZSD.BLANKING_SIZE,
|
|
|
|
WHEN VP.NEWS = '0' AND (VP.CALLES = '1' OR VP.ISSUED = '1') THEN N'全部推送'
|
|
|
|
ZSD.STEP_ID, ZCI.SFC_DISPATCH_BO, ZSD.DISPATCH_STATUS, ZCI.OPERATION, OPT.DESCRIPTION OPERATION_DESCRIPTION, ZSD.RESOURCE_TYPE, ZCI.RESRCE, ZSD.DISPATCH_QTY, ZSD.PLANNED_START_DATE, ZSD.REMARK,
|
|
|
|
ELSE N'部分推送' END CALL_STATUS,
|
|
|
|
CASE WHEN VP.NEWS = '1' AND VP.CALLES = '0' AND VP.ISSUED = '0' THEN 'NONE'
|
|
|
|
CASE WHEN (VP.NEWS = '1' OR VP.CALLES = '1') AND VP.ISSUED = '0' THEN N'未发料'
|
|
|
|
WHEN VP.NEWS = '0' AND (VP.CALLES = '1' OR VP.ISSUED = '1') THEN 'ALL'
|
|
|
|
WHEN VP.NEWS = '0' AND VP.CALLES = '0' AND VP.ISSUED = '1' THEN N'发料完成'
|
|
|
|
ELSE 'PART' END CALL_STATUS,
|
|
|
|
ELSE N'部分发料' END ISSUE_STATUS
|
|
|
|
CASE WHEN (VP.NEWS = '1' OR VP.CALLES = '1') AND VP.ISSUED = '0' THEN 'NONE'
|
|
|
|
FROM Z_SFC_DISPATCH ZSD
|
|
|
|
WHEN VP.NEWS = '0' AND VP.CALLES = '0' AND VP.ISSUED = '1' THEN 'ALL'
|
|
|
|
INNER JOIN Z_CALL_ITEM ZCI ON ZCI.SFC_DISPATCH_BO = ZSD.HANDLE
|
|
|
|
ELSE 'ALL' END ISSUE_STATUS
|
|
|
|
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE AND ZSD.SHOP_ORDER = SO.SHOP_ORDER
|
|
|
|
FROM Z_SFC_DISPATCH ZSD
|
|
|
|
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF.ATTRIBUTE = 'WORK_ORDER'
|
|
|
|
INNER JOIN Z_CALL_ITEM ZCI ON ZCI.SFC_DISPATCH_BO = ZSD.HANDLE
|
|
|
|
INNER JOIN ITEM IT ON IT.HANDLE = SO.ITEM_BO
|
|
|
|
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE AND ZSD.SHOP_ORDER = SO.SHOP_ORDER
|
|
|
|
LEFT JOIN ITEM_T ITT ON ITT.ITEM_BO = IT.HANDLE AND ITT.LOCALE = 'zh'
|
|
|
|
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF.ATTRIBUTE = 'WORK_ORDER'
|
|
|
|
INNER JOIN OPERATION OP ON OP.SITE = ZCI.SITE AND OP.OPERATION = ZCI.OPERATION AND OP.CURRENT_REVISION = 'true'
|
|
|
|
LEFT JOIN CUSTOM_FIELDS CS ON CS.HANDLE = SO.HANDLE AND CS.ATTRIBUTE = 'ITEM_NUMBER'
|
|
|
|
LEFT JOIN OPERATION_T OPT ON OPT.OPERATION_BO = OP.HANDLE AND OPT.LOCALE = 'zh'
|
|
|
|
INNER JOIN ITEM IT ON IT.HANDLE = SO.ITEM_BO
|
|
|
|
LEFT JOIN (
|
|
|
|
LEFT JOIN ITEM_T ITT ON ITT.ITEM_BO = IT.HANDLE AND ITT.LOCALE = 'zh'
|
|
|
|
SELECT SFC_DISPATCH_BO,
|
|
|
|
INNER JOIN OPERATION OP ON OP.SITE = ZCI.SITE AND OP.OPERATION = ZCI.OPERATION AND OP.CURRENT_REVISION = 'true'
|
|
|
|
MAX(DECODE(STATUS, '801', '1', '0')) NEWS,
|
|
|
|
LEFT JOIN OPERATION_T OPT ON OPT.OPERATION_BO = OP.HANDLE AND OPT.LOCALE = 'zh'
|
|
|
|
MAX(DECODE(STATUS, '802', '1', '0')) CALLES,
|
|
|
|
LEFT JOIN (
|
|
|
|
MAX(DECODE(STATUS, '803', '1', '0')) ISSUED,
|
|
|
|
SELECT SFC_DISPATCH_BO,
|
|
|
|
MAX(DECODE(STATUS, '804', '1', '0')) CANCELED
|
|
|
|
MAX(DECODE(STATUS, '801', '1', '0')) NEWS,
|
|
|
|
FROM Z_CALL_ITEM
|
|
|
|
MAX(DECODE(STATUS, '802', '1', '0')) CALLES,
|
|
|
|
GROUP BY SFC_DISPATCH_BO
|
|
|
|
MAX(DECODE(STATUS, '803', '1', '0')) ISSUED,
|
|
|
|
) VP ON VP.SFC_DISPATCH_BO = ZCI.SFC_DISPATCH_BO
|
|
|
|
MAX(DECODE(STATUS, '804', '1', '0')) CANCELED
|
|
|
|
WHERE ZSD.SITE = #{site}
|
|
|
|
FROM Z_CALL_ITEM
|
|
|
|
<if test="workCenter != null and workCenter != ''">
|
|
|
|
GROUP BY SFC_DISPATCH_BO
|
|
|
|
AND ZSD.WORK_CENTER = #{workCenter}
|
|
|
|
) VP ON VP.SFC_DISPATCH_BO = ZCI.SFC_DISPATCH_BO
|
|
|
|
</if>
|
|
|
|
WHERE ZSD.SITE = #{site}
|
|
|
|
<if test="dispatchStatus != null and dispatchStatus != ''">
|
|
|
|
<if test="workCenter != null and workCenter != ''">
|
|
|
|
AND ZSD.DISPATCH_STATUS = #{dispatchStatus}
|
|
|
|
AND ZSD.WORK_CENTER = #{workCenter}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="workOrder != null and workOrder != ''">
|
|
|
|
<if test="dispatchStatus != null and dispatchStatus != ''">
|
|
|
|
AND CF.VALUE LIKE '%' ||#{workOrder}|| '%'
|
|
|
|
AND ZSD.DISPATCH_STATUS = #{dispatchStatus}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="shopOrder != null and shopOrder != ''">
|
|
|
|
<if test="workOrder != null and workOrder != ''">
|
|
|
|
AND SO.SHOP_ORDER = #{shopOrder}
|
|
|
|
AND CF.VALUE LIKE '%' ||#{workOrder}|| '%'
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="resourceType != null and resourceType != ''">
|
|
|
|
<if test="shopOrder != null and shopOrder != ''">
|
|
|
|
AND ZSD.RESOURCE_TYPE = #{resourceType}
|
|
|
|
AND SO.SHOP_ORDER = #{shopOrder}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="resourceType != null and resourceType != ''">
|
|
|
|
|
|
|
|
AND ZSD.RESOURCE_TYPE = #{resourceType}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="resrce != null and resrce != ''">
|
|
|
|
|
|
|
|
AND ZCI.RESRCE = #{resrce}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="startFromDate != null">
|
|
|
|
|
|
|
|
AND ZSD.PLANNED_START_DATE >= #{startFromDate}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="startToDate != null">
|
|
|
|
|
|
|
|
AND ZSD.PLANNED_START_DATE <= #{startToDate}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
GROUP BY ZCI.SITE, CF.VALUE, CS.VALUE, ZSD.WORK_CENTER, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, IT.ITEM, ITT.DESCRIPTION, ZSD.BLANKING_SIZE,
|
|
|
|
|
|
|
|
ZSD.STEP_ID, ZCI.SFC_DISPATCH_BO, ZSD.DISPATCH_STATUS, ZCI.OPERATION, OPT.DESCRIPTION, ZSD.RESOURCE_TYPE, ZCI.RESRCE, ZSD.DISPATCH_QTY, ZSD.PLANNED_START_DATE, ZSD.REMARK,
|
|
|
|
|
|
|
|
VP.NEWS, VP.CALLES, VP.ISSUED, VP.CANCELED
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
WHERE 1= 1
|
|
|
|
|
|
|
|
<if test="callStatus != null and callStatus != ''">
|
|
|
|
|
|
|
|
AND CALL_STATUS = #{callStatus}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="resrce != null and resrce != ''">
|
|
|
|
<if test="issueStatus != null and issueStatus != ''">
|
|
|
|
AND ZCI.RESRCE = #{resrce}
|
|
|
|
AND ISSUE_STATUS = #{issueStatus}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
GROUP BY ZCI.HANDLE, ZCI.SITE, CF.VALUE, ZSD.WORK_CENTER, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, IT.ITEM, ITT.DESCRIPTION, ZSD.BLANKING_SIZE,
|
|
|
|
ORDER BY SFC, STEP_ID
|
|
|
|
ZSD.STEP_ID, ZCI.SFC_DISPATCH_BO, ZSD.DISPATCH_STATUS, ZCI.OPERATION, OPT.DESCRIPTION, ZSD.RESOURCE_TYPE, ZCI.RESRCE, ZSD.DISPATCH_QTY, ZSD.PLANNED_START_DATE, ZSD.REMARK,
|
|
|
|
|
|
|
|
VP.NEWS, VP.CALLES, VP.ISSUED, VP.CANCELED
|
|
|
|
|
|
|
|
ORDER BY ZSD.SFC, ZSD.STEP_ID
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="findCallItemDetailList" resultMap="FullResultMap">
|
|
|
|
<select id="findCallItemDetailList" resultMap="FullResultMap">
|
|
|
@ -742,6 +760,18 @@
|
|
|
|
<if test="callType != null and callType != ''" >
|
|
|
|
<if test="callType != null and callType != ''" >
|
|
|
|
AND ZCI.CALL_TYPE = #{callType}
|
|
|
|
AND ZCI.CALL_TYPE = #{callType}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="startFromDate != null">
|
|
|
|
|
|
|
|
AND ZSD.PLANNED_START_DATE >= #{startFromDate}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="startToDate != null">
|
|
|
|
|
|
|
|
AND ZSD.PLANNED_START_DATE <= #{startToDate}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="requireFromDate != null">
|
|
|
|
|
|
|
|
AND ZCI.REQUIRED_DATE_TIME >= #{requireFromDate}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="requireToDate != null">
|
|
|
|
|
|
|
|
AND ZCI.REQUIRED_DATE_TIME <= #{requireToDate}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
ORDER BY ZSD.SFC, ZSD.STEP_ID, ZCI.CALL_TYPE
|
|
|
|
ORDER BY ZSD.SFC, ZSD.STEP_ID, ZCI.CALL_TYPE
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|