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

    <resultMap type="SysPointControl" id="SysReviewControlResult">
        <result property="id"    column="id"    />
        <result property="reviewEnable"    column="review_enable"    />
        <result property="orderCondition"    column="order_condition"    />
        <result property="reviewPoints"    column="review_points"    />
        <result property="vndPerpoint"    column="vnd_perpoint"    />
        <result property="orderUseEnable"    column="order_use_enable"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectSysReviewControlVo">
        select id, review_enable, order_condition, review_points, vnd_perpoint, order_use_enable, update_time from sys_point_control
    </sql>

    <select id="selectSysReviewControlList" parameterType="SysPointControl" resultMap="SysReviewControlResult">
        <include refid="selectSysReviewControlVo"/>
        <where>
            <if test="reviewEnable != null "> and review_enable = #{reviewEnable}</if>
            <if test="orderCondition != null "> and order_condition = #{orderCondition}</if>
            <if test="reviewPoints != null "> and review_points = #{reviewPoints}</if>
            <if test="vndPerpoint != null "> and vnd_perpoint = #{vndPerpoint}</if>
            <if test="orderUseEnable != null "> and order_use_enable = #{orderUseEnable}</if>
        </where>
    </select>

    <select id="selectSysReviewControlById" parameterType="Long" resultMap="SysReviewControlResult">
        <include refid="selectSysReviewControlVo"/>
        where id = #{id}
    </select>

    <insert id="insertSysReviewControl" parameterType="SysPointControl" useGeneratedKeys="true" keyProperty="id">
        insert into sys_point_control
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="reviewEnable != null">review_enable,</if>
            <if test="orderCondition != null">order_condition,</if>
            <if test="reviewPoints != null">review_points,</if>
            <if test="vndPerpoint != null">vnd_perpoint,</if>
            <if test="orderUseEnable != null">order_use_enable,</if>
            <if test="updateTime != null">update_time,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="reviewEnable != null">#{reviewEnable},</if>
            <if test="orderCondition != null">#{orderCondition},</if>
            <if test="reviewPoints != null">#{reviewPoints},</if>
            <if test="vndPerpoint != null">#{vndPerpoint},</if>
            <if test="orderUseEnable != null">#{orderUseEnable},</if>
            <if test="updateTime != null">#{updateTime},</if>
        </trim>
    </insert>

    <update id="updateSysReviewControl" parameterType="SysPointControl">
        update sys_point_control
        <trim prefix="SET" suffixOverrides=",">
            <if test="reviewEnable != null">review_enable = #{reviewEnable},</if>
            <if test="orderCondition != null">order_condition = #{orderCondition},</if>
            <if test="reviewPoints != null">review_points = #{reviewPoints},</if>
            <if test="vndPerpoint != null">vnd_perpoint = #{vndPerpoint},</if>
            <if test="orderUseEnable != null">order_use_enable = #{orderUseEnable},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteSysReviewControlById" parameterType="Long">
        delete from sys_point_control where id = #{id}
    </delete>

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