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

    <resultMap type="SysImplementationProgress" id="SysImplementationProgressResult">
        <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>

    <select id="selectSysImplementationProgress" resultMap="SysImplementationProgressResult">
        select id, title, content, create_by, create_time, update_by, update_time, remark
        from sys_implementation_progress
        limit 1
    </select>

    <insert id="insertSysImplementationProgress" parameterType="SysImplementationProgress" useGeneratedKeys="true" keyProperty="id">
        insert into sys_implementation_progress
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="title != null">title,</if>
            <if test="content != null">content,</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="title != null">#{title},</if>
            <if test="content != null">#{content},</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="updateSysImplementationProgress" parameterType="SysImplementationProgress">
        update sys_implementation_progress
        <set>
            <if test="title != null and title != ''">title = #{title},</if>
            <if test="content != null and content != ''">content = #{content},</if>
            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
            update_time = #{updateTime},
            <if test="remark != null and remark != ''">remark = #{remark},</if>
        </set>
        where id = #{id}
    </update>

</mapper>