select dtdc.id, dtdc.cfg_id, dtdc.project_id, dtdc.dept_id, sp.projectName, sd.dept_name, dtdc.device_key, dtdc.device_source, dtdc.tower_id, dtdc.coordinate_x, dtdc.coordinate_y, dtdc.front_brachium, dtdc.after_brachium, dtdc.tower_body_height, dtdc.height, dtdc.angle, dtdc.range, dtdc.early_warning_distance, dtdc.alarm_warning_distance, dtdc.contour_value, dtdc.is_del, dtdc.create_by, dtdc.create_time, dtdc.update_by, dtdc.update_time, dtdc.remark from dev_tower_data_collide dtdc
left join sur_project sp on sp.id = dtdc.project_id
left join sys_dept sd on sd.dept_id = dtdc.dept_id
insert into dev_tower_data_collide
cfg_id,
project_id,
dept_id,
device_key,
device_source,
tower_id,
coordinate_x,
coordinate_y,
front_brachium,
after_brachium,
tower_body_height,
height,
angle,
`range`,
early_warning_distance,
alarm_warning_distance,
contour_value,
is_del,
create_by,
create_time,
update_by,
update_time,
remark,
#{cfgId},
#{projectId},
#{deptId},
#{deviceKey},
#{deviceSource},
#{towerId},
#{coordinateX},
#{coordinateY},
#{frontBrachium},
#{afterBrachium},
#{towerBodyHeight},
#{height},
#{angle},
#{range},
#{earlyWarningDistance},
#{alarmWarningDistance},
#{contourValue},
#{isDel},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{remark},
update dev_tower_data_collide
cfg_id = #{cfgId},
project_id = #{projectId},
dept_id = #{deptId},
device_key = #{deviceKey},
device_source = #{deviceSource},
tower_id = #{towerId},
coordinate_x = #{coordinateX},
coordinate_y = #{coordinateY},
front_brachium = #{frontBrachium},
after_brachium = #{afterBrachium},
tower_body_height = #{towerBodyHeight},
height = #{height},
angle = #{angle},
`range` = #{range},
early_warning_distance = #{earlyWarningDistance},
alarm_warning_distance = #{alarmWarningDistance},
contour_value = #{contourValue},
is_del = #{isDel},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
remark = #{remark},
where id = #{id}
delete from dev_tower_data_collide where id = #{id}
delete from dev_tower_data_collide where id in
#{id}
delete from dev_tower_data_collide_detail where collide_id in
#{collideId}
delete from dev_tower_data_collide_detail where collide_id = #{collideId}
insert into dev_tower_data_collide_detail( id, collide_id, device_key, device_source, tower_id, coordinate_x, coordinate_y, front_brachium, after_brachium, tower_body_height, height, angle, range, collide_horizontal_distance, collide_vertical_distance, collide_state) values
( #{item.id}, #{item.collideId}, #{item.deviceKey}, #{item.deviceSource}, #{item.towerId}, #{item.coordinateX}, #{item.coordinateY}, #{item.frontBrachium}, #{item.afterBrachium}, #{item.towerBodyHeight}, #{item.height}, #{item.angle}, #{item.range}, #{item.collideHorizontalDistance}, #{item.collideVerticalDistance}, #{item.collideState})