select id, template_id, policy_id, item_type, metric_key, metric_name, oid, filter_value, switch_description, data_type, monitor_status, collection_cycle, create_time, update_time, create_by, update_by from rm_template_switch
insert into rm_template_switch
template_id,
policy_id,
item_type,
metric_key,
metric_name,
oid,
filter_value,
switch_description,
data_type,
monitor_status,
collection_cycle,
create_time,
update_time,
create_by,
update_by,
#{templateId},
#{policyId},
#{itemType},
#{metricKey},
#{metricName},
#{oid},
#{filterValue},
#{switchDescription},
#{dataType},
#{monitorStatus},
#{collectionCycle},
#{createTime},
#{updateTime},
#{createBy},
#{updateBy},
update rm_template_switch
template_id = #{templateId},
policy_id = #{policyId},
item_type = #{itemType},
metric_key = #{metricKey},
metric_name = #{metricName},
oid = #{oid},
filter_value = #{filterValue},
switch_description = #{switchDescription},
data_type = #{dataType},
monitor_status = #{monitorStatus},
collection_cycle = #{collectionCycle},
create_time = #{createTime},
update_time = #{updateTime},
create_by = #{createBy},
update_by = #{updateBy},
where id = #{id}
delete from rm_template_switch where id = #{id}
delete from rm_template_switch where id in
#{id}
INSERT INTO rm_template_switch
(
template_id,
policy_id,
item_type,
metric_key,
metric_name,
oid,
filter_value,
switch_description,
data_type,
monitor_status,
create_time,
update_time,
create_by,
update_by
)
VALUES
(
#{item.templateId},
#{item.policyId},
#{item.itemType},
#{item.metricKey},
#{item.metricName},
#{item.oid},
#{item.filterValue},
#{item.switchDescription},
#{item.dataType},
#{item.monitorStatus},
#{item.createTime},
#{item.updateTime},
#{item.createBy},
#{item.updateBy}
)
delete from rm_template_switch where template_id = #{templateId}
update rm_template_switch set collection_cycle = null
where template_id = #{templateId}
delete from rm_template_switch where policy_id = #{policyId}
update rm_template_switch set collection_cycle = null
where policy_id = #{policyId}