123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789 |
- <?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.kmall.api.dao.ApiOrderMapper">
- <!-- 可根据自己的需求,是否要使用 -->
- <resultMap type="com.kmall.api.entity.OrderVo" id="orderMap">
- <result property="id" column="id"/>
- <result property="order_sn" column="order_sn"/>
- <result property="user_id" column="user_id"/>
- <result property="order_status" column="order_status"/>
- <result property="shipping_status" column="shipping_status"/>
- <result property="pay_status" column="pay_status"/>
- <result property="consignee" column="consignee"/>
- <result property="country" column="country"/>
- <result property="province" column="province"/>
- <result property="city" column="city"/>
- <result property="district" column="district"/>
- <result property="address" column="address"/>
- <result property="address_id" column="address_id"/>
- <result property="mobile" column="mobile"/>
- <result property="postscript" column="postscript"/>
- <result property="shipping_id" column="shipping_id"/>
- <result property="shipping_name" column="shipping_name"/>
- <result property="shipping_mobile" column="shipping_mobile"/>
- <result property="shipping_fee" column="shipping_fee"/>
- <result property="shipping_no" column="shipping_no"/>
- <result property="shipping_code" column="shipping_code"/>
- <result property="pay_id" column="pay_id"/>
- <result property="pay_name" column="pay_name"/>
- <result property="actual_price" column="actual_price"/>
- <result property="integral" column="integral"/>
- <result property="integral_money" column="integral_money"/>
- <result property="order_price" column="order_price"/>
- <result property="goods_price" column="goods_price"/>
- <result property="add_time" column="add_time"/>
- <result property="confirm_time" column="confirm_time"/>
- <result property="pay_time" column="pay_time"/>
- <result property="freight_price" column="freight_price"/>
- <result property="coupon_id" column="coupon_id"/>
- <result property="coupon_name" column="coupon_name"/>
- <result property="coupon_price" column="coupon_price"/>
- <result property="order_type" column="order_type"/>
- <result property="activity_id" column="activity_id"/>
- <result property="store_id" column="store_id"/>
- <result property="delivery_date" column="delivery_date"/>
- <result property="delivery_remark" column="delivery_remark"/>
- <result property="predict_time" column="predict_time"/>
- <result property="latitude" column="latitude"/>
- <result property="longitude" column="longitude"/>
- <result property="comment_count" column="comment_count"/>
- <result property="full_cut_price" column="full_cut_price"/>
- <result property="campMinusId" column="camp_minus_id"/>
- <result property="campName" column="camp_name"/>
- <result column="merch_sn" property="merchSn" jdbcType="VARCHAR" />
- <result column="order_biz_type" property="orderBizType" jdbcType="CHAR" />
- <result column="pay_transaction_id" property="payTransactionId" jdbcType="VARCHAR" />
- <result column="pay_mobile" property="payMobile" jdbcType="VARCHAR" />
- <result column="buyer_pay_check" property="buyerPayCheck" jdbcType="VARCHAR" />
- <result column="pay_flag" property="payFlag" jdbcType="VARCHAR" />
- <result column="creater_sn" property="createrSn" jdbcType="VARCHAR" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="moder_sn" property="moderSn" jdbcType="VARCHAR" />
- <result column="mod_time" property="modTime" jdbcType="TIMESTAMP" />
- <result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
- <result column="merch_order_sn" property="merchOrderSn" jdbcType="VARCHAR" />
- <result column="is_scan" property="isScan" jdbcType="VARCHAR" />
- <result column="store_name" property="storeName" jdbcType="VARCHAR" />
- <result property="isRefundStatus" column="isRefundStatus"/>
- <result property="refundStatus" column="refund_status"/>
- <result property="approvalRemark" column="approval_remark"/>
- <result property="isMergePay" column="is_merge_pay"/>
- <result property="isOnfflineOrder" column="is_onffline_order"/>
- <result column="merch_name" property="merchName" jdbcType="VARCHAR" />
- <result property="cashFee" column="cash_fee"/>
- <result property="cashFeeType" column="cash_fee_type"/>
- <result property="totalFee" column="total_fee"/>
- <result property="feeType" column="fee_type"/>
- <result property="rate" column="rate"/>
- </resultMap>
- <select id="queryObject" resultMap="orderMap">
- select a.*,b.latitude,b.longitude,m.apply_type 'applyType',t.apply_type 'discountApplyType'
- from mall_order a
- left join mall_address b on a.address_id = b.id
- left join mk_store_camp_minus m on a.activity_id = m.store_topic_id
- left join mk_store_ticket_discount t on a.activity_id = t.store_topic_id
- where a.id = #{value}
- </select>
- <select id="queryObjectByOrderSn" resultMap="orderMap">
- select a.*,b.latitude,b.longitude
- from mall_order a
- left join mall_address b on a.address_id = b.id
- where a.order_sn = #{order_sn}
- </select>
- <select id="queryList" resultMap="orderMap">
- select a.*,b.latitude,b.longitude,s.store_name,f.refund_status,f.approval_remark,m.merch_name
- from mall_order a
- left join mall_merch m on a.merch_sn = m.merch_sn
- left join mall_address b on a.address_id = b.id
- left join mall_store s on a.store_id = s.id
- left join mall_order_refund f on a.id = f.order_id
- <where>
- <if test="user_id != null">
- and a.user_id = #{user_id}
- </if>
- <if test="pay_status != null">
- and a.pay_status = #{pay_status}
- </if>
- <if test="shipping_status != null">
- and a.shipping_status = #{shipping_status}
- </if>
- <if test="order_status != null and order_status != 0">
- and a.order_status = #{order_status}
- </if>
- <if test="order_status == 0 ">
- and a.order_status in (0,100)
- </if>
- <if test="evaluate_status != null and evaluate_status != 0 ">
- and a.comment_count <![CDATA[ >= ]]> 1
- </if>
- <if test="evaluate_status != null and evaluate_status == 0 ">
- and a.comment_count <![CDATA[ < ]]> 1
- </if>
- <if test="startDate!=null and startDate!=''">
- AND a.add_time >= #{startDate}
- </if>
- <if test="endDate!=null and endDate!=''">
- AND a.add_time <![CDATA[ < ]]> #{endDate}
- </if>
- <if test="shippingId!=null and shippingId!=''">
- AND a.shipping_id = #{shippingId}
- </if>
- </where>
- <if test="order_status != 401">
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by a.id desc
- </otherwise>
- </choose>
- </if>
- <if test="order_status == 401">
- order by f.refund_time desc
- </if>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="queryTotal" resultType="int">
- select count(id) from mall_order a
- <where>
- <if test="user_id != null">
- and a.user_id = #{user_id}
- </if>
- <if test="pay_status != null">
- and a.pay_status = #{pay_status}
- </if>
- <if test="shipping_status != null">
- and a.shipping_status = #{shipping_status}
- </if>
- <if test="evaluate_status != null and evaluate_status != 0 ">
- and a.comment_count <![CDATA[ >= ]]> 1
- </if>
- <if test="evaluate_status != null and evaluate_status == 0 ">
- and a.comment_count <![CDATA[ < ]]> 1
- </if>
- <if test="startDate!=null and startDate!=''">
- AND a.add_time >= #{startDate}
- </if>
- <if test="endDate!=null and endDate!=''">
- AND a.add_time <![CDATA[ < ]]> #{endDate}
- </if>
- <if test="shippingId!=null and shippingId!=''">
- AND a.shipping_id = #{shippingId}
- </if>
- <if test="order_status != null">
- and a.order_status = #{order_status}
- </if>
- </where>
- </select>
- <insert id="save" parameterType="com.kmall.api.entity.OrderVo" useGeneratedKeys="true" keyProperty="id">
- insert into mall_order
- (
- `order_sn`,
- `user_id`,
- `order_status`,
- `shipping_status`,
- `shipping_code`,
- `pay_status`,
- `consignee`,
- `country`,
- `province`,
- `city`,
- `district`,
- `address`,
- `address_id`,
- `mobile`,
- `postscript`,
- `pay_id`,
- `pay_name`,
- `shipping_fee`,
- `actual_price`,
- `cash_fee`,
- `cash_fee_type`,
- `total_fee`,
- `fee_type`,
- `rate`,
- `integral`,
- `integral_money`,
- `order_price`,
- `goods_price`,
- `add_time`,
- `confirm_time`,
- `pay_time`,
- `freight_price`,
- `coupon_id`,
- `coupon_price`,
- `full_cut_price`,
- camp_minus_id,
- camp_name,
- `order_type`,
- `activity_id`,
- `store_id`,
- `delivery_date`,
- `delivery_remark`,
- `predict_time`,
- `coupon_name`,
- `comment_count`,
- <if test="merchSn != null" >
- merch_sn,
- </if>
- <if test="merchOrderSn != null" >
- merch_order_sn,
- </if>
- <if test="isScan != null" >
- is_scan,
- </if>
- <if test="isMergePay != null" >
- is_merge_pay,
- </if>
- <if test="orderBizType != null" >
- order_biz_type,
- </if>
- <if test="payTransactionId != null" >
- pay_transaction_id,
- </if>
- <if test="payMobile != null" >
- pay_mobile,
- </if>
- <if test="buyerPayCheck != null" >
- buyer_pay_check,
- </if>
- <if test="isOnfflineOrder != null" >
- `is_onffline_order`,
- </if>
- <if test="payFlag != null" >
- pay_flag,
- </if>
- <if test="createrSn != null" >
- creater_sn,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- <if test="moderSn != null" >
- moder_sn,
- </if>
- <if test="modTime != null" >
- mod_time
- </if>
- )
- values
- (
- #{order_sn},
- #{user_id},
- #{order_status},
- #{shipping_status},
- #{shipping_code},
- #{pay_status},
- #{consignee},
- #{country},
- #{province},
- #{city},
- #{district},
- #{address},
- #{address_id},
- #{mobile},
- #{postscript},
- #{pay_id},
- #{pay_name},
- #{shipping_fee},
- #{actual_price},
- #{cashFee},
- #{cashFeeType},
- #{totalFee},
- #{feeType},
- #{rate},
- #{integral},
- #{integral_money},
- #{order_price},
- #{goods_price},
- now(),
- #{confirm_time},
- #{pay_time},
- #{freight_price},
- #{coupon_id},
- #{coupon_price},
- #{full_cut_price},
- #{campMinusId},
- #{campName},
- #{order_type},
- #{activity_id},
- #{store_id},
- #{delivery_date},
- #{delivery_remark},
- #{predict_time},
- #{coupon_name},
- #{comment_count},
- <if test="merchSn != null" >
- #{merchSn},
- </if>
- <if test="merchOrderSn != null" >
- #{merchOrderSn},
- </if>
- <if test="isScan != null" >
- #{isScan},
- </if>
- <if test="isMergePay != null" >
- #{isMergePay},
- </if>
- <if test="orderBizType != null" >
- #{orderBizType,jdbcType=CHAR},
- </if>
- <if test="payTransactionId != null" >
- #{payTransactionId},
- </if>
- <if test="payMobile != null" >
- #{payMobile},
- </if>
- <if test="buyerPayCheck != null" >
- #{buyerPayCheck},
- </if>
- <if test="isOnfflineOrder != null" >
- #{isOnfflineOrder},
- </if>
- <if test="payFlag != null" >
- #{payFlag},
- </if>
- <if test="createrSn != null" >
- #{createrSn},
- </if>
- <if test="createTime != null" >
- #{createTime},
- </if>
- <if test="moderSn != null" >
- #{moderSn},
- </if>
- <if test="modTime != null" >
- #{modTime}
- </if>
- )
- </insert>
- <select id="queryObjectByIdList" resultMap="orderMap">
- select a.*
- from mall_order a
- where a.id in
- <foreach collection="orderIdList" item="orderId" open="(" close=")" separator=",">
- #{orderId}
- </foreach>
- </select>
- <insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
- insert into mall_order
- (
- `order_sn`,
- `user_id`,
- `order_status`,
- `shipping_status`,
- `shipping_code`,
- `pay_status`,
- `consignee`,
- `country`,
- `province`,
- `city`,
- `district`,
- `address`,
- `address_id`,
- `mobile`,
- `postscript`,
- `pay_id`,
- `pay_name`,
- `shipping_fee`,
- `actual_price`,
- `cash_fee`,
- `cash_fee_type`,
- `total_fee`,
- `fee_type`,
- `rate`,
- `integral`,
- `integral_money`,
- `order_price`,
- `goods_price`,
- `add_time`,
- `confirm_time`,
- `pay_time`,
- `freight_price`,
- `coupon_id`,
- `coupon_price`,
- `full_cut_price`,
- `camp_minus_id`,
- `camp_name`,
- `order_type`,
- `activity_id`,
- `store_id`,
- `delivery_date`,
- `delivery_remark`,
- `predict_time`,
- `coupon_name`,
- `comment_count`,
- merch_sn,
- merch_order_sn,
- is_scan,
- is_merge_pay,
- order_biz_type,
- `is_onffline_order`,
- pay_transaction_id,
- pay_mobile,
- create_time,
- mod_time
- )
- values
- <foreach collection="list" index="index" item="orderInfo" separator=",">
- (
- #{orderInfo.order_sn},
- #{orderInfo.user_id},
- #{orderInfo.order_status},
- #{orderInfo.shipping_status},
- #{orderInfo.shipping_code},
- #{orderInfo.pay_status},
- #{orderInfo.consignee},
- #{orderInfo.country},
- #{orderInfo.province},
- #{orderInfo.city},
- #{orderInfo.district},
- #{orderInfo.address},
- #{orderInfo.address_id},
- #{orderInfo.mobile},
- #{orderInfo.postscript},
- #{orderInfo.pay_id},
- #{orderInfo.pay_name},
- #{orderInfo.shipping_fee},
- #{orderInfo.actual_price},
- #{orderInfo.cashFee},
- #{orderInfo.cashFeeType},
- #{orderInfo.totalFee},
- #{orderInfo.feeType},
- #{orderInfo.rate},
- #{orderInfo.integral},
- #{orderInfo.integral_money},
- #{orderInfo.order_price},
- #{orderInfo.goods_price},
- now(),
- #{orderInfo.confirm_time},
- #{orderInfo.pay_time},
- #{orderInfo.freight_price},
- #{orderInfo.coupon_id},
- #{orderInfo.coupon_price},
- #{orderInfo.full_cut_price},
- #{orderInfo.campMinusId},
- #{orderInfo.campName},
- #{orderInfo.order_type},
- #{orderInfo.activity_id},
- #{orderInfo.store_id},
- #{orderInfo.delivery_date},
- #{orderInfo.delivery_remark},
- #{orderInfo.predict_time},
- #{orderInfo.coupon_name},
- #{orderInfo.comment_count},
- #{orderInfo.merchSn},
- #{orderInfo.merchOrderSn},
- #{orderInfo.isScan},
- #{orderInfo.isMergePay},
- #{orderInfo.orderBizType,jdbcType=CHAR},
- #{orderInfo.isOnfflineOrder},
- #{orderInfo.payTransactionId},
- #{orderInfo.payMobile},
- #{orderInfo.createTime},
- #{orderInfo.modTime}
- )
- </foreach>
- </insert>
- <update id="update" parameterType="com.kmall.api.entity.OrderVo">
- update mall_order
- <set>
- <if test="order_sn != null">`order_sn` = #{order_sn},</if>
- <if test="user_id != null">`user_id` = #{user_id},</if>
- <if test="order_status != null">`order_status` = #{order_status},</if>
- <if test="shipping_status != null">`shipping_status` = #{shipping_status},</if>
- <if test="shipping_code != null">`shipping_code` = #{shipping_code},</if>
- <if test="pay_status != null">`pay_status` = #{pay_status},</if>
- <if test="consignee != null">`consignee` = #{consignee},</if>
- <if test="country != null">`country` = #{country},</if>
- <if test="province != null">`province` = #{province},</if>
- <if test="city != null">`city` = #{city},</if>
- <if test="district != null">`district` = #{district},</if>
- <if test="address != null">`address` = #{address},</if>
- <if test="address_id != null">`address_id` = #{address_id},</if>
- <if test="mobile != null">`mobile` = #{mobile},</if>
- <if test="postscript != null">`postscript` = #{postscript},</if>
- <if test="shipping_id != null">`shipping_id` = #{shipping_id},</if>
- <if test="shipping_name != null">`shipping_name` = #{shipping_name},</if>
- <if test="shipping_fee != null">`shipping_fee` = #{shipping_fee},</if>
- <if test="shipping_no != null">`shipping_no` = #{shipping_no},</if>
- <if test="pay_id != null">`pay_id` = #{pay_id},</if>
- <if test="pay_name != null">`pay_name` = #{pay_name},</if>
- <if test="pay_time != null">`pay_time` = #{pay_time},</if>
- <if test="actual_price != null">`actual_price` = #{actual_price},</if>
- <if test="cashFee != null">`cash_fee` = #{cashFee}, </if>
- <if test="cashFeeType != null">`cash_fee_type` = #{cashFeeType}, </if>
- <if test="totalFee != null">`total_fee` = #{totalFee}, </if>
- <if test="feeType != null">`fee_type` = #{feeType}, </if>
- <if test="rate != null">`rate` = #{rate}, </if>
- <if test="integral != null">`integral` = #{integral},</if>
- <if test="integral_money != null">`integral_money` = #{integral_money},</if>
- <if test="order_price != null">`order_price` = #{order_price},</if>
- <if test="goods_price != null">`goods_price` = #{goods_price},</if>
- <if test="confirm_time != null">`confirm_time` = #{confirm_time},</if>
- <if test="freight_price != null">`freight_price` = #{freight_price},</if>
- <if test="coupon_id != null">`coupon_id` = #{coupon_id},</if>
- <if test="coupon_price != null">`coupon_price` = #{coupon_price},</if>
- <if test="full_cut_price != null">`full_cut_price` = #{full_cut_price},</if>
- <if test="campMinusId != null">`camp_minus_id` = #{campMinusId},</if>
- <if test="campName != null">`camp_name` = #{campName},</if>
- <if test="order_type != null">`order_type` = #{order_type},</if>
- <if test="activity_id != null">`activity_id` = #{activity_id},</if>
- <if test="store_id != null">`store_id` = #{store_id},</if>
- <if test="shipping_mobile != null">`shipping_mobile` = #{shipping_mobile},</if>
- <if test="delivery_date != null">`delivery_date` = #{delivery_date},</if>
- <if test="delivery_remark != null">`delivery_remark` = #{delivery_remark},</if>
- <if test="predict_time != null">`predict_time` = #{predict_time},</if>
- <if test="coupon_name != null">`coupon_name` = #{coupon_name},</if>
- <if test="comment_count != null">`comment_count` = #{comment_count},</if>
- <if test="merchSn != null" >merch_sn = #{merchSn},</if>
- <if test="merchOrderSn != null" >merch_order_sn = #{merchOrderSn},</if>
- <if test="isScan != null" >is_scan = #{isScan},</if>
- <if test="isMergePay != null" >is_merge_pay = #{isMergePay},</if>
- <if test="orderBizType != null" >order_biz_type = #{orderBizType,jdbcType=CHAR},</if>
- <if test="payTransactionId != null" >pay_transaction_id = #{payTransactionId},</if>
- <if test="payMobile != null" >pay_mobile = #{payMobile},</if>
- <if test="buyerPayCheck != null" >buyer_pay_check = #{buyerPayCheck},</if>
- <if test="payFlag != null" >pay_flag = #{payFlag},</if>
- <if test="createrSn != null" >creater_sn = #{createrSn},</if>
- <if test="createTime != null" >create_time = #{createTime},</if>
- <if test="moderSn != null" >moder_sn = #{moderSn},</if>
- <if test="modTime != null" >mod_time = #{modTime},</if>
- </set>
- where id = #{id}
- </update>
- <update id="updateBatch" parameterType="java.util.List">
- <foreach collection="list" item="oderInfo" index="index" open="" close="" separator=";">
- update mall_order
- <set>
- <if test="oderInfo.order_sn != null">`order_sn` = #{oderInfo.order_sn},</if>
- <if test="oderInfo.user_id != null">`user_id` = #{oderInfo.user_id},</if>
- <if test="oderInfo.order_status != null">`order_status` = #{oderInfo.order_status},</if>
- <if test="oderInfo.shipping_status != null">`shipping_status` = #{oderInfo.shipping_status},</if>
- <if test="oderInfo.shipping_code != null">`shipping_code` = #{oderInfo.shipping_code},</if>
- <if test="oderInfo.pay_status != null">`pay_status` = #{oderInfo.pay_status},</if>
- <if test="oderInfo.consignee != null">`consignee` = #{oderInfo.consignee},</if>
- <if test="oderInfo.country != null">`country` = #{oderInfo.country},</if>
- <if test="oderInfo.province != null">`province` = #{oderInfo.province},</if>
- <if test="oderInfo.city != null">`city` = #{oderInfo.city},</if>
- <if test="oderInfo.district != null">`district` = #{oderInfo.district},</if>
- <if test="oderInfo.address != null">`address` = #{oderInfo.address},</if>
- <if test="oderInfo.address_id != null">`address_id` = #{oderInfo.address_id},</if>
- <if test="oderInfo.mobile != null">`mobile` = #{oderInfo.mobile},</if>
- <if test="oderInfo.postscript != null">`postscript` = #{oderInfo.postscript},</if>
- <if test="oderInfo.shipping_id != null">`shipping_id` = #{oderInfo.shipping_id},</if>
- <if test="oderInfo.shipping_name != null">`shipping_name` = #{oderInfo.shipping_name},</if>
- <if test="oderInfo.shipping_fee != null">`shipping_fee` = #{oderInfo.shipping_fee},</if>
- <if test="oderInfo.shipping_no != null">`shipping_no` = #{oderInfo.shipping_no},</if>
- <if test="oderInfo.pay_id != null">`pay_id` = #{oderInfo.pay_id},</if>
- <if test="oderInfo.pay_name != null">`pay_name` = #{oderInfo.pay_name},</if>
- <if test="oderInfo.pay_time != null">`pay_time` = #{oderInfo.pay_time},</if>
- <if test="oderInfo.actual_price != null">`actual_price` = #{oderInfo.actual_price},</if>
- <if test="oderInfo.integral != null">`integral` = #{oderInfo.integral},</if>
- <if test="oderInfo.integral_money != null">`integral_money` = #{oderInfo.integral_money},</if>
- <if test="oderInfo.order_price != null">`order_price` = #{oderInfo.order_price},</if>
- <if test="oderInfo.goods_price != null">`goods_price` = #{oderInfo.goods_price},</if>
- <if test="oderInfo.confirm_time != null">`confirm_time` = #{oderInfo.confirm_time},</if>
- <if test="oderInfo.freight_price != null">`freight_price` = #{oderInfo.freight_price},</if>
- <if test="oderInfo.coupon_id != null">`coupon_id` = #{oderInfo.coupon_id},</if>
- <if test="oderInfo.coupon_price != null">`coupon_price` = #{oderInfo.coupon_price},</if>
- <if test="oderInfo.full_cut_price != null">`full_cut_price` = #{oderInfo.full_cut_price},</if>
- <if test="oderInfo.campMinusId != null">`camp_minus_id` = #{oderInfo.campMinusId},</if>
- <if test="oderInfo.campName != null">`camp_name` = #{oderInfo.campName},</if>
- <if test="oderInfo.order_type != null">`order_type` = #{oderInfo.order_type},</if>
- <if test="oderInfo.activity_id != null">`activity_id` = #{oderInfo.activity_id},</if>
- <if test="oderInfo.store_id != null">`store_id` = #{oderInfo.store_id},</if>
- <if test="oderInfo.shipping_mobile != null">`shipping_mobile` = #{oderInfo.shipping_mobile},</if>
- <if test="oderInfo.delivery_date != null">`delivery_date` = #{oderInfo.delivery_date},</if>
- <if test="oderInfo.delivery_remark != null">`delivery_remark` = #{oderInfo.delivery_remark},</if>
- <if test="oderInfo.predict_time != null">`predict_time` = #{oderInfo.predict_time},</if>
- <if test="oderInfo.coupon_name != null">`coupon_name` = #{oderInfo.coupon_name},</if>
- <if test="oderInfo.comment_count != null">`comment_count` = #{oderInfo.comment_count},</if>
- <if test="oderInfo.merchSn != null" >merch_sn = #{oderInfo.merchSn},</if>
- <if test="oderInfo.merchOrderSn != null" >merch_order_sn = #{oderInfo.merchOrderSn},</if>
- <if test="oderInfo.isScan != null" >is_scan = #{oderInfo.isScan},</if>
- <if test="oderInfo.isMergePay != null" >is_merge_pay = #{oderInfo.isMergePay},</if>
- <if test="oderInfo.orderBizType != null" >order_biz_type = #{oderInfo.orderBizType},</if>
- <if test="oderInfo.payTransactionId != null" >pay_transaction_id = #{oderInfo.payTransactionId},</if>
- <if test="oderInfo.payMobile != null" >pay_mobile = #{oderInfo.payMobile},</if>
- <if test="oderInfo.buyerPayCheck != null" >buyer_pay_check = #{oderInfo.buyerPayCheck},</if>
- <if test="oderInfo.payFlag != null" >pay_flag = #{oderInfo.payFlag},</if>
- <if test="oderInfo.createrSn != null" >creater_sn = #{oderInfo.createrSn},</if>
- <if test="oderInfo.createTime != null" >create_time = #{oderInfo.createTime},</if>
- <if test="oderInfo.moderSn != null" >moder_sn = #{oderInfo.moderSn},</if>
- <if test="oderInfo.modTime != null" >mod_time = #{oderInfo.modTime},</if>
- </set>
- where id = #{oderInfo.id}
- </foreach>
- </update>
- <update id="riderOrderUpdate" parameterType="com.kmall.api.entity.OrderVo">
- update mall_order
- <set>
- `order_status` = #{order_status},
- `shipping_status` = #{shipping_status},
- `shipping_code` = #{shipping_code},
- `shipping_id` = #{shipping_id},
- `shipping_name` = #{shipping_name},
- `shipping_fee` = #{shipping_fee},
- `shipping_no` = #{shipping_no},
- `shipping_mobile` = #{shipping_mobile}
- </set>
- where id = #{id}
- </update>
- <update id="updateOrderByMerchOrderSn" parameterType="com.kmall.api.entity.OrderVo">
- update mall_order
- <set>
- <if test="order_sn != null">`order_sn` = #{order_sn},</if>
- <if test="user_id != null">`user_id` = #{user_id},</if>
- <if test="order_status != null">`order_status` = #{order_status},</if>
- <if test="shipping_status != null">`shipping_status` = #{shipping_status},</if>
- <if test="shipping_code != null">`shipping_code` = #{shipping_code},</if>
- <if test="pay_status != null">`pay_status` = #{pay_status},</if>
- <if test="consignee != null">`consignee` = #{consignee},</if>
- <if test="country != null">`country` = #{country},</if>
- <if test="province != null">`province` = #{province},</if>
- <if test="city != null">`city` = #{city},</if>
- <if test="district != null">`district` = #{district},</if>
- <if test="address != null">`address` = #{address},</if>
- <if test="address_id != null">`address_id` = #{address_id},</if>
- <if test="mobile != null">`mobile` = #{mobile},</if>
- <if test="postscript != null">`postscript` = #{postscript},</if>
- <if test="shipping_id != null">`shipping_id` = #{shipping_id},</if>
- <if test="shipping_name != null">`shipping_name` = #{shipping_name},</if>
- <if test="shipping_fee != null">`shipping_fee` = #{shipping_fee},</if>
- <if test="shipping_no != null">`shipping_no` = #{shipping_no},</if>
- <if test="pay_id != null">`pay_id` = #{pay_id},</if>
- <if test="pay_name != null">`pay_name` = #{pay_name},</if>
- <if test="pay_time != null">`pay_time` = #{pay_time},</if>
- <if test="actual_price != null">`actual_price` = #{actual_price},</if>
- <if test="integral != null">`integral` = #{integral},</if>
- <if test="integral_money != null">`integral_money` = #{integral_money},</if>
- <if test="order_price != null">`order_price` = #{order_price},</if>
- <if test="goods_price != null">`goods_price` = #{goods_price},</if>
- <if test="confirm_time != null">`confirm_time` = #{confirm_time},</if>
- <if test="freight_price != null">`freight_price` = #{freight_price},</if>
- <if test="coupon_id != null">`coupon_id` = #{coupon_id},</if>
- <if test="coupon_price != null">`coupon_price` = #{coupon_price},</if>
- <if test="full_cut_price != null">`full_cut_price` = #{full_cut_price},</if>
- <if test="campMinusId != null">`camp_minus_id` = #{campMinusId},</if>
- <if test="campName != null">`camp_name` = #{campName},</if>
- <if test="order_type != null">`order_type` = #{order_type},</if>
- <if test="activity_id != null">`activity_id` = #{activity_id},</if>
- <if test="store_id != null">`store_id` = #{store_id},</if>
- <if test="shipping_mobile != null">`shipping_mobile` = #{shipping_mobile},</if>
- <if test="delivery_date != null">`delivery_date` = #{delivery_date},</if>
- <if test="delivery_remark != null">`delivery_remark` = #{delivery_remark},</if>
- <if test="predict_time != null">`predict_time` = #{predict_time},</if>
- <if test="coupon_name != null">`coupon_name` = #{coupon_name},</if>
- <if test="comment_count != null">`comment_count` = #{comment_count},</if>
- <if test="merchSn != null" >merch_sn = #{merchSn},</if>
- <if test="isScan != null" >is_scan = #{isScan},</if>
- <if test="isMergePay != null" >is_merge_pay = #{isMergePay},</if>
- <if test="orderBizType != null" >order_biz_type = #{orderBizType,jdbcType=CHAR},</if>
- <if test="payTransactionId != null" >pay_transaction_id = #{payTransactionId},</if>
- <if test="payMobile != null" >pay_mobile = #{payMobile},</if>
- <if test="buyerPayCheck != null" >buyer_pay_check = #{buyerPayCheck},</if>
- <if test="payFlag != null" >pay_flag = #{payFlag},</if>
- <if test="createrSn != null" >creater_sn = #{createrSn},</if>
- <if test="createTime != null" >create_time = #{createTime},</if>
- <if test="moderSn != null" >moder_sn = #{moderSn},</if>
- <if test="modTime != null" >mod_time = #{modTime},</if>
- </set>
- where merch_order_sn = #{merchOrderSn}
- </update>
- <select id="queryUcenterMap" resultType="map">
- select count(a.id) as orders, sum(case a.order_status when 0 then 1 else 0 end ) as unPayNum, sum(case a.order_status when 300 then 1 else 0 end ) as unTakeNum
- ,sum(case a.order_status when 201 then 1 else 0 end ) as unPaymentNum,
- sum(case a.order_status when 301 then 1 else 0 end and case a.comment_count when 0 then 1 else 0 end ) as unEvalNum
- from mall_order a
- left join mall_comment b on a.id = b.order_id
- where 1 = 1
- <if test="user_id != null">
- and a.user_id = #{user_id}
- </if>
- <if test="pay_status != null">
- and a.pay_status = #{pay_status}
- </if>
- <if test="shipping_status != null">
- and a.shipping_status = #{shipping_status}
- </if>
- <if test="evaluate_status != null and evaluate_status == 0 ">
- and not exists (select 1 from mall_comment m where a.id = m.order_id )
- </if>
- <if test="startDate!=null and startDate!=''">
- AND a.add_time >= #{startDate}
- </if>
- <if test="endDate!=null and endDate!=''">
- AND a.add_time <![CDATA[ < ]]> #{endDate}
- </if>
- <if test="shippingId!=null and shippingId!=''">
- AND a.shipping_id <![CDATA[ < ]]> #{shippingId}
- </if>
- </select>
- <select id="queryObjectByMerchOrderSn" resultMap="orderMap">
- select a.*
- from mall_order a
- where a.merch_order_sn = #{merchOrderSn}
- </select>
- <select id="queryCountByMerchOrderSn" resultType="java.lang.Integer">
- select count(*)
- from mall_order a
- where a.merch_order_sn = #{merchOrderSn}
- </select>
- <select id="queryOrderByMerchOrderSnAndRefundStatus" resultMap="orderMap">
- select * from mall_order o inner join mall_order_refund r on r.order_id = o.id where o.merch_order_sn = #{merchOrderSn}
- and r.refund_status = 2
- </select>
- <select id="querySubmitNumByStoreTopicId" resultType="com.kmall.api.entity.OrderVo">
- SELECT
- cc.user_id
- FROM
- mall_user_coupon cc
- LEFT JOIN mall_store_topic s ON cc.store_topic_id = s.id
- LEFT JOIN mall_order a ON a.coupon_id = cc.id
- where s.id = #{storeTopicId}
- GROUP BY cc.user_id
- </select>
- <select id="querySubmitOrderNumByStoreTopicId" resultType="java.lang.Integer">
- SELECT COUNT(*)
- FROM
- mall_order
- WHERE
- activity_id = #{storeTopicId}
- </select>
- <select id="queryTopicNumByTopicIdAndUserId" resultType="java.lang.Integer">
- SELECT COUNT(*)
- FROM
- mall_order
- WHERE
- activity_id = #{storeTopicId} and user_id = #{userId}
- AND order_status != '101'
- </select>
- </mapper>
|