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

119 lines
6.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.HuayangCompanyTimelineMapper">
<resultMap type="HuayangCompanyTimeline" id="HuayangCompanyTimelineResult">
<result property="timelineId" column="timeline_id"/>
<result property="eventYear" column="event_year"/>
<result property="eventMonth" column="event_month"/>
<result property="eventTitle" column="event_title"/>
<result property="eventContent" column="event_content"/>
<result property="eventDetail" column="event_detail"/>
<result property="eventImage" column="event_image"/>
<result property="isHighlight" column="is_highlight"/>
<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="selectHuayangCompanyTimelineVo">
select timeline_id, event_year, event_month, event_title, event_content,
event_detail, event_image, is_highlight, sort_order, status,
create_by, create_time, update_by, update_time, remark
from huayang_company_timeline
</sql>
<select id="selectHuayangCompanyTimelineById" parameterType="Long" resultMap="HuayangCompanyTimelineResult">
<include refid="selectHuayangCompanyTimelineVo"/>
where timeline_id = #{timelineId}
</select>
<select id="selectHuayangCompanyTimelineList" parameterType="HuayangCompanyTimeline" resultMap="HuayangCompanyTimelineResult">
<include refid="selectHuayangCompanyTimelineVo"/>
<where>
<if test="eventYear != null and eventYear != ''">
AND event_year = #{eventYear}
</if>
<if test="eventTitle != null and eventTitle != ''">
AND event_title like concat('%', #{eventTitle}, '%')
</if>
<if test="isHighlight != null and isHighlight != ''">
AND is_highlight = #{isHighlight}
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
</where>
order by event_year desc, sort_order asc, timeline_id asc
</select>
<select id="selectHuayangCompanyTimelinePublicList" resultMap="HuayangCompanyTimelineResult">
<include refid="selectHuayangCompanyTimelineVo"/>
where status = '0'
order by event_year desc, sort_order asc, timeline_id asc
</select>
<insert id="insertHuayangCompanyTimeline" parameterType="HuayangCompanyTimeline" useGeneratedKeys="true" keyProperty="timelineId">
insert into huayang_company_timeline
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="eventYear != null and eventYear != ''">event_year,</if>
<if test="eventMonth != null">event_month,</if>
<if test="eventTitle != null and eventTitle != ''">event_title,</if>
<if test="eventContent != null">event_content,</if>
<if test="eventDetail != null">event_detail,</if>
<if test="eventImage != null">event_image,</if>
<if test="isHighlight != null and isHighlight != ''">is_highlight,</if>
<if test="sortOrder != null">sort_order,</if>
<if test="status != null and status != ''">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="eventYear != null and eventYear != ''">#{eventYear},</if>
<if test="eventMonth != null">#{eventMonth},</if>
<if test="eventTitle != null and eventTitle != ''">#{eventTitle},</if>
<if test="eventContent != null">#{eventContent},</if>
<if test="eventDetail != null">#{eventDetail},</if>
<if test="eventImage != null">#{eventImage},</if>
<if test="isHighlight != null and isHighlight != ''">#{isHighlight},</if>
<if test="sortOrder != null">#{sortOrder},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateHuayangCompanyTimeline" parameterType="HuayangCompanyTimeline">
update huayang_company_timeline
<set>
<if test="eventYear != null and eventYear != ''">event_year = #{eventYear},</if>
<if test="eventMonth != null">event_month = #{eventMonth},</if>
<if test="eventTitle != null and eventTitle != ''">event_title = #{eventTitle},</if>
<if test="eventContent != null">event_content = #{eventContent},</if>
<if test="eventDetail != null">event_detail = #{eventDetail},</if>
<if test="eventImage != null">event_image = #{eventImage},</if>
<if test="isHighlight != null and isHighlight != ''">is_highlight = #{isHighlight},</if>
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
</set>
where timeline_id = #{timelineId}
</update>
<delete id="deleteHuayangCompanyTimelineByIds" parameterType="Long">
delete from huayang_company_timeline where timeline_id in
<foreach item="timelineId" collection="array" open="(" separator="," close=")">
#{timelineId}
</foreach>
</delete>
</mapper>