|
|
|
@ -1174,18 +1174,43 @@ |
|
|
|
|
|
|
|
<!-- 批量更新 --> |
|
|
|
<update id="syncUpdateLocation" parameterType="java.util.List"> |
|
|
|
UPDATE location SET |
|
|
|
<foreach item="item" index="index" collection="list" separator=","> |
|
|
|
location_name = #{item.locationName}, |
|
|
|
active = #{item.active}, |
|
|
|
warehouse_id = #{item.warehouseId}, |
|
|
|
location_type = #{item.locationType}, |
|
|
|
ifs_row_version = #{item.ifsRowVersion} |
|
|
|
UPDATE location |
|
|
|
SET |
|
|
|
location_name = CASE location_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.locationId} THEN #{item.locationName} |
|
|
|
</foreach> |
|
|
|
WHERE |
|
|
|
<foreach item="item" index="index" collection="list" open="(" separator=") OR (" close=")"> |
|
|
|
location_id = #{item.locationId} AND site = #{item.site} |
|
|
|
ELSE location_name |
|
|
|
END, |
|
|
|
active = CASE location_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.locationId} THEN #{item.active} |
|
|
|
</foreach> |
|
|
|
ELSE active |
|
|
|
END, |
|
|
|
warehouse_id = CASE location_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.locationId} THEN #{item.warehouseId} |
|
|
|
</foreach> |
|
|
|
ELSE warehouse_id |
|
|
|
END, |
|
|
|
location_type = CASE location_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.locationId} THEN #{item.locationType} |
|
|
|
</foreach> |
|
|
|
ELSE location_type |
|
|
|
END, |
|
|
|
ifs_row_version = CASE location_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.locationId} THEN #{item.ifsRowVersion} |
|
|
|
</foreach> |
|
|
|
ELSE ifs_row_version |
|
|
|
END |
|
|
|
WHERE location_id IN |
|
|
|
<foreach item="item" index="index" collection="list" open="(" close=")" separator=","> |
|
|
|
#{item.locationId} |
|
|
|
</foreach> |
|
|
|
AND site = #{list[0].site} |
|
|
|
</update> |
|
|
|
|
|
|
|
<!-- <!– 批量更新 –>--> |
|
|
|
@ -1233,17 +1258,37 @@ |
|
|
|
|
|
|
|
<!-- 批量更新 --> |
|
|
|
<update id="syncUpdateLaborClass" parameterType="java.util.List"> |
|
|
|
UPDATE labor_class SET |
|
|
|
<foreach item="item" index="index" collection="list" separator=","> |
|
|
|
level_desc = #{item.levelDesc}, |
|
|
|
active = #{item.active}, |
|
|
|
level_cost = #{item.levelCost}, |
|
|
|
ifs_row_version = #{item.ifsRowVersion} |
|
|
|
UPDATE labor_class |
|
|
|
SET |
|
|
|
level_desc = CASE level_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.levelId} THEN #{item.levelDesc} |
|
|
|
</foreach> |
|
|
|
WHERE |
|
|
|
<foreach item="item" index="index" collection="list" open="(" separator=") OR (" close=")"> |
|
|
|
level_id = #{item.levelId} AND site = #{item.site} |
|
|
|
ELSE level_desc |
|
|
|
END, |
|
|
|
active = CASE level_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.levelId} THEN #{item.active} |
|
|
|
</foreach> |
|
|
|
ELSE active |
|
|
|
END, |
|
|
|
level_cost = CASE level_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.levelId} THEN #{item.levelCost} |
|
|
|
</foreach> |
|
|
|
ELSE level_cost |
|
|
|
END, |
|
|
|
ifs_row_version = CASE level_id |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.levelId} THEN #{item.ifsRowVersion} |
|
|
|
</foreach> |
|
|
|
ELSE ifs_row_version |
|
|
|
END |
|
|
|
WHERE level_id IN |
|
|
|
<foreach item="item" index="index" collection="list" open="(" close=")" separator=","> |
|
|
|
#{item.levelId} |
|
|
|
</foreach> |
|
|
|
AND site = #{list[0].site} |
|
|
|
</update> |
|
|
|
|
|
|
|
<!-- <!– 批量更新 –>--> |
|
|
|
@ -1301,51 +1346,126 @@ |
|
|
|
</foreach> |
|
|
|
</insert> |
|
|
|
|
|
|
|
<!-- 批量更新 --> |
|
|
|
<update id="syncUpdateWorkCenter" parameterType="java.util.List"> |
|
|
|
UPDATE work_center |
|
|
|
SET |
|
|
|
work_center_desc = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.workCenterDesc} |
|
|
|
</foreach> |
|
|
|
ELSE work_center_desc |
|
|
|
END, |
|
|
|
work_center_type_db = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.workCenterTypeDB} |
|
|
|
</foreach> |
|
|
|
ELSE work_center_type_db |
|
|
|
END, |
|
|
|
work_center_type = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.workCenterType} |
|
|
|
</foreach> |
|
|
|
ELSE work_center_type |
|
|
|
END, |
|
|
|
average_capacity = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.averageCapacity,jdbcType=DECIMAL} |
|
|
|
</foreach> |
|
|
|
ELSE average_capacity |
|
|
|
END, |
|
|
|
efficiency = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.efficiency,jdbcType=DECIMAL} |
|
|
|
</foreach> |
|
|
|
ELSE efficiency |
|
|
|
END, |
|
|
|
utilization = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.utilization,jdbcType=DECIMAL} |
|
|
|
</foreach> |
|
|
|
ELSE utilization |
|
|
|
END, |
|
|
|
capacity_type_db = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.capacityTypeDB} |
|
|
|
</foreach> |
|
|
|
ELSE capacity_type_db |
|
|
|
END, |
|
|
|
capacity_type = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.capacityType} |
|
|
|
</foreach> |
|
|
|
ELSE capacity_type |
|
|
|
END, |
|
|
|
um_id = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.umId} |
|
|
|
</foreach> |
|
|
|
ELSE um_id |
|
|
|
END, |
|
|
|
active = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.active} |
|
|
|
</foreach> |
|
|
|
ELSE active |
|
|
|
END, |
|
|
|
remark = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.remark} |
|
|
|
</foreach> |
|
|
|
ELSE remark |
|
|
|
END, |
|
|
|
pro_line_no = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.proLineNo} |
|
|
|
</foreach> |
|
|
|
ELSE pro_line_no |
|
|
|
END, |
|
|
|
can_create_new_roll_flag = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.canCreateNewRollFlag} |
|
|
|
</foreach> |
|
|
|
ELSE can_create_new_roll_flag |
|
|
|
END, |
|
|
|
need_setup_flag = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.needSetupFlag} |
|
|
|
</foreach> |
|
|
|
ELSE need_setup_flag |
|
|
|
END, |
|
|
|
ifs_row_version = CASE work_center_no |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN #{item.workCenterNo} THEN #{item.ifsRowVersion} |
|
|
|
</foreach> |
|
|
|
ELSE ifs_row_version |
|
|
|
END |
|
|
|
WHERE work_center_no IN |
|
|
|
<foreach item="item" index="index" collection="list" open="(" close=")" separator=","> |
|
|
|
#{item.workCenterNo} |
|
|
|
</foreach> |
|
|
|
AND site = #{list[0].site} |
|
|
|
</update> |
|
|
|
<!-- <!– 批量更新 –>--> |
|
|
|
<!-- <update id="syncUpdateWorkCenter" parameterType="java.util.List">--> |
|
|
|
<!-- <update id="syncUpdateWorkCenter" parameterType="WorkCenter">--> |
|
|
|
<!-- UPDATE work_center SET--> |
|
|
|
<!-- <foreach item="item" index="index" collection="list" separator=",">--> |
|
|
|
<!-- work_center_desc = #{item.workCenterDesc},--> |
|
|
|
<!-- work_center_type_db = #{item.workCenterTypeDB},--> |
|
|
|
<!-- work_center_type = #{item.workCenterType},--> |
|
|
|
<!-- average_capacity = #{item.averageCapacity,jdbcType=DECIMAL},--> |
|
|
|
<!-- efficiency = #{item.efficiency,jdbcType=DECIMAL},--> |
|
|
|
<!-- utilization = #{item.utilization,jdbcType=DECIMAL},--> |
|
|
|
<!-- capacity_type_db = #{item.capacityTypeDB},--> |
|
|
|
<!-- capacity_type = #{item.capacityType},--> |
|
|
|
<!-- um_id = #{item.umId},--> |
|
|
|
<!-- active = #{item.active},--> |
|
|
|
<!-- remark = #{item.remark},--> |
|
|
|
<!-- pro_line_no = #{item.proLineNo},--> |
|
|
|
<!-- can_create_new_roll_flag = #{item.canCreateNewRollFlag},--> |
|
|
|
<!-- need_setup_flag = #{item.needSetupFlag},--> |
|
|
|
<!-- ifs_row_version = #{item.ifsRowVersion}--> |
|
|
|
<!-- </foreach>--> |
|
|
|
<!-- WHERE--> |
|
|
|
<!-- <foreach item="item" index="index" collection="list" open="(" separator=") OR (" close=")">--> |
|
|
|
<!-- work_center_no = #{item.workCenterNo} AND site = #{item.site}--> |
|
|
|
<!-- </foreach>--> |
|
|
|
<!-- work_center_desc = #{workCenterDesc},--> |
|
|
|
<!-- work_center_type_db = #{workCenterTypeDB},--> |
|
|
|
<!-- work_center_type = #{workCenterType},--> |
|
|
|
<!-- average_capacity = #{averageCapacity,jdbcType=DECIMAL},--> |
|
|
|
<!-- efficiency = #{efficiency,jdbcType=DECIMAL},--> |
|
|
|
<!-- utilization = #{utilization,jdbcType=DECIMAL},--> |
|
|
|
<!-- capacity_type_db = #{capacityTypeDB},--> |
|
|
|
<!-- capacity_type = #{capacityType},--> |
|
|
|
<!-- um_id = #{umId},--> |
|
|
|
<!-- active = #{active},--> |
|
|
|
<!-- remark = #{remark},--> |
|
|
|
<!-- pro_line_no = #{proLineNo},--> |
|
|
|
<!-- can_create_new_roll_flag = #{canCreateNewRollFlag},--> |
|
|
|
<!-- need_setup_flag = #{needSetupFlag},--> |
|
|
|
<!-- ifs_row_version = #{ifsRowVersion}--> |
|
|
|
<!-- WHERE work_center_no = #{workCenterNo} AND site = #{site}--> |
|
|
|
<!-- </update>--> |
|
|
|
<!-- 批量更新 --> |
|
|
|
<update id="syncUpdateWorkCenter" parameterType="WorkCenter"> |
|
|
|
UPDATE work_center SET |
|
|
|
work_center_desc = #{workCenterDesc}, |
|
|
|
work_center_type_db = #{workCenterTypeDB}, |
|
|
|
work_center_type = #{workCenterType}, |
|
|
|
average_capacity = #{averageCapacity,jdbcType=DECIMAL}, |
|
|
|
efficiency = #{efficiency,jdbcType=DECIMAL}, |
|
|
|
utilization = #{utilization,jdbcType=DECIMAL}, |
|
|
|
capacity_type_db = #{capacityTypeDB}, |
|
|
|
capacity_type = #{capacityType}, |
|
|
|
um_id = #{umId}, |
|
|
|
active = #{active}, |
|
|
|
remark = #{remark}, |
|
|
|
pro_line_no = #{proLineNo}, |
|
|
|
can_create_new_roll_flag = #{canCreateNewRollFlag}, |
|
|
|
need_setup_flag = #{needSetupFlag}, |
|
|
|
ifs_row_version = #{ifsRowVersion} |
|
|
|
WHERE work_center_no = #{workCenterNo} AND site = #{site} |
|
|
|
</update> |
|
|
|
|
|
|
|
<select id="getRoutingComponentRowKeyAndVersion" resultType="RoutingComponentEntity"> |
|
|
|
select |
|
|
|
|