<?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.xinelu.manage.mapper.orderevaluatepictureinfo.OrderEvaluatePictureInfoMapper">

    <resultMap type="OrderEvaluatePictureInfo" id="OrderEvaluatePictureInfoResult">
        <result property="id" column="id"/>
        <result property="orderEvaluateId" column="order_evaluate_id"/>
        <result property="evaluatePictureUrl" column="evaluate_picture_url"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
    </resultMap>

    <sql id="selectOrderEvaluatePictureInfoVo">
        select id, order_evaluate_id, evaluate_picture_url, create_by, create_time, update_by, update_time
        from order_evaluate_picture_info
    </sql>

    <select id="selectOrderEvaluatePictureInfoList" parameterType="OrderEvaluatePictureInfo"
            resultMap="OrderEvaluatePictureInfoResult">
        <include refid="selectOrderEvaluatePictureInfoVo"/>
        <where>
            <if test="orderEvaluateId != null ">
                and order_evaluate_id = #{orderEvaluateId}
            </if>
            <if test="evaluatePictureUrl != null  and evaluatePictureUrl != ''">
                and evaluate_picture_url = #{evaluatePictureUrl}
            </if>
        </where>
    </select>

    <select id="selectOrderEvaluatePictureInfoById" parameterType="Long"
            resultMap="OrderEvaluatePictureInfoResult">
        <include refid="selectOrderEvaluatePictureInfoVo"/>
        where id = #{id}
    </select>

    <insert id="insertOrderEvaluatePictureInfo" parameterType="OrderEvaluatePictureInfo" useGeneratedKeys="true"
            keyProperty="id">
        insert into order_evaluate_picture_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="orderEvaluateId != null">order_evaluate_id,
            </if>
            <if test="evaluatePictureUrl != null">evaluate_picture_url,
            </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>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="orderEvaluateId != null">#{orderEvaluateId},
            </if>
            <if test="evaluatePictureUrl != null">#{evaluatePictureUrl},
            </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>
        </trim>
    </insert>

    <update id="updateOrderEvaluatePictureInfo" parameterType="OrderEvaluatePictureInfo">
        update order_evaluate_picture_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="orderEvaluateId != null">order_evaluate_id =
                #{orderEvaluateId},
            </if>
            <if test="evaluatePictureUrl != null">evaluate_picture_url =
                #{evaluatePictureUrl},
            </if>
            <if test="createBy != null">create_by =
                #{createBy},
            </if>
            <if test="createTime != null">create_time =
                #{createTime},
            </if>
            <if test="updateBy != null">update_by =
                #{updateBy},
            </if>
            <if test="updateTime != null">update_time =
                #{updateTime},
            </if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteOrderEvaluatePictureInfoById" parameterType="Long">
        delete
        from order_evaluate_picture_info
        where id = #{id}
    </delete>

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