123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361 |
- <?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.caimei.module.pay.dao.PayDao">
- <select id="findOrder" resultType="com.caimei.module.base.entity.vo.OrderVo">
- SELECT
- *
- FROM
- cm_order
- WHERE
- orderID = #{orderID}
- AND delFlag = '0'
- </select>
- <select id="getDiscernReceipt" resultType="com.caimei.module.base.entity.vo.DiscernReceiptVo">
- SELECT
- cdr.*,
- cror.associateAmount
- FROM
- cm_receipt_order_relation cror
- LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
- WHERE
- (
- cror.orderID = #{orderID}
- AND cror.relationType = '2'
- OR
- cror.orderID = #{shopOrderIDs}
- AND cror.relationType = '1'
- )
- AND cror.delFlag = '0'
- AND cdr.delFlag = '0'
- AND cdr.payType != '16'
- ORDER BY
- cdr.receiptDate DESC
- </select>
- <update id="updateSelective" parameterType="com.caimei.module.base.entity.po.CmOrder">
- update cm_order
- <set>
- <if test="orderNo != null">
- orderNo = #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="organizeID != null">
- organizeID = #{organizeID,jdbcType=INTEGER},
- </if>
- <if test="userID != null">
- userID = #{userID,jdbcType=BIGINT},
- </if>
- <if test="buyUserID != null">
- buyUserID = #{buyUserID,jdbcType=INTEGER},
- </if>
- <if test="shopOrderIDs != null">
- shopOrderIDs = #{shopOrderIDs,jdbcType=VARCHAR},
- </if>
- <if test="orderSubmitType != null">
- orderSubmitType = #{orderSubmitType,jdbcType=INTEGER},
- </if>
- <if test="orderType != null">
- orderType = #{orderType,jdbcType=INTEGER},
- </if>
- <if test="hasActProduct != null">
- hasActProduct = #{hasActProduct,jdbcType=CHAR},
- </if>
- <if test="autoCloseTimeMills != null">
- autoCloseTimeMills = #{autoCloseTimeMills,jdbcType=DECIMAL},
- </if>
- <if test="status != null">
- `status` = #{status,jdbcType=CHAR},
- </if>
- <if test="receiptStatus != null">
- receiptStatus = #{receiptStatus,jdbcType=CHAR},
- </if>
- <if test="payStatus != null">
- payStatus = #{payStatus,jdbcType=CHAR},
- </if>
- <if test="sendOutStatus != null">
- sendOutStatus = #{sendOutStatus,jdbcType=CHAR},
- </if>
- <if test="refundType != null">
- refundType = #{refundType,jdbcType=CHAR},
- </if>
- <if test="payFlag != null">
- payFlag = #{payFlag,jdbcType=CHAR},
- </if>
- <if test="onlinePayFlag != null">
- onlinePayFlag = #{onlinePayFlag,jdbcType=CHAR},
- </if>
- <if test="productTotalFee != null">
- productTotalFee = #{productTotalFee,jdbcType=DECIMAL},
- </if>
- <if test="orderTotalFee != null">
- orderTotalFee = #{orderTotalFee,jdbcType=DECIMAL},
- </if>
- <if test="payTotalFee != null">
- payTotalFee = #{payTotalFee,jdbcType=DECIMAL},
- </if>
- <if test="payableAmount != null">
- payableAmount = #{payableAmount,jdbcType=DECIMAL},
- </if>
- <if test="balancePayFee != null">
- balancePayFee = #{balancePayFee,jdbcType=DECIMAL},
- </if>
- <if test="preferential != null">
- preferential = #{preferential,jdbcType=DECIMAL},
- </if>
- <if test="discountFee != null">
- discountFee = #{discountFee,jdbcType=DECIMAL},
- </if>
- <if test="spID != null">
- spID = #{spID,jdbcType=BIGINT},
- </if>
- <if test="mainSpID != null">
- mainSpID = #{mainSpID,jdbcType=BIGINT},
- </if>
- <if test="note != null">
- note = #{note,jdbcType=VARCHAR},
- </if>
- <if test="clubID != null">
- clubID = #{clubID,jdbcType=BIGINT},
- </if>
- <if test="clubScanTime != null">
- clubScanTime = #{clubScanTime,jdbcType=VARCHAR},
- </if>
- <if test="payWay != null">
- payWay = #{payWay,jdbcType=VARCHAR},
- </if>
- <if test="orderSource != null">
- orderSource = #{orderSource,jdbcType=CHAR},
- </if>
- <if test="closeTime != null">
- closeTime = #{closeTime,jdbcType=VARCHAR},
- </if>
- <if test="confirmTime != null">
- confirmTime = #{confirmTime,jdbcType=VARCHAR},
- </if>
- <if test="payTime != null">
- payTime = #{payTime,jdbcType=VARCHAR},
- </if>
- <if test="orderTime != null">
- orderTime = #{orderTime,jdbcType=VARCHAR},
- </if>
- <if test="productCount != null">
- productCount = #{productCount,jdbcType=INTEGER},
- </if>
- <if test="presentCount != null">
- presentCount = #{presentCount,jdbcType=INTEGER},
- </if>
- <if test="cooFreeFlag != null">
- cooFreeFlag = #{cooFreeFlag,jdbcType=CHAR},
- </if>
- <if test="cooFreeRate != null">
- cooFreeRate = #{cooFreeRate,jdbcType=INTEGER},
- </if>
- <if test="cooFreeAmount != null">
- cooFreeAmount = #{cooFreeAmount,jdbcType=DECIMAL},
- </if>
- <if test="invoiceFlag != null">
- invoiceFlag = #{invoiceFlag,jdbcType=CHAR},
- </if>
- <if test="confirmFlag != null">
- confirmFlag = #{confirmFlag,jdbcType=CHAR},
- </if>
- <if test="clauseID != null">
- clauseID = #{clauseID,jdbcType=BIGINT},
- </if>
- <if test="clauseContent != null">
- clauseContent = #{clauseContent,jdbcType=VARCHAR},
- </if>
- <if test="clauseName != null">
- clauseName = #{clauseName,jdbcType=VARCHAR},
- </if>
- <if test="updateDate != null">
- updateDate = #{updateDate,jdbcType=VARCHAR},
- </if>
- <if test="freePostFlag != null">
- freePostFlag = #{freePostFlag,jdbcType=CHAR},
- </if>
- <if test="freight != null">
- freight = #{freight,jdbcType=DECIMAL},
- </if>
- <if test="delFlag != null">
- delFlag = #{delFlag,jdbcType=CHAR},
- </if>
- <if test="freePostageTicketID != null">
- freePostageTicketID = #{freePostageTicketID,jdbcType=INTEGER},
- </if>
- <if test="splitFlag != null">
- splitFlag = #{splitFlag,jdbcType=CHAR},
- </if>
- <if test="closeReason != null">
- closeReason = #{closeReason,jdbcType=VARCHAR},
- </if>
- <if test="postageOrderFlag != null">
- postageOrderFlag = #{postageOrderFlag,jdbcType=CHAR},
- </if>
- </set>
- where orderID = #{orderID,jdbcType=BIGINT}
- </update>
- <insert id="insertDiscernReceipt" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
- parameterType="com.caimei.module.base.entity.vo.DiscernReceiptVo">
- INSERT INTO `cm_discern_receipt` (
- `payWay`, `payType`, `receiptType`,
- `receiptStatus`, `smsContent`, `smsMd5Code`,
- `orderFlag`, `receiptAmount`, `handlingFee`,
- `confirmType`, `confirmUserPermissionID`,
- `reviewUserPermissionID`, `cancelUserPermissionID`,
- `transactionNum`, `bankID`, `bankCode`,
- `kuaiQianPayTypeID`, `kuaiQianPayerID`,
- `rePayFlag`, `actualAmount`, `formData`,
- `problem`, `noOrderReason`, `reviewReason`,
- `cancelReason`, `receiptDate`, `confirmDate`,
- `reviewDate`, `cancelDate`, `updateDate`,
- `delFlag`
- )
- VALUES
- (
- #{payWay}, #{payType}, #{receiptType},
- #{receiptStatus}, #{smsContent}, #{smsMd5Code},
- #{orderFlag}, #{receiptAmount}, #{handlingFee},
- #{confirmType}, #{confirmUserPermissionID},
- #{reviewUserPermissionID}, #{cancelUserPermissionID},
- #{transactionNum}, #{bankID}, #{bankCode},
- #{kuaiQianPayTypeID}, #{kuaiQianPayerID},
- #{rePayFlag}, #{actualAmount}, #{formData},
- #{problem}, #{noOrderReason}, #{reviewReason},
- #{cancelReason}, #{receiptDate}, #{confirmDate},
- #{reviewDate}, #{cancelDate}, #{updateDate},
- #{delFlag}
- )
- </insert>
- <insert id="insertOrderRelation" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
- parameterType="com.caimei.module.base.entity.vo.OrderRelationVo">
- INSERT INTO `cm_receipt_order_relation` (
- `relationType`, `receiptID`, `associateAmount`,
- `orderID`, `delFlag`, mbOrderId, orderRequestNo
- )
- VALUES
- (
- #{relationType}, #{receiptID}, #{associateAmount},
- #{orderID}, #{delFlag},#{mbOrderId},#{orderRequestNo}
- )
- </insert>
- <select id="findOrderPayLink" resultType="com.caimei.module.base.entity.vo.OrderPayLinkVo">
- SELECT
- *
- FROM
- cm_order_pay_link
- WHERE
- orderId = #{orderId}
- <if test="amount != null">
- AND unpaidAmount = #{amount}
- </if>
- AND delFlag = '0'
- AND payStatus = '0'
- </select>
- <insert id="insertOrderPayLink">
- insert into cm_order_pay_link
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="orderId != null">
- orderId,
- </if>
- <if test="linkLogo != null">
- linkLogo,
- </if>
- <if test="unpaidAmount != null">
- unpaidAmount,
- </if>
- <if test="generateTime != null">
- generateTime,
- </if>
- <if test="effectiveTime != null">
- effectiveTime,
- </if>
- <if test="payStatus != null">
- payStatus,
- </if>
- <if test="delFlag != null">
- delFlag,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="orderId != null">
- #{orderId,jdbcType=BIGINT},
- </if>
- <if test="linkLogo != null">
- #{linkLogo,jdbcType=VARCHAR},
- </if>
- <if test="unpaidAmount != null">
- #{unpaidAmount,jdbcType=DECIMAL},
- </if>
- <if test="generateTime != null">
- #{generateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="effectiveTime != null">
- #{effectiveTime,jdbcType=TIMESTAMP},
- </if>
- <if test="payStatus != null">
- #{payStatus,jdbcType=CHAR},
- </if>
- <if test="delFlag != null">
- #{delFlag,jdbcType=CHAR},
- </if>
- </trim>
- </insert>
- <update id="updateOrderPayLink">
- update cm_order_pay_link
- <set>
- <if test="orderId != null">
- orderId = #{orderId,jdbcType=BIGINT},
- </if>
- <if test="linkLogo != null">
- linkLogo = #{linkLogo,jdbcType=VARCHAR},
- </if>
- <if test="unpaidAmount != null">
- unpaidAmount = #{unpaidAmount,jdbcType=DECIMAL},
- </if>
- <if test="generateTime != null">
- generateTime = #{generateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="effectiveTime != null">
- effectiveTime = #{effectiveTime,jdbcType=TIMESTAMP},
- </if>
- <if test="payStatus != null">
- payStatus = #{payStatus,jdbcType=CHAR},
- </if>
- <if test="delFlag != null">
- delFlag = #{delFlag,jdbcType=CHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="getOrderPayLink" resultType="com.caimei.module.base.entity.vo.OrderPayLinkVo">
- SELECT
- *
- FROM
- cm_order_pay_link
- WHERE
- linkLogo = #{linkLogo}
- AND delFlag = '0'
- </select>
- <select id="fandAllOrderProduct" resultType="com.caimei.module.base.entity.vo.OrderProductVo">
- SELECT * FROM cm_order_product WHERE orderID = #{orderId}
- </select>
- <select id="findUser" resultType="com.caimei.module.base.entity.vo.UserVo">
- SELECT
- *
- FROM
- USER
- WHERE
- userID = #{userID}
- </select>
- </mapper>
|