<?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.SysAchievementOverviewMapper">

    <resultMap type="SysAchievementOverview" id="SysAchievementOverviewResult">
        <id property="id" column="id" />
        <result property="title" column="title" />
        <result property="content" column="content" />
        <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="selectSysAchievementOverviewVo">
        select id, title, content, create_by, create_time, update_by, update_time, remark
        from sys_achievement_overview
    </sql>

    <select id="selectSysAchievementOverviewById" parameterType="Long" resultMap="SysAchievementOverviewResult">
        <include refid="selectSysAchievementOverviewVo" />
        where id = #{id}
    </select>

    <update id="updateSysAchievementOverview" parameterType="SysAchievementOverview">
        update sys_achievement_overview
        <trim prefix="SET" suffixOverrides=",">
            <if test="title != null and title != ''">title = #{title},</if>
            <if test="content != null">content = #{content},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="remark != null">remark = #{remark},</if>
            update_time = sysdate()
        </trim>
        where id = #{id}
    </update>

</mapper>