|
|
|
@ -46,9 +46,10 @@
|
|
|
|
|
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
|
|
|
|
|
<result column="PRODUCT_CATEGORY" property="productCategory" />
|
|
|
|
|
<result column="STEP_ID" property="stepId" />
|
|
|
|
|
<result column="WORK_ORDER" property="workOrder" />
|
|
|
|
|
<result column="ITEM_NUMBER" property="itemNumber" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="abnormalBillDto" type="com.foreverwin.mesnac.anomaly.dto.AbnormalBillDto" extends="BaseResultMap">
|
|
|
|
|
<result column="SEQ" property="seq"/>
|
|
|
|
|
<result column="ITEM_DESCRIPTION" property="itemDescription"/>
|
|
|
|
@ -79,7 +80,7 @@
|
|
|
|
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
HANDLE, SITE, ABNORMAL_NO, STATUS, CORRECTION, PROGRAM, TYPE, ITEM_BO, SFC, OPERATION, WORK_CENTER, SHOP_ORDER, MESSAGE_TYPE, RESRCE, NC_CODE, SHUT_DOWN, RESPONSE_USER, RESPONSE_DATE_TIME, PB_DESCRIPTION, NC_QTY, PB_GRADE, PB_USER, PB_QTY, REPAIR_DATE_TIME, DISCOVER, INSPECTOR, ENTITY_LOCATION, REPORT_FROM, OBJECT_BO, PB_PHOTOSHOP, CANCEL_CODE, CANCEL_REASON, CANCEL_DATE_TIME, CANCEL_USER, REPORT_SEND_USER_GROUP, CANCEL_SEND_USER_GROUP, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME, PRODUCT_CATEGORY, STEP_ID
|
|
|
|
|
HANDLE, SITE, ABNORMAL_NO, STATUS, CORRECTION, PROGRAM, TYPE, ITEM_BO, SFC, OPERATION, WORK_CENTER, SHOP_ORDER, MESSAGE_TYPE, RESRCE, NC_CODE, SHUT_DOWN, RESPONSE_USER, RESPONSE_DATE_TIME, PB_DESCRIPTION, NC_QTY, PB_GRADE, PB_USER, PB_QTY, REPAIR_DATE_TIME, DISCOVER, INSPECTOR, ENTITY_LOCATION, REPORT_FROM, OBJECT_BO, PB_PHOTOSHOP, CANCEL_CODE, CANCEL_REASON, CANCEL_DATE_TIME, CANCEL_USER, REPORT_SEND_USER_GROUP, CANCEL_SEND_USER_GROUP, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME, PRODUCT_CATEGORY, STEP_ID, WORK_ORDER, ITEM_NUMBER
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<!-- BaseMapper标准查询/修改/删除 -->
|
|
|
|
@ -155,6 +156,8 @@
|
|
|
|
|
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
|
|
|
|
<if test="ew.entity.productCategory!=null"> AND PRODUCT_CATEGORY=#{ew.entity.productCategory}</if>
|
|
|
|
|
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
|
|
|
|
<if test="ew.entity.workOrder!=null"> AND WORK_ORDER=#{ew.entity.workOrder}</if>
|
|
|
|
|
<if test="ew.entity.itemNumber!=null"> AND ITEM_NUMBER=#{ew.entity.itemNumber}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@ -207,6 +210,8 @@
|
|
|
|
|
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
|
|
|
|
<if test="ew.entity.productCategory!=null"> AND PRODUCT_CATEGORY=#{ew.entity.productCategory}</if>
|
|
|
|
|
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
|
|
|
|
<if test="ew.entity.workOrder!=null"> AND WORK_ORDER=#{ew.entity.workOrder}</if>
|
|
|
|
|
<if test="ew.entity.itemNumber!=null"> AND ITEM_NUMBER=#{ew.entity.itemNumber}</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
@ -267,6 +272,8 @@
|
|
|
|
|
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
|
|
|
|
<if test="ew.entity.productCategory!=null"> AND PRODUCT_CATEGORY=#{ew.entity.productCategory}</if>
|
|
|
|
|
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
|
|
|
|
<if test="ew.entity.workOrder!=null"> AND WORK_ORDER=#{ew.entity.workOrder}</if>
|
|
|
|
|
<if test="ew.entity.itemNumber!=null"> AND ITEM_NUMBER=#{ew.entity.itemNumber}</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
@ -327,6 +334,8 @@
|
|
|
|
|
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
|
|
|
|
<if test="ew.entity.productCategory!=null"> AND PRODUCT_CATEGORY=#{ew.entity.productCategory}</if>
|
|
|
|
|
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
|
|
|
|
<if test="ew.entity.workOrder!=null"> AND WORK_ORDER=#{ew.entity.workOrder}</if>
|
|
|
|
|
<if test="ew.entity.itemNumber!=null"> AND ITEM_NUMBER=#{ew.entity.itemNumber}</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
@ -387,6 +396,8 @@
|
|
|
|
|
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
|
|
|
|
<if test="ew.entity.productCategory!=null"> AND PRODUCT_CATEGORY=#{ew.entity.productCategory}</if>
|
|
|
|
|
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
|
|
|
|
<if test="ew.entity.workOrder!=null"> AND WORK_ORDER=#{ew.entity.workOrder}</if>
|
|
|
|
|
<if test="ew.entity.itemNumber!=null"> AND ITEM_NUMBER=#{ew.entity.itemNumber}</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
@ -447,14 +458,16 @@
|
|
|
|
|
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
|
|
|
|
<if test="ew.entity.productCategory!=null"> AND PRODUCT_CATEGORY=#{ew.entity.productCategory}</if>
|
|
|
|
|
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
|
|
|
|
<if test="ew.entity.workOrder!=null"> AND WORK_ORDER=#{ew.entity.workOrder}</if>
|
|
|
|
|
<if test="ew.entity.itemNumber!=null"> AND ITEM_NUMBER=#{ew.entity.itemNumber}</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
|
|
|
AND ${ew.sqlSegment}
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
|
|
|
|
AND ${ew.sqlSegment}
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@ -507,6 +520,8 @@
|
|
|
|
|
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
|
|
|
|
<if test="ew.entity.productCategory!=null"> AND PRODUCT_CATEGORY=#{ew.entity.productCategory}</if>
|
|
|
|
|
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
|
|
|
|
<if test="ew.entity.workOrder!=null"> AND WORK_ORDER=#{ew.entity.workOrder}</if>
|
|
|
|
|
<if test="ew.entity.itemNumber!=null"> AND ITEM_NUMBER=#{ew.entity.itemNumber}</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
@ -563,6 +578,8 @@
|
|
|
|
|
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
|
|
|
|
|
<if test="productCategory!=null">PRODUCT_CATEGORY,</if>
|
|
|
|
|
<if test="stepId!=null">STEP_ID,</if>
|
|
|
|
|
<if test="workOrder!=null">WORK_ORDER,</if>
|
|
|
|
|
<if test="itemNumber!=null">ITEM_NUMBER,</if>
|
|
|
|
|
</trim> VALUES
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
#{handle},
|
|
|
|
@ -607,6 +624,8 @@
|
|
|
|
|
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
|
|
|
|
|
<if test="productCategory!=null">#{productCategory},</if>
|
|
|
|
|
<if test="stepId!=null">#{stepId},</if>
|
|
|
|
|
<if test="workOrder!=null">#{workOrder},</if>
|
|
|
|
|
<if test="itemNumber!=null">#{itemNumber},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
@ -658,6 +677,8 @@
|
|
|
|
|
#{modifiedDateTime},
|
|
|
|
|
#{productCategory},
|
|
|
|
|
#{stepId},
|
|
|
|
|
#{workOrder},
|
|
|
|
|
#{itemNumber},
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
@ -705,6 +726,8 @@
|
|
|
|
|
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
|
|
|
|
|
<if test="et.productCategory!=null">PRODUCT_CATEGORY=#{et.productCategory},</if>
|
|
|
|
|
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
|
|
|
|
|
<if test="et.workOrder!=null">WORK_ORDER=#{et.workOrder},</if>
|
|
|
|
|
<if test="et.itemNumber!=null">ITEM_NUMBER=#{et.itemNumber},</if>
|
|
|
|
|
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
@ -752,6 +775,8 @@
|
|
|
|
|
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
|
|
|
|
|
PRODUCT_CATEGORY=#{et.productCategory},
|
|
|
|
|
STEP_ID=#{et.stepId},
|
|
|
|
|
WORK_ORDER=#{et.workOrder},
|
|
|
|
|
ITEM_NUMBER=#{et.itemNumber},
|
|
|
|
|
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
@ -799,6 +824,8 @@
|
|
|
|
|
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
|
|
|
|
|
<if test="et.productCategory!=null">PRODUCT_CATEGORY=#{et.productCategory},</if>
|
|
|
|
|
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
|
|
|
|
|
<if test="et.workOrder!=null">WORK_ORDER=#{et.workOrder},</if>
|
|
|
|
|
<if test="et.itemNumber!=null">ITEM_NUMBER=#{et.itemNumber},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="ew!=null">
|
|
|
|
@ -845,6 +872,8 @@
|
|
|
|
|
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
|
|
|
|
<if test="ew.entity.productCategory!=null"> AND PRODUCT_CATEGORY=#{ew.entity.productCategory}</if>
|
|
|
|
|
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
|
|
|
|
<if test="ew.entity.workOrder!=null"> AND WORK_ORDER=#{ew.entity.workOrder}</if>
|
|
|
|
|
<if test="ew.entity.itemNumber!=null"> AND ITEM_NUMBER=#{ew.entity.itemNumber}</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
@ -922,6 +951,8 @@
|
|
|
|
|
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
|
|
|
|
<if test="ew.entity.productCategory!=null"> AND PRODUCT_CATEGORY=#{ew.entity.productCategory}</if>
|
|
|
|
|
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
|
|
|
|
<if test="ew.entity.workOrder!=null"> AND WORK_ORDER=#{ew.entity.workOrder}</if>
|
|
|
|
|
<if test="ew.entity.itemNumber!=null"> AND ITEM_NUMBER=#{ew.entity.itemNumber}</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
@ -940,7 +971,6 @@
|
|
|
|
|
</delete>
|
|
|
|
|
<!-- BaseMapper标准查询/修改/删除 -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="backLog" resultMap="abnormalBillDto">
|
|
|
|
|
SELECT ROW_NUMBER() OVER(ORDER BY ZAB.ABNORMAL_NO ASC) SEQ,ZAB.ABNORMAL_NO ABNORMAL_NO,
|
|
|
|
|
ZAB.STATUS STATUS, IT.DESCRIPTION ITEM_DESCRIPTION, ZAB.CREATED_DATE_TIME CREATED_DATE_TIME,
|
|
|
|
@ -1222,23 +1252,23 @@
|
|
|
|
|
|
|
|
|
|
<select id="findReplaceMessageByAbnoraml" resultType="java.util.HashMap">
|
|
|
|
|
SELECT wct.DESCRIPTION WORKCENTER,so.SHOP_ORDER SHOPORDER ,item.VALUE PROJECT,it.DESCRIPTION ITEM,
|
|
|
|
|
LISTAGG(nct.DESCRIPTION , ',') WITHIN GROUP(ORDER BY zab.ABNORMAL_NO) NC,
|
|
|
|
|
r.DESCRIPTION "RESOURCE",r2.DESCRIPTION WORKCENTER_LIN
|
|
|
|
|
LISTAGG(nct.DESCRIPTION , ',') WITHIN GROUP(ORDER BY zab.ABNORMAL_NO) NC,
|
|
|
|
|
r.DESCRIPTION "RESOURCE",r2.DESCRIPTION WORKCENTER_LIN
|
|
|
|
|
FROM Z_ABNORMAL_BILL zab
|
|
|
|
|
INNER JOIN ITEM i ON i.HANDLE = zab.ITEM_BO
|
|
|
|
|
LEFT JOIN RESRCE r ON r.RESRCE = zab.RESRCE AND r.SITE = zab.SITE
|
|
|
|
|
LEFT JOIN Z_ABNORMAL_BILL_DISPOSE zabd ON zabd.ABNORMAL_BILL_BO = zab.HANDLE
|
|
|
|
|
LEFT JOIN Z_ABNORMAL_NC_CODE zanc ON zanc.ABNORMAL_BILL_BO = zab.HANDLE
|
|
|
|
|
LEFT JOIN NC_CODE_T nct ON nct.NC_CODE_BO = 'NCCodeBO:'|| zanc.SITE || ',' || zanc.NC_CODE AND nct.LOCALE = 'zh'
|
|
|
|
|
LEFT JOIN ITEM_T it ON it.ITEM_BO = i.HANDLE AND it.LOCALE = 'zh'
|
|
|
|
|
LEFT JOIN WORK_CENTER wc ON wc.WORK_CENTER = zab.WORK_CENTER AND wc.SITE = zab.SITE
|
|
|
|
|
LEFT JOIN WORK_CENTER_T wct ON wct.WORK_CENTER_BO = wc.HANDLE AND wct.LOCALE = 'zh'
|
|
|
|
|
LEFT JOIN SHOP_ORDER so ON so.SHOP_ORDER = zab.SHOP_ORDER AND so.SITE = zab.SITE
|
|
|
|
|
LEFT JOIN CUSTOM_FIELDS item ON item.HANDLE = so.HANDLE AND item."ATTRIBUTE" = 'ITEM_NUMBER'
|
|
|
|
|
LEFT JOIN ROUTER r2 ON r2.HANDLE = so.PLANNED_ROUTER_BO
|
|
|
|
|
INNER JOIN ITEM i ON i.HANDLE = zab.ITEM_BO
|
|
|
|
|
LEFT JOIN RESRCE r ON r.RESRCE = zab.RESRCE AND r.SITE = zab.SITE
|
|
|
|
|
LEFT JOIN Z_ABNORMAL_BILL_DISPOSE zabd ON zabd.ABNORMAL_BILL_BO = zab.HANDLE
|
|
|
|
|
LEFT JOIN Z_ABNORMAL_NC_CODE zanc ON zanc.ABNORMAL_BILL_BO = zab.HANDLE
|
|
|
|
|
LEFT JOIN NC_CODE_T nct ON nct.NC_CODE_BO = 'NCCodeBO:'|| zanc.SITE || ',' || zanc.NC_CODE AND nct.LOCALE = 'zh'
|
|
|
|
|
LEFT JOIN ITEM_T it ON it.ITEM_BO = i.HANDLE AND it.LOCALE = 'zh'
|
|
|
|
|
LEFT JOIN WORK_CENTER wc ON wc.WORK_CENTER = zab.WORK_CENTER AND wc.SITE = zab.SITE
|
|
|
|
|
LEFT JOIN WORK_CENTER_T wct ON wct.WORK_CENTER_BO = wc.HANDLE AND wct.LOCALE = 'zh'
|
|
|
|
|
LEFT JOIN SHOP_ORDER so ON so.SHOP_ORDER = zab.SHOP_ORDER AND so.SITE = zab.SITE
|
|
|
|
|
LEFT JOIN CUSTOM_FIELDS item ON item.HANDLE = so.HANDLE AND item."ATTRIBUTE" = 'ITEM_NUMBER'
|
|
|
|
|
LEFT JOIN ROUTER r2 ON r2.HANDLE = so.PLANNED_ROUTER_BO
|
|
|
|
|
<where>
|
|
|
|
|
<if test="abnormalBill != null">
|
|
|
|
|
zab.SITE = #{abnormalBill.site}
|
|
|
|
|
zab.SITE = #{abnormalBill.site}
|
|
|
|
|
<if test="abnormalBill.abnormalNo != null and abnormalBill.abnormalNo != ''">
|
|
|
|
|
AND zab.ABNORMAL_NO = #{abnormalBill.abnormalNo}
|
|
|
|
|
</if>
|
|
|
|
@ -1249,4 +1279,5 @@
|
|
|
|
|
</where>
|
|
|
|
|
GROUP BY wct.DESCRIPTION ,so.SHOP_ORDER ,item.VALUE ,it.DESCRIPTION,r.DESCRIPTION,r2.DESCRIPTION
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
|