| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <?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.travel.mapper.ZFBPayMapper">
- <!-- 支付 -->
- <insert id="payUpdate" parameterType="ZFBPay">
- insert into bus_pay(uuid,release_uuid,fee_type,mch_id,nonce_str,out_trade_no,total_fee,trade_type,prepay_id,open_id,time_end,jdrq,code_url,body,pay_type)
- values(#{uuid},#{releaseUuid},#{feeType},#{mchId},#{nonceStr},#{outTradeNo},#{totalFee},#{tradeType},#{prepayId},#{openId},#{timeEnd},CONVERT(VARCHAR(100), SYSDATETIME(), 20),#{codeUrl},#{body},#{payType})
- </insert>
- <!-- 增加购买的报价单次数 -->
- <update id="addOfferNum">
- update sys_supplier set offer_num = (select offer_num + ${offerNum} from sys_supplier where code = #{code}) where code = #{code}
- </update>
- <!-- 子账户次数同步 -->
- <update id="addOfferNumChild">
- update sys_supplier set offer_num = (select offer_num from sys_supplier where code = #{code}) where account_associated = #{code}
- </update>
- <!-- 购买记录添加金额 -->
- <update id="updateBuyOfferNum" parameterType="BuyOfferNum">
- update bus_buy_offer_num set pay_amount = #{payAmount},pay_type=#{payType} where code = #{code} and uuid = #{uuid}
- </update>
- <!-- 完善充值记录 -->
- <update id="updateBuySupplier" parameterType="ZFBPay">
- update bus_top_up_record set jdrq = CONVERT(VARCHAR(100), SYSDATETIME(), 20),total_fee=#{totalFee},pay_type=#{payType} where code = #{code} and uuid = #{uuid}
- </update>
- <!-- 供应商余额充值 -->
- <update id="updateBalance" parameterType="double">
- UPDATE sys_supplier
- SET balance_of = (SELECT balance_of + ${totalFee} FROM sys_supplier WHERE code = #{code})
- WHERE
- code = #{code}
- </update>
- <!-- 子账户余额同步 -->
- <update id="updateBalanceChild">
- UPDATE sys_supplier
- SET balance_of = (SELECT balance_of FROM sys_supplier WHERE code = #{code})
- WHERE
- account_associated = #{code}
- </update>
- <!-- 查询供应商路线 -->
- <select id="getSupplierRelease" resultType="SupplierRelease">
- select
- a.*,b.name
- from bus_supplier_release a
- LEFT JOIN sys_supplier b on a.code = b.code
- <trim prefix="WHERE" prefixOverrides="and | or">
- <if test="uuid != null and uuid != ''">
- and a.uuid = #{uuid}
- </if>
- <if test="code != null and code != ''">
- and a.code = #{code}
- </if>
- <if test="demandUuid != null and demandUuid != ''">
- and a.demand_uuid = #{demandUuid}
- </if>
- </trim>
- </select>
- <!-- 查询该定制单的所有状态 -->
- <select id="getSupplierReleaseType" parameterType="String" resultType="SupplierRelease">
- select * from bus_private_ordering_type where demand_uuid = #{demandUuid}
- </select>
- <!-- 修改指定供应商定制单状态 -->
- <update id="updatePrivateType" parameterType="SupplierRelease">
- update bus_private_ordering_type set order_type = #{orderType} where code = #{code} and demand_uuid = #{demandUuid}
- </update>
- <!-- 返回供应商报价单次数 -->
- <update id="updateSupplierOffer" parameterType="SupplierRelease">
- UPDATE sys_supplier
- SET offer_num = ( SELECT offer_num + 1 FROM sys_supplier WHERE code = #{code} )
- WHERE
- code = #{code}
- </update>
- <!-- 返回供应商子报价单次数 -->
- <update id="updateSupplierOfferChild" parameterType="SupplierRelease">
- UPDATE sys_supplier
- SET offer_num = ( SELECT offer_num FROM sys_supplier WHERE code = #{code} )
- WHERE
- account_associated = #{code}
- </update>
- <!-- 查询指定参数的退款信息 -->
- <select id="getRefund" resultType="ZFBRefund">
- select * from bus_refund
- <trim prefix="WHERE" prefixOverrides="and | or">
- <if test="code != null and code !=''">
- and code = #{code}
- </if>
- <if test="releaseUuid != null and releaseUuid !=''">
- and release_uuid = #{releaseUuid}
- </if>
- </trim>
- </select>
- <!-- 查询指定报价单的支付信息 -->
- <select id="getRefundVal" resultType="ZFBPay" parameterType="String">
- SELECT
- a.*,
- c.balance_of,
- c.code
- FROM
- bus_pay a
- LEFT JOIN bus_supplier_release b ON a.release_uuid = b.uuid
- LEFT JOIN sys_supplier c ON b.code = c.code
- WHERE
- a.release_uuid = #{releUuid}
- </select>
- <!-- 修改退款状态 -->
- <update id="updateRefundType" parameterType="String">
- update bus_refund set refund_state = #{refundState} where release_uuid = #{releUuid}
- </update>
- <!-- 查询报价单单价 -->
- <select id="getByNumber" resultType="Map">
- select * from tuya_sites_info where site_id = 1
- </select>
- <!-- 添加购买次数记录 -->
- <insert id="addBuyOfferNum" parameterType="BuyOfferNum">
- insert into bus_buy_offer_num(uuid,jdrq,pay_amount,offer_num,code,pay_type)
- values(#{uuid},CONVERT(VARCHAR(100), SYSDATETIME(), 20),#{payAmount},#{offerNum},#{code},#{payType})
- </insert>
- <!-- 供应商余额充值记录 -->
- <insert id="buySupplierBalance" parameterType="WxPay">
- insert into bus_top_up_record(uuid,code,jdrq,total_fee,pay_type) values(#{uuid},#{code},CONVERT(VARCHAR(100), SYSDATETIME(), 20),#{totalFee},#{payType})
- </insert>
- <!-- 查询个人信息 -->
- <select id="getPresonalMessage" parameterType="String" resultType="Supplier">
- select * from sys_supplier where code = #{code}
- </select>
- <!-- 存入提现记录 -->
- <insert id="zfbCash" parameterType="WxWithdrawal">
- insert into bus_withdrawal(uuid,jdrq,amount,out_trade_no,code,name,account,card)
- values(#{uuid},SYSDATETIME(),#{amount},#{outTradeNo},#{code},#{name},#{account},#{card})
- </insert>
- <!-- 提现 -->
- <update id="minusBalanceOf" parameterType="WxWithdrawal">
- UPDATE sys_supplier
- SET balance_of = ( SELECT balance_of - ${amount} FROM sys_supplier WHERE code = #{code} )
- WHERE
- code = #{code}
- </update>
- <!-- 用户购买报价单后将资金转入供应商余额 -->
- <update id="addSupplierBalanceOf" parameterType="Supplier">
- UPDATE sys_supplier
- SET balance_of = ( SELECT balance_of + ${balanceOf} FROM sys_supplier WHERE code = #{code} )
- WHERE
- code = #{code}
- </update>
- <!-- 用户购买报价单后将资金转入供应商余额子账号同步 -->
- <update id="addSupplierBalanceOfChild" parameterType="Supplier">
- UPDATE sys_supplier
- SET balance_of = ( SELECT balance_of FROM sys_supplier WHERE code = #{code} )
- WHERE
- account_associated = #{code}
- </update>
- <!-- 供应商退款后账户余额变更 -->
- <update id="subtractBalance" parameterType="Supplier">
- UPDATE sys_supplier
- SET balance_of = #{bigDecimal2}
- WHERE
- code = #{code}
- </update>
- <!-- 支付 -->
- <insert id="pay" parameterType="ZFBPay">
- insert into bus_pay(uuid,release_uuid,fee_type,mch_id,nonce_str,out_trade_no,total_fee,trade_type,prepay_id,open_id,time_end,jdrq,code_url,body)
- values(#{uuid},#{releaseUuid},#{feeType},#{mchId},#{nonceStr},#{outTradeNo},#{totalFee},#{tradeType},#{prepayId},#{openId},#{timeEnd},CONVERT(VARCHAR(100), SYSDATETIME(), 20),#{codeUrl},#{body})
- </insert>
- <!-- 删除支付信息 -->
- <delete id="deletePay" parameterType="ZFBPay">
- delete from bus_pay where release_uuid = #{releaseUuid}
- </delete>
- <!-- 提现 -->
- <update id="minusBalanceOfUser" parameterType="WxWithdrawal">
- UPDATE sys_users
- SET balance_of = ( SELECT balance_of - ${amount} FROM sys_users WHERE code = #{code} )
- WHERE
- code = #{code}
- </update>
- </mapper>
|