|
|
@ -85,6 +85,8 @@
|
|
|
|
SD.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,
|
|
|
|
|
|
|
|
MAX(BO.ORDER_AMOUNT) ORDER_AMOUNT,
|
|
|
|
|
|
|
|
MAX(BO.COMPLETE_AMOUNT) COMPLETE_AMOUNT,
|
|
|
|
COUNT(*) COMP_AMOUNT
|
|
|
|
COUNT(*) COMP_AMOUNT
|
|
|
|
FROM (
|
|
|
|
FROM (
|
|
|
|
SELECT PB.ORDER_CODE,
|
|
|
|
SELECT PB.ORDER_CODE,
|
|
|
@ -113,7 +115,7 @@
|
|
|
|
) SD
|
|
|
|
) SD
|
|
|
|
LEFT JOIN BASE_ORDERINFO BO ON BO.ORDER_CODE = SD.ORDER_CODE
|
|
|
|
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_PRODUCTLINE B2 ON B2.WORK_CENTER_CODE = BO.WORK_CENTER_CODE
|
|
|
|
<where>
|
|
|
|
WHERE BO.ORDER_AMOUNT != BO.COMPLETE_AMOUNT
|
|
|
|
<if test="productLineCode != null and productLineCode != ''">
|
|
|
|
<if test="productLineCode != null and productLineCode != ''">
|
|
|
|
AND B2.PRODUCT_LINE_CODE = #{productLineCode}
|
|
|
|
AND B2.PRODUCT_LINE_CODE = #{productLineCode}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
@ -126,7 +128,6 @@
|
|
|
|
<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>
|
|
|
|
|
|
|
|
GROUP BY B2.PRODUCT_LINE_CODE, B2.PRODUCT_LINE_NAME, SD.ORDER_CODE, SD.MATERIAL_CODE, SD.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 COMP_AMOUNT DESC
|
|
|
|
ORDER BY COMP_AMOUNT DESC
|
|
|
@ -654,7 +655,7 @@
|
|
|
|
LEFT JOIN BASE_ORDERINFO BO ON BO.ORDER_CODE = SD.ORDER_CODE
|
|
|
|
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_PRODUCTLINE B2 ON B2.WORK_CENTER_CODE = BO.WORK_CENTER_CODE
|
|
|
|
LEFT JOIN BASE_PRODUCTLINE ST ON ST.EXECUTION_SORT = SD.EXECUTION_SORT
|
|
|
|
LEFT JOIN BASE_PRODUCTLINE ST ON ST.EXECUTION_SORT = SD.EXECUTION_SORT
|
|
|
|
<where>
|
|
|
|
WHERE BO.ORDER_AMOUNT != BO.COMPLETE_AMOUNT
|
|
|
|
<if test="productLineCode != null and productLineCode != ''">
|
|
|
|
<if test="productLineCode != null and productLineCode != ''">
|
|
|
|
AND B2.PRODUCT_LINE_CODE = #{productLineCode}
|
|
|
|
AND B2.PRODUCT_LINE_CODE = #{productLineCode}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
@ -667,7 +668,6 @@
|
|
|
|
<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>
|
|
|
|
|
|
|
|
ORDER BY SD.COMPLETE_DATE
|
|
|
|
ORDER BY SD.COMPLETE_DATE
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|