emis-service/emis-biz/src/main/resources/mapper/EmisSettleBillPayLogMapper.xml
2024-08-31 22:31:17 +08:00

263 lines
17 KiB
XML

<?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.xdadan.erp.emis.mapper.EmisSettleBillPayLogMapper">
<resultMap type="EmisSettleBillPayLog" id="EmisSettleBillPayLogResult">
<result property="id" column="id" />
<result property="settleBillNo" column="settle_bill_no" />
<result property="payId" column="pay_id" />
<result property="amount" column="amount" />
<result property="fee" column="fee" />
<result property="currency" column="currency" />
<result property="status" column="status" />
<result property="statusDesc" column="status_desc" />
<result property="subject" column="subject" />
<result property="body" column="body" />
<result property="extra" column="extra" />
<result property="metadata" column="metadata" />
<result property="transactionNo" column="transaction_no" />
<result property="upMchId" column="up_mch_id" />
<result property="upOrderNo" column="up_order_no" />
<result property="upAttach" column="up_attach" />
<result property="isRefund" column="is_refund" />
<result property="refundTimes" column="refund_times" />
<result property="successRefundAmount" column="success_refund_amount" />
<result property="failureCode" column="failure_code" />
<result property="failureMsg" column="failure_msg" />
<result property="payType" column="pay_type" />
<result property="paid" column="paid" />
<result property="returnUrl" column="return_url" />
<result property="expireTime" column="expire_time" />
<result property="paySuccTime" column="pay_succ_time" />
<result property="credential" column="credential" />
<result property="responseExtra" column="response_extra" />
</resultMap>
<sql id="selectEmisSettleBillPayLogVo">
select id, settle_bill_no, pay_id, amount, fee, currency, status, status_desc, subject, body, extra, metadata, transaction_no, up_mch_id, up_order_no, up_attach, is_refund, refund_times, success_refund_amount, failure_code, failure_msg, pay_type, paid, return_url, expire_time, pay_succ_time, credential, response_extra, remark, del_flag, create_by, create_time, update_by, update_time from emis_settle_bill_pay_log
</sql>
<select id="selectEmisSettleBillPayLogList" parameterType="EmisSettleBillPayLog" resultMap="EmisSettleBillPayLogResult">
<include refid="selectEmisSettleBillPayLogVo"/>
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="settleBillNo != null and settleBillNo != ''"> and settle_bill_no like concat('%', #{settleBillNo}, '%')</if>
<if test="payId != null and payId != ''"> and pay_id like concat('%', #{payId}, '%')</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="fee != null "> and fee = #{fee}</if>
<if test="currency != null and currency != ''"> and currency like concat('%', #{currency}, '%')</if>
<if test="status != null "> and status = #{status}</if>
<if test="statusDesc != null and statusDesc != ''"> and status_desc like concat('%', #{statusDesc}, '%')</if>
<if test="subject != null and subject != ''"> and subject like concat('%', #{subject}, '%')</if>
<if test="body != null and body != ''"> and body like concat('%', #{body}, '%')</if>
<if test="extra != null and extra != ''"> and extra like concat('%', #{extra}, '%')</if>
<if test="metadata != null and metadata != ''"> and metadata like concat('%', #{metadata}, '%')</if>
<if test="transactionNo != null and transactionNo != ''"> and transaction_no like concat('%', #{transactionNo}, '%')</if>
<if test="upMchId != null and upMchId != ''"> and up_mch_id like concat('%', #{upMchId}, '%')</if>
<if test="upOrderNo != null and upOrderNo != ''"> and up_order_no like concat('%', #{upOrderNo}, '%')</if>
<if test="upAttach != null and upAttach != ''"> and up_attach like concat('%', #{upAttach}, '%')</if>
<if test="isRefund != null "> and is_refund = #{isRefund}</if>
<if test="refundTimes != null "> and refund_times = #{refundTimes}</if>
<if test="successRefundAmount != null "> and success_refund_amount = #{successRefundAmount}</if>
<if test="failureCode != null and failureCode != ''"> and failure_code like concat('%', #{failureCode}, '%')</if>
<if test="failureMsg != null and failureMsg != ''"> and failure_msg like concat('%', #{failureMsg}, '%')</if>
<if test="payType != null and payType != ''"> and pay_type like concat('%', #{payType}, '%')</if>
<if test="paid != null "> and paid = #{paid}</if>
<if test="returnUrl != null and returnUrl != ''"> and return_url like concat('%', #{returnUrl}, '%')</if>
<if test="expireTime != null "> and expire_time = #{expireTime}</if>
<if test="paySuccTime != null "> and pay_succ_time = #{paySuccTime}</if>
<if test="credential != null and credential != ''"> and credential like concat('%', #{credential}, '%')</if>
<if test="responseExtra != null and responseExtra != ''"> and response_extra like concat('%', #{responseExtra}, '%')</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
</where>
order by create_time desc
</select>
<select id="checkUnique" parameterType="EmisSettleBillPayLog" resultType="int">
select count(1) from emis_settle_bill_pay_log
where del_flag='0'
and id = #{id}
and settle_bill_no = #{settleBillNo}
and pay_id = #{payId}
and amount = #{amount}
and fee = #{fee}
and currency = #{currency}
and status = #{status}
and status_desc = #{statusDesc}
and subject = #{subject}
and body = #{body}
and extra = #{extra}
and metadata = #{metadata}
and transaction_no = #{transactionNo}
and up_mch_id = #{upMchId}
and up_order_no = #{upOrderNo}
and up_attach = #{upAttach}
and is_refund = #{isRefund}
and refund_times = #{refundTimes}
and success_refund_amount = #{successRefundAmount}
and failure_code = #{failureCode}
and failure_msg = #{failureMsg}
and pay_type = #{payType}
and paid = #{paid}
and return_url = #{returnUrl}
and expire_time = #{expireTime}
and pay_succ_time = #{paySuccTime}
and credential = #{credential}
and response_extra = #{responseExtra}
and remark = #{remark}
and del_flag = #{delFlag}
and create_by = #{createBy}
and create_time = #{createTime}
and update_by = #{updateBy}
and update_time = #{updateTime}
limit 1
</select>
<select id="selectEmisSettleBillPayLogById" parameterType="Long" resultMap="EmisSettleBillPayLogResult">
select id, settle_bill_no, pay_id, amount, fee, currency, status, status_desc, subject, body, extra, metadata, transaction_no, up_mch_id, up_order_no, up_attach, is_refund, refund_times, success_refund_amount, failure_code, failure_msg, pay_type, paid, return_url, expire_time, pay_succ_time, credential, response_extra, remark, del_flag, create_by, create_time, update_by, update_time
from emis_settle_bill_pay_log a
where a.id = #{id}
</select>
<select id="selectEmisSettleBillPayLogByPayId" parameterType="String" resultMap="EmisSettleBillPayLogResult">
select id, settle_bill_no, pay_id, amount, fee, currency, status, status_desc, subject, body, extra, metadata, transaction_no, up_mch_id, up_order_no, up_attach, is_refund, refund_times, success_refund_amount, failure_code, failure_msg, pay_type, paid, return_url, expire_time, pay_succ_time, credential, response_extra, remark, del_flag, create_by, create_time, update_by, update_time
from emis_settle_bill_pay_log a
where a.pay_id = #{payId}
</select>
<insert id="insertEmisSettleBillPayLog" parameterType="EmisSettleBillPayLog" useGeneratedKeys="true" keyProperty="id">
insert into emis_settle_bill_pay_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="settleBillNo != null and settleBillNo != ''">settle_bill_no,</if>
<if test="payId != null and payId != ''">pay_id,</if>
<if test="amount != null">amount,</if>
<if test="fee != null">fee,</if>
<if test="currency != null and currency != ''">currency,</if>
<if test="status != null">status,</if>
<if test="statusDesc != null and statusDesc != ''">status_desc,</if>
<if test="subject != null and subject != ''">subject,</if>
<if test="body != null and body != ''">body,</if>
<if test="extra != null and extra != ''">extra,</if>
<if test="metadata != null and metadata != ''">metadata,</if>
<if test="transactionNo != null and transactionNo != ''">transaction_no,</if>
<if test="upMchId != null and upMchId != ''">up_mch_id,</if>
<if test="upOrderNo != null and upOrderNo != ''">up_order_no,</if>
<if test="upAttach != null and upAttach != ''">up_attach,</if>
<if test="isRefund != null">is_refund,</if>
<if test="refundTimes != null">refund_times,</if>
<if test="successRefundAmount != null">success_refund_amount,</if>
<if test="failureCode != null and failureCode != ''">failure_code,</if>
<if test="failureMsg != null and failureMsg != ''">failure_msg,</if>
<if test="payType != null and payType != ''">pay_type,</if>
<if test="paid != null">paid,</if>
<if test="returnUrl != null and returnUrl != ''">return_url,</if>
<if test="expireTime != null">expire_time,</if>
<if test="paySuccTime != null">pay_succ_time,</if>
<if test="credential != null and credential != ''">credential,</if>
<if test="responseExtra != null and responseExtra != ''">response_extra,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="settleBillNo != null and settleBillNo != ''">#{settleBillNo},</if>
<if test="payId != null and payId != ''">#{payId},</if>
<if test="amount != null">#{amount},</if>
<if test="fee != null">#{fee},</if>
<if test="currency != null and currency != ''">#{currency},</if>
<if test="status != null">#{status},</if>
<if test="statusDesc != null and statusDesc != ''">#{statusDesc},</if>
<if test="subject != null and subject != ''">#{subject},</if>
<if test="body != null and body != ''">#{body},</if>
<if test="extra != null and extra != ''">#{extra},</if>
<if test="metadata != null and metadata != ''">#{metadata},</if>
<if test="transactionNo != null and transactionNo != ''">#{transactionNo},</if>
<if test="upMchId != null and upMchId != ''">#{upMchId},</if>
<if test="upOrderNo != null and upOrderNo != ''">#{upOrderNo},</if>
<if test="upAttach != null and upAttach != ''">#{upAttach},</if>
<if test="isRefund != null">#{isRefund},</if>
<if test="refundTimes != null">#{refundTimes},</if>
<if test="successRefundAmount != null">#{successRefundAmount},</if>
<if test="failureCode != null and failureCode != ''">#{failureCode},</if>
<if test="failureMsg != null and failureMsg != ''">#{failureMsg},</if>
<if test="payType != null and payType != ''">#{payType},</if>
<if test="paid != null">#{paid},</if>
<if test="returnUrl != null and returnUrl != ''">#{returnUrl},</if>
<if test="expireTime != null">#{expireTime},</if>
<if test="paySuccTime != null">#{paySuccTime},</if>
<if test="credential != null and credential != ''">#{credential},</if>
<if test="responseExtra != null and responseExtra != ''">#{responseExtra},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateEmisSettleBillPayLog" parameterType="EmisSettleBillPayLog">
update emis_settle_bill_pay_log
<trim prefix="SET" suffixOverrides=",">
<if test="settleBillNo != null and settleBillNo != ''">settle_bill_no = #{settleBillNo},</if>
<if test="payId != null and payId != ''">pay_id = #{payId},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="fee != null">fee = #{fee},</if>
<if test="currency != null and currency != ''">currency = #{currency},</if>
<if test="status != null">status = #{status},</if>
<if test="statusDesc != null and statusDesc != ''">status_desc = #{statusDesc},</if>
<if test="subject != null and subject != ''">subject = #{subject},</if>
<if test="body != null and body != ''">body = #{body},</if>
<if test="extra != null and extra != ''">extra = #{extra},</if>
<if test="metadata != null and metadata != ''">metadata = #{metadata},</if>
<if test="transactionNo != null and transactionNo != ''">transaction_no = #{transactionNo},</if>
<if test="upMchId != null and upMchId != ''">up_mch_id = #{upMchId},</if>
<if test="upOrderNo != null and upOrderNo != ''">up_order_no = #{upOrderNo},</if>
<if test="upAttach != null and upAttach != ''">up_attach = #{upAttach},</if>
<if test="isRefund != null">is_refund = #{isRefund},</if>
<if test="refundTimes != null">refund_times = #{refundTimes},</if>
<if test="successRefundAmount != null">success_refund_amount = #{successRefundAmount},</if>
<if test="failureCode != null and failureCode != ''">failure_code = #{failureCode},</if>
<if test="failureMsg != null and failureMsg != ''">failure_msg = #{failureMsg},</if>
<if test="payType != null and payType != ''">pay_type = #{payType},</if>
<if test="paid != null">paid = #{paid},</if>
<if test="returnUrl != null and returnUrl != ''">return_url = #{returnUrl},</if>
<if test="expireTime != null">expire_time = #{expireTime},</if>
<if test="paySuccTime != null">pay_succ_time = #{paySuccTime},</if>
<if test="credential != null and credential != ''">credential = #{credential},</if>
<if test="responseExtra != null and responseExtra != ''">response_extra = #{responseExtra},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEmisSettleBillPayLogById" parameterType="Long">
delete from emis_settle_bill_pay_log where id = #{id}
</delete>
<delete id="deleteEmisSettleBillPayLogByIds" parameterType="String">
delete from emis_settle_bill_pay_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>