123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549 |
- <?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.admin.dao.OrderProcessRecordDao">
- <resultMap type="com.kmall.admin.entity.OrderProcessRecordEntity" id="orderProcessRecordMap">
- <result property="id" column="id"/>
- <result property="orderSn" column="order_sn"/>
- <result property="userId" column="user_id"/>
- <result property="orderBizType" column="order_biz_type"/>
- <result property="addOrderStartTime" column="add_order_start_time"/>
- <result property="addOrderSuccTime" column="add_order_succ_time"/>
- <result property="isAddOrderSend" column="is_add_order_send"/>
- <result property="payStartTime" column="pay_start_time"/>
- <result property="paySuccTime" column="pay_succ_time"/>
- <result property="paymentStartTime" column="payment_start_time"/>
- <result property="paymentSuccTime" column="payment_succ_time"/>
- <result property="isPaymentSend" column="is_payment_send"/>
- <result property="eleOrderStartTime" column="ele_order_start_time"/>
- <result property="eleOrderSuccTime" column="ele_order_succ_time"/>
- <result property="isEleOrderSend" column="is_ele_order_send"/>
- <result property="waybillStartTime" column="waybill_start_time"/>
- <result property="waybillSuccTime" column="waybill_succ_time"/>
- <result property="logisticsNo" column="logistics_no"/>
- <result property="customsStartTime" column="customs_start_time"/>
- <result property="customsSuccTime" column="customs_succ_time"/>
- <result property="invtNo" column="invt_no"/>
- <result property="isCustomsSend" column="is_customs_send"/>
- <result property="shipmentStartTime" column="shipment_start_time"/>
- <result property="shipmentSuccTime" column="shipment_succ_time"/>
- <result property="processContent" column="process_content"/>
- <result property="tstm" column="tstm"/>
- <result property="payTransactionId" column="ali_trade_no"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.admin.entity.OrderProcessRecordEntity">
- select
- r.`id`,
- r.`order_sn`,
- r.`user_id`,
- r.`order_biz_type`,
- `add_order_start_time`,
- `add_order_succ_time`,
- `is_add_order_send`,
- `pay_start_time`,
- `pay_succ_time`,
- `payment_start_time`,
- `payment_succ_time`,
- `is_payment_send`,
- `ele_order_start_time`,
- `ele_order_succ_time`,
- `is_ele_order_send`,
- `waybill_start_time`,
- `waybill_succ_time`,
- `logistics_no`,
- `customs_start_time`,
- `customs_succ_time`,
- `invt_no`,
- `is_customs_send`,
- `shipment_start_time`,
- `shipment_succ_time`,
- `process_content`,
- `customs_send_sms_status`,
- r.`tstm`,
- o.ali_trade_no
- from mall_order_process_record r inner join mall_order o on r.order_sn = o.order_sn
- where id = #{id}
- </select>
- <select id="queryObjectByOrderSn" resultType="com.kmall.admin.entity.OrderProcessRecordEntity">
- select
- r.`id`,
- r.`order_sn`,
- r.`user_id`,
- r.`order_biz_type`,
- `add_order_start_time`,
- `add_order_succ_time`,
- `is_add_order_send`,
- `pay_start_time`,
- `pay_succ_time`,
- `payment_start_time`,
- `payment_succ_time`,
- `is_payment_send`,
- `ele_order_start_time`,
- `ele_order_succ_time`,
- `is_ele_order_send`,
- `waybill_start_time`,
- `waybill_succ_time`,
- `logistics_no`,
- `customs_start_time`,
- `customs_succ_time`,
- `invt_no`,
- `is_customs_send`,
- `shipment_start_time`,
- `shipment_succ_time`,
- `process_content`,
- `customs_send_sms_status`,
- customs_msg as clearMsg,
- r.`tstm`,
- o.ali_trade_no as pay_transaction_id
- from mall_order_process_record r inner join mall_order o on r.order_sn = o.order_sn
- where r.order_sn = #{orderSn}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.OrderProcessRecordEntity">
- select
- `id`,
- `order_sn`,
- `user_id`,
- `order_biz_type`,
- `add_order_start_time`,
- `add_order_succ_time`,
- `is_add_order_send`,
- `pay_start_time`,
- `pay_succ_time`,
- `payment_start_time`,
- `payment_succ_time`,
- `is_payment_send`,
- `ele_order_start_time`,
- `ele_order_succ_time`,
- `is_ele_order_send`,
- `waybill_start_time`,
- `waybill_succ_time`,
- `logistics_no`,
- `customs_start_time`,
- `customs_succ_time`,
- `invt_no`,
- `is_customs_send`,
- `shipment_start_time`,
- `shipment_succ_time`,
- `process_content`,
- `customs_send_sms_status`,
- `tstm`
- from mall_order_process_record
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by id desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="queryTotal" resultType="int">
- select count(*) from mall_order_process_record
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- </select>
- <select id="queryListBySendSmsStatus" resultType="com.kmall.admin.entity.OrderProcessRecordEntity">
- select
- r.`id`,
- r.`order_sn`,
- r.`user_id`,
- r.`order_biz_type`,
- `add_order_start_time`,
- `add_order_succ_time`,
- `is_add_order_send`,
- `pay_start_time`,
- `pay_succ_time`,
- `payment_start_time`,
- `payment_succ_time`,
- `is_payment_send`,
- `ele_order_start_time`,
- `ele_order_succ_time`,
- `is_ele_order_send`,
- `waybill_start_time`,
- `waybill_succ_time`,
- `logistics_no`,
- `customs_start_time`,
- `customs_succ_time`,
- `invt_no`,
- `is_customs_send`,
- `shipment_start_time`,
- `shipment_succ_time`,
- `process_content`,
- r.`tstm`,
- o.ali_trade_no as pay_transaction_id,
- o.pay_mobile as payMobile,
- r.customs_send_sms_status as customsSendSmsStatus
- from mall_order_process_record r inner join mall_order o on r.order_sn = o.order_sn
- where r.is_customs_send='1' and r.customs_send_sms_status=#{customsSendSmsStatus}
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.OrderProcessRecordEntity" useGeneratedKeys="true" keyProperty="id">
- insert into mall_order_process_record(
- `order_sn`,
- `user_id`,
- `order_biz_type`,
- `add_order_start_time`,
- `add_order_succ_time`,
- `is_add_order_send`,
- `pay_start_time`,
- `pay_succ_time`,
- `payment_start_time`,
- `payment_succ_time`,
- `is_payment_send`,
- `ele_order_start_time`,
- `ele_order_succ_time`,
- `is_ele_order_send`,
- `waybill_start_time`,
- `waybill_succ_time`,
- `logistics_no`,
- `customs_start_time`,
- `customs_succ_time`,
- `invt_no`,
- `is_customs_send`,
- `shipment_start_time`,
- `shipment_succ_time`,
- `process_content`,
- `customs_send_sms_status`,
- `tstm`)
- values(
- #{orderSn},
- #{userId},
- #{orderBizType},
- #{addOrderStartTime},
- #{addOrderSuccTime},
- #{isAddOrderSend},
- #{payStartTime},
- #{paySuccTime},
- #{paymentStartTime},
- #{paymentSuccTime},
- #{isPaymentSend},
- #{eleOrderStartTime},
- #{eleOrderSuccTime},
- #{isEleOrderSend},
- #{waybillStartTime},
- #{waybillSuccTime},
- #{logisticsNo},
- #{customsStartTime},
- #{customsSuccTime},
- #{invtNo},
- #{isCustomsSend},
- #{shipmentStartTime},
- #{shipmentSuccTime},
- #{processContent},
- '0',
- #{tstm})
- </insert>
- <update id="update" parameterType="com.kmall.admin.entity.OrderProcessRecordEntity">
- update mall_order_process_record
- <set>
- <if test="orderSn != null">`order_sn` = #{orderSn}, </if>
- <if test="userId != null">`user_id` = #{userId}, </if>
- <if test="orderBizType != null">`order_biz_type` = #{orderBizType}, </if>
- <if test="addOrderStartTime != null">`add_order_start_time` = #{addOrderStartTime}, </if>
- <if test="addOrderSuccTime != null">`add_order_succ_time` = #{addOrderSuccTime}, </if>
- <if test="isAddOrderSend != null">`is_add_order_send` = #{isAddOrderSend}, </if>
- <if test="payStartTime != null">`pay_start_time` = #{payStartTime}, </if>
- <if test="paySuccTime != null">`pay_succ_time` = #{paySuccTime}, </if>
- <if test="paymentStartTime != null">`payment_start_time` = #{paymentStartTime}, </if>
- <if test="paymentSuccTime != null">`payment_succ_time` = #{paymentSuccTime}, </if>
- <if test="isPaymentSend != null">`is_payment_send` = #{isPaymentSend}, </if>
- <if test="eleOrderStartTime != null">`ele_order_start_time` = #{eleOrderStartTime}, </if>
- <if test="eleOrderSuccTime != null">`ele_order_succ_time` = #{eleOrderSuccTime}, </if>
- <if test="isEleOrderSend != null">`is_ele_order_send` = #{isEleOrderSend}, </if>
- <if test="waybillStartTime != null">`waybill_start_time` = #{waybillStartTime}, </if>
- <if test="waybillSuccTime != null">`waybill_succ_time` = #{waybillSuccTime}, </if>
- <if test="logisticsNo != null">`logistics_no` = #{logisticsNo}, </if>
- <if test="customsStartTime != null">`customs_start_time` = #{customsStartTime}, </if>
- <if test="customsSuccTime != null">`customs_succ_time` = #{customsSuccTime}, </if>
- <if test="invtNo != null">`invt_no` = #{invtNo}, </if>
- <if test="isCustomsSend != null">`is_customs_send` = #{isCustomsSend}, </if>
- <if test="shipmentStartTime != null">`shipment_start_time` = #{shipmentStartTime}, </if>
- <if test="shipmentSuccTime != null">`shipment_succ_time` = #{shipmentSuccTime}, </if>
- <if test="processContent != null">`process_content` = #{processContent}, </if>
- <if test="customsSendSmsStatus != null">`customs_send_sms_status` = #{customsSendSmsStatus}, </if>
- <if test="tstm != null">`tstm` = #{tstm}</if>
- </set>
- where id = #{id}
- </update>
- <delete id="delete">
- delete from mall_order_process_record where id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from mall_order_process_record where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="queryHkOrderTotal" parameterType="java.util.List" resultType="java.lang.Integer">
- select
- count(*)
- from mall_order_process_record
- where
- <if test="list != null">
- order_sn in
- <foreach collection="list" item="item" open="(" separator="," close=")">
- #{item.orderSn}
- </foreach>
- </if>
- </select>
- <update id="updateHkNoticeMsg" parameterType="java.util.List">
- update mall_order_process_record
- <trim prefix="set" suffixOverrides=",">
- <trim prefix="logistics_no =case" suffix="end,">
- <foreach collection="list" item="item" index="index">
- <if test="item.logisticsNo!=null">
- when order_sn=#{item.orderSn}
- then #{item.logisticsNo}
- </if>
- <if test="item.logisticsNo==null">
- when order_sn=#{item.orderSn}
- then mall_order_process_record.logistics_no
- </if>
- </foreach>
- </trim>
- <trim prefix="shipping_code =case" suffix="end,">
- <foreach collection="list" item="item" index="index">
- <if test="item.shippingCode!=null">
- when order_sn=#{item.orderSn}
- then #{item.shippingCode}
- </if>
- <if test="item.shippingCode==null">
- when order_sn=#{item.orderSn}
- then mall_order_process_record.shipping_code
- </if>
- </foreach>
- </trim>
- <trim prefix="shipping_name =case" suffix="end,">
- <foreach collection="list" item="item" index="index">
- <if test="item.shippingName!=null">
- when order_sn=#{item.orderSn}
- then #{item.shippingName}
- </if>
- <if test="item.shippingName==null">
- when order_sn=#{item.orderSn}
- then mall_order_process_record.shipping_name
- </if>
- </foreach>
- </trim>
- <trim prefix="waybill_succ_time =case" suffix="end,">
- <foreach collection="list" item="item" index="index">
- <if test="item.ewbStartTime!=null">
- when order_sn=#{item.orderSn}
- then #{item.ewbStartTime}
- </if>
- <if test="item.ewbStartTime==null">
- when order_sn=#{item.orderSn}
- then mall_order_process_record.waybill_succ_time
- </if>
- </foreach>
- </trim>
- <trim prefix="invt_no =case" suffix="end,">
- <foreach collection="list" item="item" index="index">
- <if test="item.clearNo!=null">
- when order_sn=#{item.orderSn}
- then #{item.clearNo}
- </if>
- <if test="item.clearNo==null">
- when order_sn=#{item.orderSn}
- then mall_order_process_record.invt_no
- </if>
- </foreach>
- </trim>
- <trim prefix="is_customs_send =case" suffix="end,">
- <foreach collection="list" item="item" index="index">
- <if test="item.clearType!=null">
- when order_sn=#{item.orderSn}
- then #{item.clearType}
- </if>
- <if test="item.clearType==null">
- when order_sn=#{item.orderSn}
- then mall_order_process_record.is_customs_send
- </if>
- </foreach>
- </trim>
- <trim prefix="customs_succ_time =case" suffix="end,">
- <foreach collection="list" item="item" index="index">
- <if test="item.customsSuccTime!=null">
- when order_sn=#{item.orderSn}
- then #{item.customsSuccTime}
- </if>
- <if test="item.customsSuccTime==null">
- when order_sn=#{item.orderSn}
- then mall_order_process_record.customs_succ_time
- </if>
- </foreach>
- </trim>
- <trim prefix="customs_msg =case" suffix="end,">
- <foreach collection="list" item="item" index="index">
- <if test="item.clearMsg!=null">
- when order_sn=#{item.orderSn}
- then #{item.clearMsg}
- </if>
- <if test="item.clearMsg==null">
- when order_sn=#{item.orderSn}
- then mall_order_process_record.customs_msg
- </if>
- </foreach>
- </trim>
- </trim>
- where order_sn in
- <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
- #{item.orderSn}
- </foreach>
- </update>
- <!-- <update id="updateHkNoticeMsg" parameterType="java.util.List">-->
- <!-- <foreach collection="list" item="item" index="index" open="" close="" separator=";">-->
- <!-- update mall_order_process_record-->
- <!-- <set>-->
- <!-- <if test="item.ewbStartTime != null">`waybill_succ_time` = #{item.ewbStartTime}, </if>-->
- <!-- <if test="item.logisticsNo != null">`logistics_no` = #{item.logisticsNo}, </if>-->
- <!-- <if test="item.customsSuccTime != null">`customs_succ_time` = #{item.customsSuccTime}, </if>-->
- <!-- <if test="item.invtNo != null">`invt_no` = #{item.invtNo}, </if>-->
- <!-- <if test="item.clearType != null">`is_customs_send` = #{item.clearType}, </if>-->
- <!-- </set>-->
- <!-- where order_sn = ${item.orderSn}-->
- <!-- </foreach>-->
- <!-- </update>-->
- <update id="updateHkNoticeMsgMallOrder" parameterType="java.util.List">
- update mall_order
- <trim prefix="set" suffixOverrides=",">
- <trim prefix="shipping_no =case" suffix="end,">
- <foreach collection="list" item="item" index="index">
- <if test="item.logisticsNo!=null">
- when order_sn=#{item.orderSn}
- then #{item.logisticsNo}
- </if>
- <if test="item.logisticsNo==null">
- when order_sn=#{item.orderSn}
- then mall_order.shipping_no
- </if>
- </foreach>
- </trim>
- <trim prefix="order_status =case" suffix="end,">
- <foreach collection="list" item="item" index="index">
- <if test="item.logisticsNo!=null">
- when order_sn=#{item.orderSn}
- then '300'
- </if>
- <if test="item.logisticsNo==null">
- when order_sn=#{item.orderSn}
- then mall_order.order_status
- </if>
- </foreach>
- </trim>
- <trim prefix="shipping_code =case" suffix="end,">
- <foreach collection="list" item="item" index="index">
- <if test="item.shippingCode!=null">
- when order_sn=#{item.orderSn}
- then #{item.shippingCode}
- </if>
- <if test="item.shippingCode==null">
- when order_sn=#{item.orderSn}
- then mall_order.shipping_code
- </if>
- </foreach>
- </trim>
- <trim prefix="shipping_name =case" suffix="end,">
- <foreach collection="list" item="item" index="index">
- <if test="item.shippingName!=null">
- when order_sn=#{item.orderSn}
- then #{item.shippingName}
- </if>
- <if test="item.shippingName==null">
- when order_sn=#{item.orderSn}
- then mall_order.shipping_name
- </if>
- </foreach>
- </trim>
- </trim>
- where order_sn in
- <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
- #{item.orderSn}
- </foreach>
- </update>
- <update id="updateMallOrderProcessRecord" parameterType="hashMap">
- update mall_order_process_record
- <set >
- <if test="paymentStartTime != null">
- payment_start_time = #{paymentStartTime},
- </if>
- <if test="paymentSuccTime != null">
- payment_succ_time = #{paymentSuccTime}, </if>
- <if test="isPaymentSend != null" >
- is_payment_send = #{isPaymentSend,jdbcType=VARCHAR},
- </if>
- <if test="eleOrderStartTime != null" >
- ele_order_start_time = #{eleOrderStartTime,jdbcType=VARCHAR},
- </if>
- <if test="eleOrderSuccTime != null" >
- ele_order_succ_time = #{eleOrderSuccTime,jdbcType=VARCHAR},
- </if>
- <if test="isEleOrderSend != null" >
- is_ele_order_send = #{isEleOrderSend,jdbcType=VARCHAR},
- </if>
- <if test="waybillStartTime != null" >
- waybill_start_time = #{waybillStartTime,jdbcType=VARCHAR},
- </if>
- <if test="waybillSuccTime != null" >
- waybill_succ_time = #{waybillSuccTime,jdbcType=VARCHAR},
- </if>
- <if test="customsStartTime != null" >
- customs_start_time = #{customsStartTime,jdbcType=VARCHAR},
- </if>
- <if test="customsSuccTime != null" >
- customs_succ_time = #{customsSuccTime,jdbcType=VARCHAR},
- </if>
- <if test="isCustomsSend != null" >
- is_customs_send = #{isCustomsSend,jdbcType=TIMESTAMP},
- </if>
- <if test="shipmentStartTime != null" >
- shipment_start_time = #{shipmentStartTime,jdbcType=VARCHAR},
- </if>
- <if test="shipmentSuccTime != null" >
- shipment_succ_time = #{shipmentSuccTime,jdbcType=VARCHAR},
- </if>
- <if test="logisticsNo != null">
- logistics_no = #{logisticsNo},
- </if>
- <if test="invtNo != null">
- invt_no = #{invtNo},
- </if>
- <if test="clearMsg != null">
- customs_msg = #{clearMsg},
- </if>
- </set>
- where order_sn = #{orderSn,jdbcType=VARCHAR}
- </update>
- </mapper>
|