INSERT INTO card_template_use(
card_template_use_id,
template_id,
template_title,
template_use_title,
template_use_barcode,
template_use_barcode_style,
template_use_scans_number,
template_use_switch,
template_use_open,
template_use_capture,
template_use_password,
template_use_city,
template_use_url,
creator,
gmt_create,
modifier,
gmt_modified,
is_delete
) VALUES(
#{cardTemplateUseId},
#{templateId},
#{templateTitle},
#{templateUseTitle},
#{templateUseBarcode},
#{templateUseBarcodeStyle},
#{templateUseScansNumber},
#{templateUseSwitch},
#{templateUseOpen},
#{templateUseCapture},
#{templateUsePassword},
#{templateUseCity},
#{templateUseUrl},
#{creator},
#{gmtCreate},
#{modifier},
#{gmtModified},
#{isDelete}
)
UPDATE
card_template_use
SET
is_delete = 1,
modifier = #{modifier},
gmt_modified = #{gmtModified}
WHERE
card_template_use_id IN
#{cardTemplateUseIds[${index}]}
DELETE FROM
card_template_use
WHERE
card_template_use_id IN
#{cardTemplateUseIds[${index}]}
UPDATE
card_template_use
SET
template_id = #{templateId},
template_title = #{templateTitle},
template_use_title = #{templateUseTitle},
template_use_barcode = #{templateUseBarcode},
template_use_barcode_style = #{templateUseBarcodeStyle},
template_use_scans_number = #{templateUseScansNumber},
template_use_switch = #{templateUseSwitch},
template_use_open = #{templateUseOpen},
template_use_capture = #{templateUseCapture},
template_use_password = #{templateUsePassword},
template_use_city = #{templateUseCity},
template_use_url = #{templateUseUrl},
modifier = #{modifier},
gmt_modified = #{gmtModified}
WHERE
card_template_use_id = #{cardTemplateUseId}