45 lines
2.4 KiB
XML
45 lines
2.4 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.CoreTechnologyMapper">
|
||
|
|
|
||
|
|
<select id="selectAll" resultType="com.wuhansaga.server.entity.CoreTechnology">
|
||
|
|
SELECT * FROM f_core_technology WHERE del_flag = 0 ORDER BY sort_order ASC
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectPublished" resultType="com.wuhansaga.server.entity.CoreTechnology">
|
||
|
|
SELECT * FROM f_core_technology WHERE del_flag = 0 AND is_published = 1 ORDER BY sort_order ASC
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectById" resultType="com.wuhansaga.server.entity.CoreTechnology">
|
||
|
|
SELECT * FROM f_core_technology WHERE core_technology_id = #{id} AND del_flag = 0
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insert" useGeneratedKeys="true" keyProperty="coreTechnologyId">
|
||
|
|
INSERT INTO f_core_technology (name_zh, name_en, description_zh, description_en, advantages_zh,
|
||
|
|
advantages_en, icon_class, is_published, sort_order, create_by, remark)
|
||
|
|
VALUES (#{nameZh}, #{nameEn}, #{descriptionZh}, #{descriptionEn}, #{advantagesZh},
|
||
|
|
#{advantagesEn}, #{iconClass}, #{isPublished}, #{sortOrder}, #{createBy}, #{remark})
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="update" parameterType="com.wuhansaga.server.entity.CoreTechnology">
|
||
|
|
UPDATE f_core_technology
|
||
|
|
<set>
|
||
|
|
<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="advantagesZh != null">advantages_zh = #{advantagesZh},</if>
|
||
|
|
<if test="advantagesEn != null">advantages_en = #{advantagesEn},</if>
|
||
|
|
<if test="iconClass != null">icon_class = #{iconClass},</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 core_technology_id = #{coreTechnologyId} AND del_flag = 0
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<update id="deleteById">
|
||
|
|
UPDATE f_core_technology SET del_flag = 1 WHERE core_technology_id = #{id}
|
||
|
|
</update>
|
||
|
|
</mapper>
|