select a.material_id, a.group_id, b.group_name, a.material_name, a.material_type, a.description, a.material_size, a.save_path, a.thumbnail, a.audit_state, a.audit_reason, a.use_state, a.width, a.height, a.uploader_id, a.upload_time, a.remark from cms_material a inner join cms_material_group b on a.group_id = b.group_id insert into cms_material material_id, group_id, material_name, material_type, description, material_size, save_path, thumbnail, audit_state, audit_reason, use_state, width, height, uploader_id, upload_time, remark, #{materialId}, #{groupId}, #{materialName}, #{materialType}, #{description}, #{materialSize}, #{savePath}, #{thumbnail}, #{auditState}, #{auditReason}, #{useState}, #{width}, #{height}, #{uploaderId}, #{uploadTime}, #{remark}, update cms_material group_id = #{groupId}, material_name = #{materialName}, material_type = #{materialType}, description = #{description}, material_size = #{materialSize}, save_path = #{savePath}, thumbnail = #{thumbnail}, audit_state = #{auditState}, audit_reason = #{auditReason}, use_state = #{useState}, width = #{width}, height = #{height}, uploader_id = #{uploaderId}, upload_time = #{uploadTime}, remark = #{remark}, where material_id = #{materialId} delete from cms_material where material_id = #{materialId} delete from cms_material where material_id in #{materialId} update cms_material set use_state=#{useState} where material_id=#{materialId} insert into cms_material_use (id,material_id,use_table,use_id,use_column,create_by,create_time) values (null,#{item.materialId},#{item.useTable},#{item.useId},#{item.useColumn},#{item.createBy},#{item.createTime}) delete from cms_material_use where material_id=#{materialId} and use_table=#{table} and use_id=#{useId} and use_column=#{column}