insert into t_battery_group_template
(template_name, create_by, create_time, update_by, update_time)
values (#{templateName}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime})
update t_battery_group_template set template_name = #{templateName},
update_by = #{updateBy}, update_time = #{updateTime}
where template_id = #{templateId}
update t_battery_group_template_field set del_flag = relation_id
where template_id = #{templateId} and del_flag = 0
insert into t_battery_group_template_field
(template_id, field_id, sort_order, create_by, create_time, del_flag)
values
(#{item.templateId}, #{item.fieldId}, #{item.sortOrder}, #{item.createBy}, #{item.createTime}, #{item.delFlag})