|
@@ -0,0 +1,106 @@
|
|
|
+<?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.DoumuProductHistoryMapper">
|
|
|
+
|
|
|
+ <resultMap type="DoumuProductHistory" id="DoumuProductHistoryResult">
|
|
|
+ <result property="historyId" column="history_id" />
|
|
|
+ <result property="productId" column="product_id" />
|
|
|
+ <result property="orderNumber" column="order_number" />
|
|
|
+ <result property="name" column="name" />
|
|
|
+ <result property="deliveryType" column="delivery_type" />
|
|
|
+ <result property="phonenumber" column="phonenumber" />
|
|
|
+ <result property="address" column="address" />
|
|
|
+ <result property="flowType" column="flow_type" />
|
|
|
+ <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="remark" column="remark" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectDoumuProductHistoryVo">
|
|
|
+ select history_id,order_number, product_id, name, delivery_type, phonenumber, address, flow_type, create_by, create_time, update_by, update_time, remark from doumu_product_history
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectDoumuProductHistoryList" parameterType="DoumuProductHistory" resultMap="DoumuProductHistoryResult">
|
|
|
+ <include refid="selectDoumuProductHistoryVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="productId != null "> and product_id = #{productId}</if>
|
|
|
+ <if test="orderNumber != null and orderNumber != ''"> and order_number = #{orderNumber}</if>
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="deliveryType != null and deliveryType != ''"> and delivery_type = #{deliveryType}</if>
|
|
|
+ <if test="phonenumber != null and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
|
|
|
+ <if test="address != null and address != ''"> and address = #{address}</if>
|
|
|
+ <if test="flowType != null and flowType != ''"> and flow_type = #{flowType}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDoumuProductHistoryByHistoryId" parameterType="Long" resultMap="DoumuProductHistoryResult">
|
|
|
+ <include refid="selectDoumuProductHistoryVo"/>
|
|
|
+ where history_id = #{historyId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertDoumuProductHistory" parameterType="DoumuProductHistory" useGeneratedKeys="true" keyProperty="historyId">
|
|
|
+ insert into doumu_product_history
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="productId != null">product_id,</if>
|
|
|
+ <if test="orderNumber != null "> order_number,</if>
|
|
|
+ <if test="name != null and name != ''">name,</if>
|
|
|
+ <if test="deliveryType != null">delivery_type,</if>
|
|
|
+ <if test="phonenumber != null">phonenumber,</if>
|
|
|
+ <if test="address != null">address,</if>
|
|
|
+ <if test="flowType != null">flow_type,</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="remark != null">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="productId != null">#{productId},</if>
|
|
|
+ <if test="orderNumber != null ">#{orderNumber},</if>
|
|
|
+ <if test="name != null and name != ''">#{name},</if>
|
|
|
+ <if test="deliveryType != null">#{deliveryType},</if>
|
|
|
+ <if test="phonenumber != null">#{phonenumber},</if>
|
|
|
+ <if test="address != null">#{address},</if>
|
|
|
+ <if test="flowType != null">#{flowType},</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="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateDoumuProductHistory" parameterType="DoumuProductHistory">
|
|
|
+ update doumu_product_history
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="productId != null">product_id = #{productId},</if>
|
|
|
+ <if test="orderNumber != null and orderNumber != ''"> order_number = #{orderNumber},</if>
|
|
|
+ <if test="name != null and name != ''">name = #{name},</if>
|
|
|
+ <if test="deliveryType != null">delivery_type = #{deliveryType},</if>
|
|
|
+ <if test="phonenumber != null">phonenumber = #{phonenumber},</if>
|
|
|
+ <if test="address != null">address = #{address},</if>
|
|
|
+ <if test="flowType != null">flow_type = #{flowType},</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>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where history_id = #{historyId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteDoumuProductHistoryByHistoryId" parameterType="Long">
|
|
|
+ delete from doumu_product_history where history_id = #{historyId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteDoumuProductHistoryByHistoryIds" parameterType="String">
|
|
|
+ delete from doumu_product_history where history_id in
|
|
|
+ <foreach item="historyId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{historyId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|