54 lines
2.8 KiB
XML
54 lines
2.8 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.wuhansaga.server.mapper.WorkshopMapper">
|
|
|
|
<select id="selectList" resultType="com.wuhansaga.server.entity.Workshop">
|
|
SELECT * FROM f_workshop WHERE del_flag = 0
|
|
<if test="workshopType != null and workshopType != ''">AND workshop_type = #{workshopType}</if>
|
|
ORDER BY sort_order ASC
|
|
</select>
|
|
|
|
<select id="selectPublished" resultType="com.wuhansaga.server.entity.Workshop">
|
|
SELECT * FROM f_workshop WHERE del_flag = 0 AND is_published = 1
|
|
ORDER BY sort_order ASC
|
|
</select>
|
|
|
|
<select id="selectById" resultType="com.wuhansaga.server.entity.Workshop">
|
|
SELECT * FROM f_workshop WHERE workshop_id = #{id} AND del_flag = 0
|
|
</select>
|
|
|
|
<insert id="insert" useGeneratedKeys="true" keyProperty="workshopId">
|
|
INSERT INTO f_workshop (company_info_id, workshop_type, name_zh, name_en, description_zh, description_en,
|
|
equipment_list_zh, equipment_list_en, area_size, image_path, is_published,
|
|
sort_order, create_by, remark)
|
|
VALUES (#{companyInfoId}, #{workshopType}, #{nameZh}, #{nameEn}, #{descriptionZh}, #{descriptionEn},
|
|
#{equipmentListZh}, #{equipmentListEn}, #{areaSize}, #{imagePath}, #{isPublished},
|
|
#{sortOrder}, #{createBy}, #{remark})
|
|
</insert>
|
|
|
|
<update id="update" parameterType="com.wuhansaga.server.entity.Workshop">
|
|
UPDATE f_workshop
|
|
<set>
|
|
<if test="companyInfoId != null">company_info_id = #{companyInfoId},</if>
|
|
<if test="workshopType != null">workshop_type = #{workshopType},</if>
|
|
<if test="nameZh != null">name_zh = #{nameZh},</if>
|
|
<if test="nameEn != null">name_en = #{nameEn},</if>
|
|
<if test="descriptionZh != null">description_zh = #{descriptionZh},</if>
|
|
<if test="descriptionEn != null">description_en = #{descriptionEn},</if>
|
|
<if test="equipmentListZh != null">equipment_list_zh = #{equipmentListZh},</if>
|
|
<if test="equipmentListEn != null">equipment_list_en = #{equipmentListEn},</if>
|
|
<if test="areaSize != null">area_size = #{areaSize},</if>
|
|
<if test="imagePath != null">image_path = #{imagePath},</if>
|
|
<if test="isPublished != null">is_published = #{isPublished},</if>
|
|
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
</set>
|
|
WHERE workshop_id = #{workshopId} AND del_flag = 0
|
|
</update>
|
|
|
|
<update id="deleteById">
|
|
UPDATE f_workshop SET del_flag = 1 WHERE workshop_id = #{id}
|
|
</update>
|
|
</mapper>
|