insert into dc_emergency_plans
plan_name,event_type,trigger_mechanism,create_time,update_time,device_type,triggering_condition,controllable_device,control_command,#{planName},#{eventType},#{triggerMechanism},#{createTime},#{updateTime},#{deviceType},#{triggeringCondition},#{controllableDevice},#{controlCommand},
update dc_emergency_plans
set plan_name = #{planName},
event_type = #{eventType},
trigger_mechanism = #{triggerMechanism},
update_time = #{updateTime},
device_type = #{deviceType},
triggering_condition = #{triggeringCondition},
controllable_device = #{controllableDevice},
control_command = #{controlCommand}
where id = #{id}
delete from dc_emergency_plans where id in
#{id}
select t1.id,
t1.plan_name,
t1.event_type,
t1.trigger_mechanism,
t1.create_time,
t1.update_time,
t1.device_type,
t1.triggering_condition,
t1.controllable_device,
t1.control_command,
t2.id as action_id,
t2.emergency_plans_id as action_emergency_plans_id,
t2.device_type as action_device_type,
t2.create_time as action_create_time,
t2.update_time as action_update_time,
t2.search_rule as action_search_rule,
t2.`number` as action_number,
t2.device_list as action_device_list,
t2.execute_config as action_execute_config,
t2.recover_config as action_recover_config
from dc_emergency_plans t1
left join dc_execute_action t2
on t1.id = t2.emergency_plans_id