<?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.frequency.orderpanorama.mapper.OrderPanoramaMapper">
    
    <resultMap type="com.ruoyi.frequency.orderpanorama.entity.OrderPanorama" id="OrderPanoramaResult">
        <result property="id"    column="id"    />
        <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="delFlag"    column="del_flag"    />
        <result property="orderId"    column="order_id"    />
        <result property="panoramaImage"    column="panorama_image"    />
        <result property="panorama"    column="panorama"    />
    </resultMap>

    <sql id="selectOrderPanoramaVo">
        select id, create_by, create_time, update_by, update_time, del_flag, order_id, panorama_image, panorama from t_order_panorama
    </sql>

    <select id="selectOrderPanoramaList" parameterType="com.ruoyi.frequency.orderpanorama.entity.OrderPanorama" resultMap="OrderPanoramaResult">
        <include refid="selectOrderPanoramaVo"/>
        <where>  
            <if test="createTime != null "> and create_time = #{createTime}</if>
            <if test="orderId != null  and orderId != ''"> and order_id = #{orderId}</if>
            <if test="panoramaImage != null  and panoramaImage != ''"> and panorama_image = #{panoramaImage}</if>
            <if test="panorama != null  and panorama != ''"> and panorama = #{panorama}</if>
        </where>
    </select>
    
    <select id="selectOrderPanoramaById" parameterType="Long" resultMap="OrderPanoramaResult">
        <include refid="selectOrderPanoramaVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertOrderPanorama" parameterType="com.ruoyi.frequency.orderpanorama.entity.OrderPanorama">
        insert into t_order_panorama
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</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="delFlag != null">del_flag,</if>
            <if test="orderId != null">order_id,</if>
            <if test="panoramaImage != null">panorama_image,</if>
            <if test="panorama != null">panorama,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</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="delFlag != null">#{delFlag},</if>
            <if test="orderId != null">#{orderId},</if>
            <if test="panoramaImage != null">#{panoramaImage},</if>
            <if test="panorama != null">#{panorama},</if>
         </trim>
    </insert>

    <update id="updateOrderPanorama" parameterType="com.ruoyi.frequency.orderpanorama.entity.OrderPanorama">
        update t_order_panorama
        <trim prefix="SET" suffixOverrides=",">
            <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>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="orderId != null">order_id = #{orderId},</if>
            <if test="panoramaImage != null">panorama_image = #{panoramaImage},</if>
            <if test="panorama != null">panorama = #{panorama},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteOrderPanoramaById" parameterType="Long">
        delete from t_order_panorama where id = #{id}
    </delete>

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