|
|
|
@ -1496,125 +1496,118 @@ |
|
|
|
<update id="syncUpdateWorkCenterCost" parameterType="java.util.List"> |
|
|
|
UPDATE work_center_cost |
|
|
|
SET |
|
|
|
item_no = CASE work_center_no |
|
|
|
item_no = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.itemNo,jdbcType=FLOAT} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.itemNo,jdbcType=FLOAT} |
|
|
|
</foreach> |
|
|
|
ELSE item_no |
|
|
|
END, |
|
|
|
unit_cost = CASE work_center_no |
|
|
|
unit_cost = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.unitCost,jdbcType=FLOAT} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.unitCost,jdbcType=FLOAT} |
|
|
|
</foreach> |
|
|
|
ELSE unit_cost |
|
|
|
END, |
|
|
|
overhead1_cost = CASE work_center_no |
|
|
|
overhead1_cost = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.overhead1Cost,jdbcType=FLOAT} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.overhead1Cost,jdbcType=FLOAT} |
|
|
|
</foreach> |
|
|
|
ELSE overhead1_cost |
|
|
|
END, |
|
|
|
overhead2_cost = CASE work_center_no |
|
|
|
overhead2_cost = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.overhead2Cost,jdbcType=FLOAT} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.overhead2Cost,jdbcType=FLOAT} |
|
|
|
</foreach> |
|
|
|
ELSE overhead2_cost |
|
|
|
END, |
|
|
|
um_id = CASE work_center_no |
|
|
|
um_id = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.umId} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.umId} |
|
|
|
</foreach> |
|
|
|
ELSE um_id |
|
|
|
END, |
|
|
|
begin_date = CASE work_center_no |
|
|
|
begin_date = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.beginDate} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.beginDate} |
|
|
|
</foreach> |
|
|
|
ELSE begin_date |
|
|
|
END, |
|
|
|
end_date = CASE work_center_no |
|
|
|
end_date = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.endDate} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.endDate} |
|
|
|
</foreach> |
|
|
|
ELSE end_date |
|
|
|
END, |
|
|
|
remark = CASE work_center_no |
|
|
|
remark = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.remark} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.remark} |
|
|
|
</foreach> |
|
|
|
ELSE remark |
|
|
|
END, |
|
|
|
current_work_center_cost = CASE work_center_no |
|
|
|
current_work_center_cost = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.currentWorkCenterCost} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.currentWorkCenterCost} |
|
|
|
</foreach> |
|
|
|
ELSE current_work_center_cost |
|
|
|
END, |
|
|
|
ifs_row_id = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.ifsRowId} |
|
|
|
</foreach> |
|
|
|
ELSE ifs_row_id |
|
|
|
END, |
|
|
|
ifs_row_version = CASE work_center_no |
|
|
|
ifs_row_version = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.ifsRowVersion} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.ifsRowVersion} |
|
|
|
</foreach> |
|
|
|
ELSE ifs_row_version |
|
|
|
END, |
|
|
|
cost_set = CASE work_center_no |
|
|
|
cost_set = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.costSet} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.costSet} |
|
|
|
</foreach> |
|
|
|
ELSE cost_set |
|
|
|
END, |
|
|
|
cost_set_desc = CASE work_center_no |
|
|
|
cost_set_desc = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.costSetDesc} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.costSetDesc} |
|
|
|
</foreach> |
|
|
|
ELSE cost_set_desc |
|
|
|
END, |
|
|
|
wc_rate = CASE work_center_no |
|
|
|
wc_rate = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.wcRate} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.wcRate} |
|
|
|
</foreach> |
|
|
|
ELSE wc_rate |
|
|
|
END, |
|
|
|
wc_cost_code = CASE work_center_no |
|
|
|
wc_cost_code = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.wcCostCode} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.wcCostCode} |
|
|
|
</foreach> |
|
|
|
ELSE wc_cost_code |
|
|
|
END, |
|
|
|
overhead1_fac = CASE work_center_no |
|
|
|
overhead1_fac = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.overhead1Fac} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.overhead1Fac} |
|
|
|
</foreach> |
|
|
|
ELSE overhead1_fac |
|
|
|
END, |
|
|
|
overhead2_fac = CASE work_center_no |
|
|
|
overhead2_fac = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.overhead2Fac} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.overhead2Fac} |
|
|
|
</foreach> |
|
|
|
ELSE overhead2_fac |
|
|
|
END, |
|
|
|
overhead1_appl = CASE work_center_no |
|
|
|
overhead1_appl = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.overhead1Appl} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.overhead1Appl} |
|
|
|
</foreach> |
|
|
|
ELSE overhead1_appl |
|
|
|
END, |
|
|
|
overhead2_appl = CASE work_center_no |
|
|
|
overhead2_appl = CASE ifs_row_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.overhead2Appl} |
|
|
|
WHEN #{item.ifsRowId} THEN #{item.overhead2Appl} |
|
|
|
</foreach> |
|
|
|
ELSE overhead2_appl |
|
|
|
END |
|
|
|
WHERE work_center_no IN |
|
|
|
WHERE ifs_row_id IN |
|
|
|
<foreach item="item" index="index" collection="list" open="(" close=")" separator=","> |
|
|
|
#{item.workCenterNo} |
|
|
|
#{item.ifsRowId} |
|
|
|
</foreach> |
|
|
|
AND site = #{list[0].site} |
|
|
|
</update> |
|
|
|
|
|
|
|
<select id="getRoutingComponentRowKeyAndVersion" resultType="RoutingComponentEntity"> |
|
|
|
|