102 lines
5.2 KiB
XML
102 lines
5.2 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.ruoyi.system.mapper.HuayangFixedSectionItemMapper">
|
|
|
|
<resultMap type="HuayangFixedSectionItem" id="HuayangFixedSectionItemResult">
|
|
<result property="itemId" column="item_id" />
|
|
<result property="sectionId" column="section_id" />
|
|
<result property="itemTitle" column="item_title" />
|
|
<result property="itemDesc" column="item_desc" />
|
|
<result property="itemImage" column="item_image" />
|
|
<result property="itemIcon" column="item_icon" />
|
|
<result property="itemLink" column="item_link" />
|
|
<result property="itemType" column="item_type" />
|
|
<result property="sortOrder" column="sort_order" />
|
|
<result property="status" column="status" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectHuayangFixedSectionItemVo">
|
|
select item_id, section_id, item_title, item_desc, item_image, item_icon, item_link, item_type, sort_order, status, create_by, create_time, update_by, update_time from huayang_fixed_section_item
|
|
</sql>
|
|
|
|
<select id="selectHuayangFixedSectionItemList" parameterType="HuayangFixedSectionItem" resultMap="HuayangFixedSectionItemResult">
|
|
<include refid="selectHuayangFixedSectionItemVo"/>
|
|
<where>
|
|
<if test="sectionId != null "> and section_id = #{sectionId}</if>
|
|
<if test="itemTitle != null and itemTitle != ''"> and item_title like concat('%', #{itemTitle}, '%')</if>
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
</where>
|
|
order by sort_order asc
|
|
</select>
|
|
|
|
<select id="selectHuayangFixedSectionItemByItemId" parameterType="Long" resultMap="HuayangFixedSectionItemResult">
|
|
<include refid="selectHuayangFixedSectionItemVo"/>
|
|
where item_id = #{itemId}
|
|
</select>
|
|
|
|
<insert id="insertHuayangFixedSectionItem" parameterType="HuayangFixedSectionItem" useGeneratedKeys="true" keyProperty="itemId">
|
|
insert into huayang_fixed_section_item
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="sectionId != null">section_id,</if>
|
|
<if test="itemTitle != null">item_title,</if>
|
|
<if test="itemDesc != null">item_desc,</if>
|
|
<if test="itemImage != null">item_image,</if>
|
|
<if test="itemIcon != null">item_icon,</if>
|
|
<if test="itemLink != null">item_link,</if>
|
|
<if test="itemType != null">item_type,</if>
|
|
<if test="sortOrder != null">sort_order,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
create_time
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="sectionId != null">#{sectionId},</if>
|
|
<if test="itemTitle != null">#{itemTitle},</if>
|
|
<if test="itemDesc != null">#{itemDesc},</if>
|
|
<if test="itemImage != null">#{itemImage},</if>
|
|
<if test="itemIcon != null">#{itemIcon},</if>
|
|
<if test="itemLink != null">#{itemLink},</if>
|
|
<if test="itemType != null">#{itemType},</if>
|
|
<if test="sortOrder != null">#{sortOrder},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
sysdate()
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateHuayangFixedSectionItem" parameterType="HuayangFixedSectionItem">
|
|
update huayang_fixed_section_item
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="sectionId != null">section_id = #{sectionId},</if>
|
|
<if test="itemTitle != null">item_title = #{itemTitle},</if>
|
|
<if test="itemDesc != null">item_desc = #{itemDesc},</if>
|
|
<if test="itemImage != null">item_image = #{itemImage},</if>
|
|
<if test="itemIcon != null">item_icon = #{itemIcon},</if>
|
|
<if test="itemLink != null">item_link = #{itemLink},</if>
|
|
<if test="itemType != null">item_type = #{itemType},</if>
|
|
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
update_time = sysdate()
|
|
</trim>
|
|
where item_id = #{itemId}
|
|
</update>
|
|
|
|
<delete id="deleteHuayangFixedSectionItemByItemId" parameterType="Long">
|
|
delete from huayang_fixed_section_item where item_id = #{itemId}
|
|
</delete>
|
|
|
|
<delete id="deleteHuayangFixedSectionItemByItemIds" parameterType="String">
|
|
delete from huayang_fixed_section_item where item_id in
|
|
<foreach item="itemId" collection="array" open="(" separator="," close=")">
|
|
#{itemId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|