huayang/backend/ruoyi-system/target/classes/mapper/system/HuayangCompanySectionMapper.xml
2026-05-07 18:24:22 +08:00

123 lines
6.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.ruoyi.system.mapper.HuayangCompanySectionMapper">
<resultMap type="HuayangCompanySection" id="HuayangCompanySectionResult">
<result property="sectionId" column="section_id" />
<result property="sectionCode" column="section_code" />
<result property="sectionTitle" column="section_title" />
<result property="sectionContent" column="section_content" />
<result property="extraData" column="extra_data" />
<result property="bannerImage" column="banner_image" />
<result property="contentImage1" column="content_image1" />
<result property="contentImage2" column="content_image2" />
<result property="contentImage3" column="content_image3" />
<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" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectHuayangCompanySectionVo">
select section_id, section_code, section_title, section_content, extra_data, banner_image, content_image1, content_image2, content_image3, sort_order, status, create_by, create_time, update_by, update_time, remark from huayang_company_section
</sql>
<select id="selectHuayangCompanySectionList" parameterType="HuayangCompanySection" resultMap="HuayangCompanySectionResult">
<include refid="selectHuayangCompanySectionVo"/>
<where>
<if test="sectionCode != null and sectionCode != ''"> and section_code = #{sectionCode}</if>
<if test="sectionTitle != null and sectionTitle != ''"> and section_title like concat('%', #{sectionTitle}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
order by sort_order asc
</select>
<select id="selectHuayangCompanySectionBySectionId" parameterType="Long" resultMap="HuayangCompanySectionResult">
<include refid="selectHuayangCompanySectionVo"/>
where section_id = #{sectionId}
</select>
<select id="selectHuayangCompanySectionByCode" parameterType="String" resultMap="HuayangCompanySectionResult">
<include refid="selectHuayangCompanySectionVo"/>
where section_code = #{sectionCode}
limit 1
</select>
<insert id="insertHuayangCompanySection" parameterType="HuayangCompanySection" useGeneratedKeys="true" keyProperty="sectionId">
insert into huayang_company_section
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sectionCode != null and sectionCode != ''">section_code,</if>
<if test="sectionTitle != null and sectionTitle != ''">section_title,</if>
<if test="sectionContent != null">section_content,</if>
<if test="extraData != null">extra_data,</if>
<if test="bannerImage != null">banner_image,</if>
<if test="contentImage1 != null">content_image1,</if>
<if test="contentImage2 != null">content_image2,</if>
<if test="contentImage3 != null">content_image3,</if>
<if test="sortOrder != null">sort_order,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sectionCode != null and sectionCode != ''">#{sectionCode},</if>
<if test="sectionTitle != null and sectionTitle != ''">#{sectionTitle},</if>
<if test="sectionContent != null">#{sectionContent},</if>
<if test="extraData != null">#{extraData},</if>
<if test="bannerImage != null">#{bannerImage},</if>
<if test="contentImage1 != null">#{contentImage1},</if>
<if test="contentImage2 != null">#{contentImage2},</if>
<if test="contentImage3 != null">#{contentImage3},</if>
<if test="sortOrder != null">#{sortOrder},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateHuayangCompanySection" parameterType="HuayangCompanySection">
update huayang_company_section
<trim prefix="SET" suffixOverrides=",">
<if test="sectionCode != null and sectionCode != ''">section_code = #{sectionCode},</if>
<if test="sectionTitle != null and sectionTitle != ''">section_title = #{sectionTitle},</if>
<if test="sectionContent != null">section_content = #{sectionContent},</if>
extra_data = #{extraData,jdbcType=LONGVARCHAR},
<!-- 图片字段始终写入,避免请求体缺省或 null 判断导致动态 SQL 跳过更新 -->
banner_image = #{bannerImage,jdbcType=VARCHAR},
content_image1 = #{contentImage1,jdbcType=VARCHAR},
content_image2 = #{contentImage2,jdbcType=VARCHAR},
content_image3 = #{contentImage3,jdbcType=VARCHAR},
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where section_id = #{sectionId}
</update>
<delete id="deleteHuayangCompanySectionBySectionId" parameterType="Long">
delete from huayang_company_section where section_id = #{sectionId}
</delete>
<delete id="deleteHuayangCompanySectionBySectionIds" parameterType="String">
delete from huayang_company_section where section_id in
<foreach item="sectionId" collection="array" open="(" separator="," close=")">
#{sectionId}
</foreach>
</delete>
</mapper>