<?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.project.benyi.mapper.ByAssessmentintroduceMapper">

    <resultMap type="ByAssessmentintroduce" id="ByAssessmentintroduceResult">
        <result property="id" column="id"/>
        <result property="title" column="title"/>
        <result property="content" column="content"/>
        <result property="createTime" column="create_time"/>
    </resultMap>

    <sql id="selectByAssessmentintroduceVo">
        select id, title, content, create_time from by_assessmentintroduce
    </sql>

    <select id="selectByAssessmentintroduceList" parameterType="ByAssessmentintroduce"
            resultMap="ByAssessmentintroduceResult">
        <include refid="selectByAssessmentintroduceVo"/>
        <where>
            <if test="title != null  and title != ''">and title = #{title}</if>
            <if test="content != null  and content != ''">and content = #{content}</if>
        </where>
    </select>

    <select id="selectByAssessmentintroduceById" parameterType="Long" resultMap="ByAssessmentintroduceResult">
        <include refid="selectByAssessmentintroduceVo"/>
        where id = #{id}
    </select>

    <insert id="insertByAssessmentintroduce" parameterType="ByAssessmentintroduce" useGeneratedKeys="true"
            keyProperty="id">
        insert into by_assessmentintroduce
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="title != null  and title != ''">title,</if>
            <if test="content != null  and content != ''">content,</if>
            <if test="createTime != null ">create_time,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="title != null  and title != ''">#{title},</if>
            <if test="content != null  and content != ''">#{content},</if>
            <if test="createTime != null ">#{createTime},</if>
        </trim>
    </insert>

    <update id="updateByAssessmentintroduce" parameterType="ByAssessmentintroduce">
        update by_assessmentintroduce
        <trim prefix="SET" suffixOverrides=",">
            <if test="title != null  and title != ''">title = #{title},</if>
            <if test="content != null  and content != ''">content = #{content},</if>
            <if test="createTime != null ">create_time = #{createTime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteByAssessmentintroduceById" parameterType="Long">
        delete from by_assessmentintroduce where id = #{id}
    </delete>

    <delete id="deleteByAssessmentintroduceByIds" parameterType="String">
        delete from by_assessmentintroduce where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>

</mapper>