INSERT INTO f_spare_part (category_id, name_zh, name_en, model, description_zh, description_en,
material, applications, cover_image,
model_spec, applicable_line_model,
material_zh, material_en, lifespan,
product_advantages_zh, product_advantages_en,
excerpt_zh, excerpt_en, content_zh, content_en,
specifications_zh, specifications_en,
is_published, sort_order, create_by, remark)
VALUES (#{categoryId}, #{nameZh}, #{nameEn}, #{model}, #{descriptionZh}, #{descriptionEn},
#{material}, #{applications}, #{coverImage},
#{modelSpec}, #{applicableLineModel},
#{materialZh}, #{materialEn}, #{lifespan},
#{productAdvantagesZh}, #{productAdvantagesEn},
#{excerptZh}, #{excerptEn}, #{contentZh}, #{contentEn},
#{specificationsZh}, #{specificationsEn},
#{isPublished}, #{sortOrder}, #{createBy}, #{remark})
UPDATE f_spare_part
category_id = #{categoryId},
name_zh = #{nameZh},
name_en = #{nameEn},
model = #{model},
description_zh = #{descriptionZh},
description_en = #{descriptionEn},
material = #{material},
applications = #{applications},
cover_image = #{coverImage},
model_spec = #{modelSpec},
applicable_line_model = #{applicableLineModel},
material_zh = #{materialZh},
material_en = #{materialEn},
lifespan = #{lifespan},
product_advantages_zh = #{productAdvantagesZh},
product_advantages_en = #{productAdvantagesEn},
excerpt_zh = #{excerptZh},
excerpt_en = #{excerptEn},
content_zh = #{contentZh},
content_en = #{contentEn},
specifications_zh = #{specificationsZh},
specifications_en = #{specificationsEn},
is_published = #{isPublished},
sort_order = #{sortOrder},
update_by = #{updateBy},
remark = #{remark},
WHERE spare_part_id = #{sparePartId} AND del_flag = 0
UPDATE f_spare_part SET del_flag = 1 WHERE spare_part_id = #{id}