|
|
@@ -0,0 +1,187 @@
|
|
|
+<?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.fs.qw.mapper.FsCompanyExternalPayReceiptMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.fs.qw.domain.FsCompanyExternalPayReceipt" id="FsCompanyExternalPayReceiptResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="transactionId" column="transaction_id" />
|
|
|
+ <result property="tradeState" column="trade_state" />
|
|
|
+ <result property="payTime" column="pay_time" />
|
|
|
+ <result property="outTradeNo" column="out_trade_no" />
|
|
|
+ <result property="externalUserid" column="external_userid" />
|
|
|
+ <result property="totalFee" column="total_fee" />
|
|
|
+ <result property="payeeUserid" column="payee_userid" />
|
|
|
+ <result property="paymentType" column="payment_type" />
|
|
|
+ <result property="mchId" column="mch_id" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="totalRefundFee" column="total_refund_fee" />
|
|
|
+ <result property="commodityList" column="commodity_list" />
|
|
|
+ <result property="contactInfo" column="contact_info" />
|
|
|
+ <result property="miniprogramInfo" column="miniprogram_info" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsCompanyExternalPayReceiptVo">
|
|
|
+ select id, transaction_id, trade_state, pay_time, out_trade_no,
|
|
|
+ external_userid, total_fee, payee_userid, payment_type,
|
|
|
+ mch_id, remark, total_refund_fee, commodity_list,
|
|
|
+ contact_info, miniprogram_info, create_time, update_time
|
|
|
+ from fs_company_external_pay_receipt
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 条件查询列表 -->
|
|
|
+ <select id="selectFsCompanyExternalPayReceiptList" parameterType="com.fs.qw.domain.FsCompanyExternalPayReceipt" resultMap="FsCompanyExternalPayReceiptResult">
|
|
|
+ <include refid="selectFsCompanyExternalPayReceiptVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="transactionId != null and transactionId != ''">
|
|
|
+ and transaction_id = #{transactionId}
|
|
|
+ </if>
|
|
|
+ <if test="tradeState != null">
|
|
|
+ and trade_state = #{tradeState}
|
|
|
+ </if>
|
|
|
+ <if test="payTime != null">
|
|
|
+ and pay_time = #{payTime}
|
|
|
+ </if>
|
|
|
+ <if test="outTradeNo != null and outTradeNo != ''">
|
|
|
+ and out_trade_no = #{outTradeNo}
|
|
|
+ </if>
|
|
|
+ <if test="externalUserid != null and externalUserid != ''">
|
|
|
+ and external_userid = #{externalUserid}
|
|
|
+ </if>
|
|
|
+ <if test="totalFee != null">
|
|
|
+ and total_fee = #{totalFee}
|
|
|
+ </if>
|
|
|
+ <if test="payeeUserid != null and payeeUserid != ''">
|
|
|
+ and payee_userid = #{payeeUserid}
|
|
|
+ </if>
|
|
|
+ <if test="paymentType != null">
|
|
|
+ and payment_type = #{paymentType}
|
|
|
+ </if>
|
|
|
+ <if test="mchId != null and mchId != ''">
|
|
|
+ and mch_id = #{mchId}
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and remark != ''">
|
|
|
+ and remark like concat('%', #{remark}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="totalRefundFee != null">
|
|
|
+ and total_refund_fee = #{totalRefundFee}
|
|
|
+ </if>
|
|
|
+ <if test="beginPayTime != null and beginPayTime != ''">
|
|
|
+ and pay_time >= #{beginPayTime}
|
|
|
+ </if>
|
|
|
+ <if test="endPayTime != null and endPayTime != ''">
|
|
|
+ and pay_time <= #{endPayTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by pay_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据主键 ID 查询 -->
|
|
|
+ <select id="selectFsCompanyExternalPayReceiptById" parameterType="Long" resultMap="FsCompanyExternalPayReceiptResult">
|
|
|
+ <include refid="selectFsCompanyExternalPayReceiptVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据交易单号查询 -->
|
|
|
+ <select id="selectByTransactionId" resultMap="FsCompanyExternalPayReceiptResult">
|
|
|
+ <include refid="selectFsCompanyExternalPayReceiptVo"/>
|
|
|
+ where transaction_id = #{transactionId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 新增(动态字段) -->
|
|
|
+ <insert id="insertFsCompanyExternalPayReceipt" parameterType="com.fs.qw.domain.FsCompanyExternalPayReceipt" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into fs_company_external_pay_receipt
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="transactionId != null">transaction_id,</if>
|
|
|
+ <if test="tradeState != null">trade_state,</if>
|
|
|
+ <if test="payTime != null">pay_time,</if>
|
|
|
+ <if test="outTradeNo != null">out_trade_no,</if>
|
|
|
+ <if test="externalUserid != null">external_userid,</if>
|
|
|
+ <if test="totalFee != null">total_fee,</if>
|
|
|
+ <if test="payeeUserid != null">payee_userid,</if>
|
|
|
+ <if test="paymentType != null">payment_type,</if>
|
|
|
+ <if test="mchId != null">mch_id,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="totalRefundFee != null">total_refund_fee,</if>
|
|
|
+ <if test="commodityList != null">commodity_list,</if>
|
|
|
+ <if test="contactInfo != null">contact_info,</if>
|
|
|
+ <if test="miniprogramInfo != null">miniprogram_info,</if>
|
|
|
+ create_time, update_time
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="transactionId != null">#{transactionId},</if>
|
|
|
+ <if test="tradeState != null">#{tradeState},</if>
|
|
|
+ <if test="payTime != null">#{payTime},</if>
|
|
|
+ <if test="outTradeNo != null">#{outTradeNo},</if>
|
|
|
+ <if test="externalUserid != null">#{externalUserid},</if>
|
|
|
+ <if test="totalFee != null">#{totalFee},</if>
|
|
|
+ <if test="payeeUserid != null">#{payeeUserid},</if>
|
|
|
+ <if test="paymentType != null">#{paymentType},</if>
|
|
|
+ <if test="mchId != null">#{mchId},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="totalRefundFee != null">#{totalRefundFee},</if>
|
|
|
+ <if test="commodityList != null">#{commodityList},</if>
|
|
|
+ <if test="contactInfo != null">#{contactInfo},</if>
|
|
|
+ <if test="miniprogramInfo != null">#{miniprogramInfo},</if>
|
|
|
+ sysdate(), sysdate()
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 批量新增 -->
|
|
|
+ <insert id="insertBatchFsCompanyExternalPayReceipt" parameterType="list">
|
|
|
+ insert into fs_company_external_pay_receipt (
|
|
|
+ transaction_id, trade_state, pay_time, out_trade_no,
|
|
|
+ external_userid, total_fee, payee_userid, payment_type,
|
|
|
+ mch_id, remark, total_refund_fee, commodity_list,
|
|
|
+ contact_info, miniprogram_info, create_time, update_time
|
|
|
+ ) values
|
|
|
+ <foreach collection="list" item="item" separator=",">
|
|
|
+ (
|
|
|
+ #{item.transactionId}, #{item.tradeState}, #{item.payTime}, #{item.outTradeNo},
|
|
|
+ #{item.externalUserid}, #{item.totalFee}, #{item.payeeUserid}, #{item.paymentType},
|
|
|
+ #{item.mchId}, #{item.remark}, #{item.totalRefundFee}, #{item.commodityList},
|
|
|
+ #{item.contactInfo}, #{item.miniprogramInfo}, sysdate(), sysdate()
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 修改(动态字段) -->
|
|
|
+ <update id="updateFsCompanyExternalPayReceipt" parameterType="com.fs.qw.domain.FsCompanyExternalPayReceipt">
|
|
|
+ update fs_company_external_pay_receipt
|
|
|
+ <set>
|
|
|
+ <if test="transactionId != null">transaction_id = #{transactionId},</if>
|
|
|
+ <if test="tradeState != null">trade_state = #{tradeState},</if>
|
|
|
+ <if test="payTime != null">pay_time = #{payTime},</if>
|
|
|
+ <if test="outTradeNo != null">out_trade_no = #{outTradeNo},</if>
|
|
|
+ <if test="externalUserid != null">external_userid = #{externalUserid},</if>
|
|
|
+ <if test="totalFee != null">total_fee = #{totalFee},</if>
|
|
|
+ <if test="payeeUserid != null">payee_userid = #{payeeUserid},</if>
|
|
|
+ <if test="paymentType != null">payment_type = #{paymentType},</if>
|
|
|
+ <if test="mchId != null">mch_id = #{mchId},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="totalRefundFee != null">total_refund_fee = #{totalRefundFee},</if>
|
|
|
+ <if test="commodityList != null">commodity_list = #{commodityList},</if>
|
|
|
+ <if test="contactInfo != null">contact_info = #{contactInfo},</if>
|
|
|
+ <if test="miniprogramInfo != null">miniprogram_info = #{miniprogramInfo},</if>
|
|
|
+ update_time = sysdate()
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 物理删除(单条) -->
|
|
|
+ <delete id="deleteFsCompanyExternalPayReceiptById" parameterType="Long">
|
|
|
+ delete from fs_company_external_pay_receipt where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <!-- 批量物理删除 -->
|
|
|
+ <delete id="deleteFsCompanyExternalPayReceiptByIds" parameterType="String">
|
|
|
+ delete from fs_company_external_pay_receipt where id in
|
|
|
+ <foreach collection="array" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|