|
|
@@ -0,0 +1,190 @@
|
|
|
+<?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="beilv.order.mapper.StoreOrderMapper">
|
|
|
+
|
|
|
+ <resultMap type="StoreOrder" id="StoreOrderResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="orderId" column="order_id"/>
|
|
|
+ <result property="orderType" column="order_type"/>
|
|
|
+ <result property="uid" column="uid"/>
|
|
|
+ <result property="realName" column="real_name"/>
|
|
|
+ <result property="userPhone" column="user_phone"/>
|
|
|
+ <result property="userAddress" column="user_address"/>
|
|
|
+ <result property="totalNum" column="total_num"/>
|
|
|
+ <result property="totalPrice" column="total_price"/>
|
|
|
+ <result property="payPrice" column="pay_price"/>
|
|
|
+ <result property="vipDiscount" column="vip_discount"/>
|
|
|
+ <result property="vipDeductionAmount" column="vip_deduction_amount"/>
|
|
|
+ <result property="deductionPrice" column="deduction_price"/>
|
|
|
+ <result property="couponId" column="coupon_id"/>
|
|
|
+ <result property="couponPrice" column="coupon_price"/>
|
|
|
+ <result property="paid" column="paid"/>
|
|
|
+ <result property="payTime" column="pay_time"/>
|
|
|
+ <result property="payType" column="pay_type"/>
|
|
|
+ <result property="status" column="status"/>
|
|
|
+ <result property="refundStatus" column="refund_status"/>
|
|
|
+ <result property="useIntegral" column="use_integral"/>
|
|
|
+ <result property="payIntegral" column="pay_integral"/>
|
|
|
+ <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="selectStoreOrderVo">
|
|
|
+ select id,
|
|
|
+ order_id,
|
|
|
+ uid,
|
|
|
+ real_name,
|
|
|
+ user_phone,
|
|
|
+ user_address,
|
|
|
+ total_num,
|
|
|
+ total_price,
|
|
|
+ pay_price,
|
|
|
+ vip_discount,
|
|
|
+ vip_deduction_amount,
|
|
|
+ deduction_price,
|
|
|
+ coupon_id,
|
|
|
+ coupon_price,
|
|
|
+ paid,
|
|
|
+ pay_time,
|
|
|
+ pay_type,
|
|
|
+ order_type,
|
|
|
+ status,
|
|
|
+ refund_status,
|
|
|
+ use_integral,
|
|
|
+ pay_integral,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time,
|
|
|
+ remark
|
|
|
+ from store_order
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectStoreOrderList" parameterType="StoreOrder" resultMap="StoreOrderResult">
|
|
|
+ <include refid="selectStoreOrderVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="orderId != null and orderId != ''">and order_id = #{orderId}</if>
|
|
|
+ <if test="realName != null and realName != ''">and real_name like concat('%', #{realName}, '%')</if>
|
|
|
+ </where>
|
|
|
+ order by create_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectStoreOrderById" parameterType="Long" resultMap="StoreOrderResult">
|
|
|
+ <include refid="selectStoreOrderVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertStoreOrder" parameterType="StoreOrder">
|
|
|
+ insert into store_order
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="orderId != null and orderId != ''">order_id,</if>
|
|
|
+ <if test="uid != null">uid,</if>
|
|
|
+ <if test="realName != null and realName != ''">real_name,</if>
|
|
|
+ <if test="userPhone != null and userPhone != ''">user_phone,</if>
|
|
|
+ <if test="userAddress != null and userAddress != ''">user_address,</if>
|
|
|
+ <if test="totalNum != null">total_num,</if>
|
|
|
+ <if test="totalPrice != null">total_price,</if>
|
|
|
+ <if test="payPrice != null">pay_price,</if>
|
|
|
+ <if test="vipDiscount != null">vip_discount,</if>
|
|
|
+ <if test="vipDeductionAmount != null">vip_deduction_amount,</if>
|
|
|
+ <if test="deductionPrice != null">deduction_price,</if>
|
|
|
+ <if test="couponId != null">coupon_id,</if>
|
|
|
+ <if test="couponPrice != null">coupon_price,</if>
|
|
|
+ <if test="paid != null">paid,</if>
|
|
|
+ <if test="payTime != null">pay_time,</if>
|
|
|
+ <if test="payType != null and payType != ''">pay_type,</if>
|
|
|
+ <if test="orderType != null and orderType != ''">order_type,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="refundStatus != null">refund_status,</if>
|
|
|
+ <if test="useIntegral != null">use_integral,</if>
|
|
|
+ <if test="payIntegral != null">pay_integral,</if>
|
|
|
+ <if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="remark != null and remark != ''">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="orderId != null and orderId != ''">#{orderId},</if>
|
|
|
+ <if test="uid != null">#{uid},</if>
|
|
|
+ <if test="realName != null and realName != ''">#{realName},</if>
|
|
|
+ <if test="userPhone != null and userPhone != ''">#{userPhone},</if>
|
|
|
+ <if test="userAddress != null and userAddress != ''">#{userAddress},</if>
|
|
|
+ <if test="totalNum != null">#{totalNum},</if>
|
|
|
+ <if test="totalPrice != null">#{totalPrice},</if>
|
|
|
+ <if test="payPrice != null">#{payPrice},</if>
|
|
|
+ <if test="vipDiscount != null">#{vipDiscount},</if>
|
|
|
+ <if test="vipDeductionAmount != null">#{vipDeductionAmount},</if>
|
|
|
+ <if test="deductionPrice != null">#{deductionPrice},</if>
|
|
|
+ <if test="couponId != null">#{couponId},</if>
|
|
|
+ <if test="couponPrice != null">#{couponPrice},</if>
|
|
|
+ <if test="paid != null">#{paid},</if>
|
|
|
+ <if test="payTime != null">#{payTime},</if>
|
|
|
+ <if test="payType != null and payType != ''">#{payType},</if>
|
|
|
+ <if test="orderType != null and orderType != ''">#{orderType},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="refundStatus != null">#{refundStatus},</if>
|
|
|
+ <if test="useIntegral != null">#{useIntegral},</if>
|
|
|
+ <if test="payIntegral != null">#{payIntegral},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="remark != null and remark != ''">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateStoreOrder" parameterType="StoreOrder">
|
|
|
+ update store_order
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="orderId != null and orderId != ''">order_id = #{orderId},</if>
|
|
|
+ <if test="uid != null">uid = #{uid},</if>
|
|
|
+ <if test="realName != null and realName != ''">real_name = #{realName},</if>
|
|
|
+ <if test="userPhone != null and userPhone != ''">user_phone = #{userPhone},</if>
|
|
|
+ <if test="userAddress != null and userAddress != ''">user_address = #{userAddress},</if>
|
|
|
+ <if test="totalNum != null">total_num = #{totalNum},</if>
|
|
|
+ <if test="totalPrice != null">total_price = #{totalPrice},</if>
|
|
|
+ <if test="payPrice != null">pay_price = #{payPrice},</if>
|
|
|
+ <if test="vipDiscount != null">vip_discount = #{vipDiscount},</if>
|
|
|
+ <if test="vipDeductionAmount != null">vip_deduction_amount = #{vipDeductionAmount},</if>
|
|
|
+ <if test="deductionPrice != null">deduction_price = #{deductionPrice},</if>
|
|
|
+ <if test="couponId != null">coupon_id = #{couponId},</if>
|
|
|
+ <if test="couponPrice != null">coupon_price = #{couponPrice},</if>
|
|
|
+ <if test="paid != null">paid = #{paid},</if>
|
|
|
+ <if test="payTime != null">pay_time = #{payTime},</if>
|
|
|
+ <if test="payType != null and payType != ''">pay_type = #{payType},</if>
|
|
|
+ <if test="orderType != null and orderType != ''">order_type = #{orderType},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="refundStatus != null">refund_status = #{refundStatus},</if>
|
|
|
+ <if test="useIntegral != null">use_integral = #{useIntegral},</if>
|
|
|
+ <if test="payIntegral != null">pay_integral = #{payIntegral},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteStoreOrderById" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from store_order
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteStoreOrderByIds" parameterType="Long">
|
|
|
+ delete from store_order where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|