39 lines
1.8 KiB
XML
39 lines
1.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.CaseCategoryMapper">
|
|
|
|
<select id="selectAll" resultType="com.wuhansaga.server.entity.CaseCategory">
|
|
SELECT * FROM f_case_category WHERE del_flag = 0 ORDER BY sort_order ASC
|
|
</select>
|
|
|
|
<select id="selectPublished" resultType="com.wuhansaga.server.entity.CaseCategory">
|
|
SELECT * FROM f_case_category WHERE del_flag = 0 AND is_published = 1 ORDER BY sort_order ASC
|
|
</select>
|
|
|
|
<select id="selectById" resultType="com.wuhansaga.server.entity.CaseCategory">
|
|
SELECT * FROM f_case_category WHERE case_category_id = #{id} AND del_flag = 0
|
|
</select>
|
|
|
|
<insert id="insert" useGeneratedKeys="true" keyProperty="caseCategoryId">
|
|
INSERT INTO f_case_category (name_zh, name_en, sort_order, is_published, create_by, remark)
|
|
VALUES (#{nameZh}, #{nameEn}, #{sortOrder}, #{isPublished}, #{createBy}, #{remark})
|
|
</insert>
|
|
|
|
<update id="update" parameterType="com.wuhansaga.server.entity.CaseCategory">
|
|
UPDATE f_case_category
|
|
<set>
|
|
<if test="nameZh != null">name_zh = #{nameZh},</if>
|
|
<if test="nameEn != null">name_en = #{nameEn},</if>
|
|
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
|
<if test="isPublished != null">is_published = #{isPublished},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
</set>
|
|
WHERE case_category_id = #{caseCategoryId} AND del_flag = 0
|
|
</update>
|
|
|
|
<update id="deleteById">
|
|
UPDATE f_case_category SET del_flag = 1 WHERE case_category_id = #{id}
|
|
</update>
|
|
</mapper>
|