<?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.ordermessage.mapper.OrderMessageUtilMapper">

        
    <insert id="insertOrderMessage" parameterType="com.ruoyi.frequency.ordermessage.entity.OrderMessageUtil">
        insert into t_order_message
        <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="orderType != null">order_type,</if>
            <if test="title != null">title,</if>
            <if test="content != null">content,</if>
            <if test="isRead != null">is_read,</if>
            <if test="userId != null">user_id,</if>
            <if test="userType != null">user_type,</if>
            <if test="isShow != null">is_show,</if>
            <if test="messageType != null">message_type,</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="orderType != null">#{orderType},</if>
            <if test="title != null">#{title},</if>
            <if test="content != null">#{content},</if>
            <if test="isRead != null">#{isRead},</if>
            <if test="userId != null">#{userId},</if>
            <if test="userType != null">#{userType},</if>
            <if test="isShow != null">#{isShow},</if>
            <if test="messageType != null">#{messageType},</if>
         </trim>
    </insert>

    <update id="updateOrderMessage" parameterType="com.ruoyi.frequency.ordermessage.entity.OrderMessageUtil">
        update t_order_message
        <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="orderType != null">order_type = #{orderType},</if>
            <if test="title != null">title = #{title},</if>
            <if test="content != null">content = #{content},</if>
            <if test="isRead != null">is_read = #{isRead},</if>
            <if test="userId != null">user_id = #{userId},</if>
            <if test="userType != null">user_type = #{userType},</if>
            <if test="isShow != null">is_show = #{isShow},</if>
            <if test="messageType != null">message_type = #{messageType},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteOrderMessageById" parameterType="Long">
        delete from t_order_message where id = #{id}
    </delete>

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