select check_id,
point_id,
instrument_id,
inspection_id,
test_value,
net_test_value,
plant_id,
plant_name,
region_id,
region_name,
layer,
dev_id,
dev_name,
dev_code,
group_code,
extend_code,
point_type,
instrument_code,
leakage_position,
checker,
check_date,
leakage_degree,
remarks,
approve_status,
approve_time,
dept_id,
del_flag,
creater_code,
createdate,
updater_code,
updatedate,
plan_id
from t_check_checkpoints
insert into t_check_checkpoints
point_id,
instrument_id,
inspection_id,
test_value,
net_test_value,
plant_id,
plant_name,
region_id,
region_name,
layer,
dev_id,
dev_name,
dev_code,
group_code,
extend_code,
point_type,
instrument_code,
leakage_position,
checker,
check_date,
leakage_degree,
remarks,
approve_status,
approve_time,
dept_id,
del_flag,
creater_code,
createdate,
updater_code,
updatedate,
plant_type,
plan_id,
#{pointId},
#{instrumentId},
#{inspectionId},
#{testValue},
#{netTestValue},
#{plantId},
#{plantName},
#{regionId},
#{regionName},
#{layer},
#{devId},
#{devName},
#{devCode},
#{groupCode},
#{extendCode},
#{pointType},
#{instrumentCode},
#{leakagePosition},
#{checker},
#{checkDate},
#{leakageDegree},
#{remarks},
#{approveStatus},
#{approveTime},
#{deptId},
#{delFlag},
#{createrCode},
#{createdate},
#{updaterCode},
#{updatedate},
#{plantType},
#{plan_id},
insert into t_check_checkpoints
point_id,
plant_name,
plant_id,
region_id,
layer,
dev_id,
group_code,
extend_code,
point_type,
creater_code,
createdate,
updater_code,
updatedate,
plant_type,
medium_type,
plan_id,
repair_id,
values
#{item.pointId},
#{item.plantName},
#{item.plantId},
#{item.regionId},
#{item.layer},
#{item.devId},
#{item.groupCode},
#{item.extendCode},
#{item.pointType},
#{item.createrCode},
#{item.createdate},
#{item.updaterCode},
#{item.updatedate},
#{item.plantType},
#{item.mediumType},
#{item.planId},
#{item.repairId},
null,
update t_check_checkpoints
point_id = #{pointId},
inspection_id = #{inspectionId},
instrument_id = #{instrumentId},
test_value = #{testValue},
net_test_value = #{netTestValue},
plant_name = #{plantName},
region_name = #{regionName},
layer = #{layer},
dev_name = #{devName},
dev_code = #{devCode},
group_code = #{groupCode},
extend_code = #{extendCode},
point_type = #{pointType},
instrument_code = #{instrumentCode},
leakage_position = #{leakagePosition},
checker = #{checker},
check_date = #{checkDate},
leakage_degree = #{leakageDegree},
remarks = #{remarks},
approve_status = #{approveStatus},
approve_time = #{approveTime},
dept_id = #{deptId},
del_flag = #{delFlag},
creater_code = #{createrCode},
createdate = #{createdate},
updater_code = #{updaterCode},
updatedate = #{updatedate},
plant_type = #{plantType},
plan_id = #{planId},
where check_id = #{checkId}
update t_check_checkpoints
test_value = #{testValue},
net_test_value = #{netTestValue},
leakage_position = #{leakagePosition},
checker = #{checker},
check_date = #{checkDate},
instrument_code = #{instrumentCode},
instrument_id = #{instrumentId},
leakage_degree = #{leakageDegree},
updater_code = #{updaterCode},
updatedate = #{updatedate},
approve_status = #{approveStatus},
plan_id = #{planId},
where plant_name=#{plantName} and group_code=#{groupCode} and extend_code=#{extendCode} and
inspection_id=#{inspectionId} and (approve_status is null or approve_status=0)
update t_check_checkpoints
approve_status = #{approveStatus},
check_id in
#{checkId}
and approve_status=0
and approve_status=1
and test_value is not null
update t_check_checkpoints
set del_flag=1
where check_id = #{checkId}
update t_check_checkpoints set del_flag=1 where check_id in
#{checkId}
update t_check_checkpoints set inspection_id=#{inspectionId} where check_id in
#{checkId}
update t_check_checkpoints set inspection_id = null where check_id in
#{checkId}
update t_check_checkpoints set inspection_id = #{inspectionId} where check_id in
(select t.check_id from (select check_id from t_check_checkpoints d
and d.plant_id = #{plantId}
and d.region_id= #{regionId}
and d.dev_id = #{devId}
and d.inspection_id is null
and repair_id is null
and repair_id is not null
and plan_id=#{planId}
) t)
update t_check_checkpoints set inspection_id = null where inspection_id =#{inspectionId}
delete from t_check_checkpoints where check_id in
#{checkId}
delete from t_check_checkpoints where plan_id =#{planId}