|
|
@ -77,44 +77,53 @@
|
|
|
|
ORDER BY B2.PRODUCT_LINE_CODE, VMC.ORDER_CODE, BP.PRODUCT_LINE_CODE
|
|
|
|
ORDER BY B2.PRODUCT_LINE_CODE, VMC.ORDER_CODE, BP.PRODUCT_LINE_CODE
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="WIPInquiryReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap">SELECT
|
|
|
|
<select id="WIPInquiryReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
|
|
|
|
B2.PRODUCT_LINE_CODE,
|
|
|
|
SELECT B2.PRODUCT_LINE_CODE,
|
|
|
|
B2.PRODUCT_LINE_NAME,
|
|
|
|
B2.PRODUCT_LINE_NAME,
|
|
|
|
VMC.ORDER_CODE,
|
|
|
|
SD.ORDER_CODE,
|
|
|
|
VMC.MATERIAL_CODE,
|
|
|
|
SD.MATERIAL_CODE,
|
|
|
|
BM.MATERIAL_NAME,
|
|
|
|
SD.MATERIAL_NAME,
|
|
|
|
BO.MATERIAL_CODE PRODUCT_CODE,
|
|
|
|
BO.MATERIAL_CODE PRODUCT_CODE,
|
|
|
|
BO.MATERIAL_NAME PRODUCT_NAME,
|
|
|
|
BO.MATERIAL_NAME PRODUCT_NAME,
|
|
|
|
COUNT(*) COMP_AMOUNT
|
|
|
|
COUNT(*) COMP_AMOUNT
|
|
|
|
FROM VIEW_MATERIAL_COMPLETION VMC
|
|
|
|
FROM (
|
|
|
|
|
|
|
|
SELECT PB.ORDER_CODE, VMC.MATERIAL_BARCODE, BM.MATERIAL_CODE, BM.MATERIAL_NAME
|
|
|
|
|
|
|
|
FROM C##AUCMA_SCADA.MATERIAL_COMPLETION VMC
|
|
|
|
LEFT JOIN BASE_PRODUCTLINE BP ON BP.PRODUCT_LINE_CODE = VMC.STATION_NAME
|
|
|
|
LEFT JOIN BASE_PRODUCTLINE BP ON BP.PRODUCT_LINE_CODE = VMC.STATION_NAME
|
|
|
|
LEFT JOIN BASE_PRODUCTLINE B2 ON B2.PRODUCT_LINE_CODE = BP.PARENT_ID
|
|
|
|
LEFT JOIN C##AUCMA_SCADA.PRINT_BARCODE PB ON VMC.MATERIAL_BARCODE = PB.MATERIAL_BARCODE AND PRINT_BARTYPE = 1
|
|
|
|
LEFT JOIN BASE_ORDERINFO BO ON BO.ORDER_CODE = VMC.ORDER_CODE AND BO.ORDER_AMOUNT > BO.COMPLETE_AMOUNT
|
|
|
|
LEFT JOIN C##AUCMA_SCADA.PRODUCT_OFFLINE PO ON PO.BOX_CODE = PB.MATERIAL_BARCODE
|
|
|
|
LEFT JOIN BASE_MATERIALINFO BM ON BM.MATERIAL_CODE = VMC.MATERIAL_CODE
|
|
|
|
LEFT JOIN BASE_MATERIALINFO BM ON BM.MATERIAL_CODE = PB.MATERIAL_CODE
|
|
|
|
<where>
|
|
|
|
WHERE PB.MATERIAL_BARCODE IS NOT NULL
|
|
|
|
VMC.IS_DOWN_LINE = 0
|
|
|
|
AND PO.BOX_CODE IS NULL
|
|
|
|
<if test="productLineCode != null and productLineCode != ''">
|
|
|
|
AND VMC.COMPLETE_DATE > (SYSDATE - 3)
|
|
|
|
AND VMC.PRODUCT_LINE_CODE = #{productLineCode}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="beginStationCode != null and beginStationCode != ''">
|
|
|
|
<if test="beginStationCode != null and beginStationCode != ''">
|
|
|
|
AND BP.EXECUTION_SORT >= #{beginStationCode}
|
|
|
|
AND BP.EXECUTION_SORT >= #{beginStationCode}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="endStationCode != null and endStationCode != ''">
|
|
|
|
<if test="endStationCode != null and endStationCode != ''">
|
|
|
|
AND #{endStationCode} >= BP.EXECUTION_SORT
|
|
|
|
AND #{endStationCode} > BP.EXECUTION_SORT
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
GROUP BY PB.ORDER_CODE, VMC.MATERIAL_BARCODE, BM.MATERIAL_CODE, BM.MATERIAL_NAME
|
|
|
|
|
|
|
|
) SD
|
|
|
|
|
|
|
|
LEFT JOIN BASE_ORDERINFO BO ON BO.ORDER_CODE = SD.ORDER_CODE
|
|
|
|
|
|
|
|
LEFT JOIN BASE_PRODUCTLINE B2 ON B2.WORK_CENTER_CODE = BO.WORK_CENTER_CODE
|
|
|
|
|
|
|
|
LEFT JOIN BASE_MATERIALINFO BM ON BM.MATERIAL_CODE = BO.MATERIAL_CODE
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="productLineCode != null and productLineCode != ''">
|
|
|
|
|
|
|
|
AND B2.PRODUCT_LINE_CODE = #{productLineCode}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="ORDER_CODE != null and ORDER_CODE != ''">
|
|
|
|
<if test="ORDER_CODE != null and ORDER_CODE != ''">
|
|
|
|
and VMC.ORDER_CODE = #{ORDER_CODE}
|
|
|
|
and SD.ORDER_CODE = #{ORDER_CODE}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="PRODUCT_CODE != null and PRODUCT_CODE != ''">
|
|
|
|
<if test="PRODUCT_CODE != null and PRODUCT_CODE != ''">
|
|
|
|
and BO.MATERIAL_CODE like concat(#{PRODUCT_CODE}, '%')
|
|
|
|
and BO.MATERIAL_CODE = #{PRODUCT_CODE}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="PRODUCT_NAME != null and PRODUCT_NAME != ''">
|
|
|
|
<if test="PRODUCT_NAME != null and PRODUCT_NAME != ''">
|
|
|
|
and BO.MATERIAL_NAME like concat(concat('%', #{PRODUCT_NAME}), '%')
|
|
|
|
and BO.MATERIAL_NAME like concat(concat('%', #{PRODUCT_NAME}), '%')
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
GROUP BY B2.PRODUCT_LINE_CODE, B2.PRODUCT_LINE_NAME, VMC.ORDER_CODE, VMC.MATERIAL_CODE, BM.MATERIAL_NAME,
|
|
|
|
GROUP BY B2.PRODUCT_LINE_CODE, B2.PRODUCT_LINE_NAME, SD.ORDER_CODE, SD.MATERIAL_CODE, SD.MATERIAL_NAME,
|
|
|
|
BO.MATERIAL_CODE, BO.MATERIAL_NAME
|
|
|
|
BO.MATERIAL_CODE, BO.MATERIAL_NAME
|
|
|
|
ORDER BY B2.PRODUCT_LINE_CODE, VMC.ORDER_CODE
|
|
|
|
ORDER BY COMP_AMOUNT DESC
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="qualityDefectsStatisticalAnalysisList"
|
|
|
|
<select id="qualityDefectsStatisticalAnalysisList"
|
|
|
|