2023-07-21 16:30:31 +08:00
|
|
|
<?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.jsowell.pile.mapper.ClearingWithdrawInfoMapper">
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.ClearingWithdrawInfo">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
<!--@Table clearing_withdraw_info-->
|
|
|
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
2023-08-08 14:35:18 +08:00
|
|
|
<result column="merchant_id" jdbcType="VARCHAR" property="merchantId" />
|
2023-08-21 11:25:01 +08:00
|
|
|
<result column="order_no" jdbcType="VARCHAR" property="orderNo" />
|
2023-07-21 16:30:31 +08:00
|
|
|
<result column="withdraw_code" jdbcType="VARCHAR" property="withdrawCode" />
|
|
|
|
|
<result column="withdraw_status" jdbcType="VARCHAR" property="withdrawStatus" />
|
2023-09-22 15:25:21 +08:00
|
|
|
<result column="withdraw_amt" jdbcType="DECIMAL" property="withdrawAmt" />
|
|
|
|
|
<result column="fee_amt" jdbcType="DECIMAL" property="feeAmt" />
|
|
|
|
|
<result column="credited_amt" jdbcType="DECIMAL" property="creditedAmt" />
|
2023-07-21 16:30:31 +08:00
|
|
|
<result column="application_time" jdbcType="TIMESTAMP" property="applicationTime" />
|
|
|
|
|
<result column="arrival_time" jdbcType="TIMESTAMP" property="arrivalTime" />
|
|
|
|
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
|
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
|
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
|
|
|
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
|
|
<result column="del_flag" jdbcType="VARCHAR" property="delFlag" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
<!--@mbg.generated-->
|
2023-09-22 15:25:21 +08:00
|
|
|
id, merchant_id, order_no, withdraw_code, withdraw_status, withdraw_amt, fee_amt,
|
|
|
|
|
credited_amt, application_time, arrival_time, create_by, create_time, update_by,
|
|
|
|
|
update_time, del_flag
|
2023-07-21 16:30:31 +08:00
|
|
|
</sql>
|
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
from clearing_withdraw_info
|
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
</select>
|
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
delete from clearing_withdraw_info
|
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
</delete>
|
2023-08-08 14:35:18 +08:00
|
|
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.ClearingWithdrawInfo" useGeneratedKeys="true">
|
2023-07-21 16:30:31 +08:00
|
|
|
<!--@mbg.generated-->
|
2023-08-21 11:25:01 +08:00
|
|
|
insert into clearing_withdraw_info (merchant_id, order_no, withdraw_code,
|
2023-09-22 15:25:21 +08:00
|
|
|
withdraw_status, withdraw_amt, fee_amt,
|
|
|
|
|
credited_amt, application_time, arrival_time,
|
2023-08-21 11:25:01 +08:00
|
|
|
create_by, create_time, update_by,
|
|
|
|
|
update_time, del_flag)
|
|
|
|
|
values (#{merchantId,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, #{withdrawCode,jdbcType=VARCHAR},
|
2023-09-22 15:25:21 +08:00
|
|
|
#{withdrawStatus,jdbcType=VARCHAR}, #{withdrawAmt,jdbcType=DECIMAL}, #{feeAmt,jdbcType=DECIMAL},
|
|
|
|
|
#{creditedAmt,jdbcType=DECIMAL}, #{applicationTime,jdbcType=TIMESTAMP}, #{arrivalTime,jdbcType=TIMESTAMP},
|
2023-08-21 11:25:01 +08:00
|
|
|
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
|
|
|
|
|
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=VARCHAR})
|
2023-07-21 16:30:31 +08:00
|
|
|
</insert>
|
2023-08-08 14:35:18 +08:00
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.ClearingWithdrawInfo" useGeneratedKeys="true">
|
2023-07-21 16:30:31 +08:00
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into clearing_withdraw_info
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
2023-08-08 14:35:18 +08:00
|
|
|
<if test="merchantId != null">
|
|
|
|
|
merchant_id,
|
2023-07-21 16:30:31 +08:00
|
|
|
</if>
|
2023-08-21 11:25:01 +08:00
|
|
|
<if test="orderNo != null">
|
|
|
|
|
order_no,
|
|
|
|
|
</if>
|
2023-07-21 16:30:31 +08:00
|
|
|
<if test="withdrawCode != null">
|
|
|
|
|
withdraw_code,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="withdrawStatus != null">
|
|
|
|
|
withdraw_status,
|
|
|
|
|
</if>
|
2023-09-22 15:25:21 +08:00
|
|
|
<if test="withdrawAmt != null">
|
|
|
|
|
withdraw_amt,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="feeAmt != null">
|
|
|
|
|
fee_amt,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="creditedAmt != null">
|
|
|
|
|
credited_amt,
|
|
|
|
|
</if>
|
2023-07-21 16:30:31 +08:00
|
|
|
<if test="applicationTime != null">
|
|
|
|
|
application_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="arrivalTime != null">
|
|
|
|
|
arrival_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
create_by,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null">
|
|
|
|
|
update_by,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
update_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
del_flag,
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
2023-08-08 14:35:18 +08:00
|
|
|
<if test="merchantId != null">
|
|
|
|
|
#{merchantId,jdbcType=VARCHAR},
|
2023-07-21 16:30:31 +08:00
|
|
|
</if>
|
2023-08-21 11:25:01 +08:00
|
|
|
<if test="orderNo != null">
|
|
|
|
|
#{orderNo,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
2023-07-21 16:30:31 +08:00
|
|
|
<if test="withdrawCode != null">
|
|
|
|
|
#{withdrawCode,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="withdrawStatus != null">
|
|
|
|
|
#{withdrawStatus,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
2023-09-22 15:25:21 +08:00
|
|
|
<if test="withdrawAmt != null">
|
|
|
|
|
#{withdrawAmt,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="feeAmt != null">
|
|
|
|
|
#{feeAmt,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="creditedAmt != null">
|
|
|
|
|
#{creditedAmt,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
2023-07-21 16:30:31 +08:00
|
|
|
<if test="applicationTime != null">
|
|
|
|
|
#{applicationTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="arrivalTime != null">
|
|
|
|
|
#{arrivalTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
#{createBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null">
|
|
|
|
|
#{updateBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
#{delFlag,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.ClearingWithdrawInfo">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
update clearing_withdraw_info
|
|
|
|
|
<set>
|
2023-08-08 14:35:18 +08:00
|
|
|
<if test="merchantId != null">
|
|
|
|
|
merchant_id = #{merchantId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
2023-08-21 11:25:01 +08:00
|
|
|
<if test="orderNo != null">
|
|
|
|
|
order_no = #{orderNo,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
2023-07-21 16:30:31 +08:00
|
|
|
<if test="withdrawCode != null">
|
|
|
|
|
withdraw_code = #{withdrawCode,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="withdrawStatus != null">
|
|
|
|
|
withdraw_status = #{withdrawStatus,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
2023-09-22 15:25:21 +08:00
|
|
|
<if test="withdrawAmt != null">
|
|
|
|
|
withdraw_amt = #{withdrawAmt,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="feeAmt != null">
|
|
|
|
|
fee_amt = #{feeAmt,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="creditedAmt != null">
|
|
|
|
|
credited_amt = #{creditedAmt,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
2023-07-21 16:30:31 +08:00
|
|
|
<if test="applicationTime != null">
|
|
|
|
|
application_time = #{applicationTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="arrivalTime != null">
|
|
|
|
|
arrival_time = #{arrivalTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null">
|
|
|
|
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
del_flag = #{delFlag,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.ClearingWithdrawInfo">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
update clearing_withdraw_info
|
2023-08-08 14:35:18 +08:00
|
|
|
set merchant_id = #{merchantId,jdbcType=VARCHAR},
|
2023-08-21 11:25:01 +08:00
|
|
|
order_no = #{orderNo,jdbcType=VARCHAR},
|
2023-08-08 14:35:18 +08:00
|
|
|
withdraw_code = #{withdrawCode,jdbcType=VARCHAR},
|
2023-07-21 16:30:31 +08:00
|
|
|
withdraw_status = #{withdrawStatus,jdbcType=VARCHAR},
|
2023-09-22 15:25:21 +08:00
|
|
|
withdraw_amt = #{withdrawAmt,jdbcType=DECIMAL},
|
|
|
|
|
fee_amt = #{feeAmt,jdbcType=DECIMAL},
|
|
|
|
|
credited_amt = #{creditedAmt,jdbcType=DECIMAL},
|
2023-07-21 16:30:31 +08:00
|
|
|
application_time = #{applicationTime,jdbcType=TIMESTAMP},
|
|
|
|
|
arrival_time = #{arrivalTime,jdbcType=TIMESTAMP},
|
|
|
|
|
create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
|
|
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
del_flag = #{delFlag,jdbcType=VARCHAR}
|
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateBatch" parameterType="java.util.List">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
update clearing_withdraw_info
|
|
|
|
|
<trim prefix="set" suffixOverrides=",">
|
2023-08-08 14:35:18 +08:00
|
|
|
<trim prefix="merchant_id = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
2023-08-21 11:25:01 +08:00
|
|
|
<trim prefix="order_no = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.orderNo,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
2023-07-21 16:30:31 +08:00
|
|
|
<trim prefix="withdraw_code = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.withdrawCode,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="withdraw_status = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.withdrawStatus,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
2023-09-22 15:25:21 +08:00
|
|
|
<trim prefix="withdraw_amt = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.withdrawAmt,jdbcType=DECIMAL}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="fee_amt = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.feeAmt,jdbcType=DECIMAL}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="credited_amt = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.creditedAmt,jdbcType=DECIMAL}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
2023-07-21 16:30:31 +08:00
|
|
|
<trim prefix="application_time = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.applicationTime,jdbcType=TIMESTAMP}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="arrival_time = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.arrivalTime,jdbcType=TIMESTAMP}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="create_by = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="create_time = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="update_by = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="update_time = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="del_flag = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
</trim>
|
|
|
|
|
where id in
|
|
|
|
|
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
|
|
|
|
#{item.id,jdbcType=INTEGER}
|
|
|
|
|
</foreach>
|
|
|
|
|
</update>
|
2023-08-08 14:35:18 +08:00
|
|
|
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
2023-07-21 16:30:31 +08:00
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into clearing_withdraw_info
|
2023-09-22 15:25:21 +08:00
|
|
|
(merchant_id, order_no, withdraw_code, withdraw_status, withdraw_amt, fee_amt, credited_amt,
|
|
|
|
|
application_time, arrival_time, create_by, create_time, update_by, update_time,
|
|
|
|
|
del_flag)
|
2023-07-21 16:30:31 +08:00
|
|
|
values
|
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
2023-08-21 11:25:01 +08:00
|
|
|
(#{item.merchantId,jdbcType=VARCHAR}, #{item.orderNo,jdbcType=VARCHAR}, #{item.withdrawCode,jdbcType=VARCHAR},
|
2023-09-22 15:25:21 +08:00
|
|
|
#{item.withdrawStatus,jdbcType=VARCHAR}, #{item.withdrawAmt,jdbcType=DECIMAL},
|
|
|
|
|
#{item.feeAmt,jdbcType=DECIMAL}, #{item.creditedAmt,jdbcType=DECIMAL}, #{item.applicationTime,jdbcType=TIMESTAMP},
|
2023-08-21 11:25:01 +08:00
|
|
|
#{item.arrivalTime,jdbcType=TIMESTAMP}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.delFlag,jdbcType=VARCHAR}
|
|
|
|
|
)
|
2023-07-21 16:30:31 +08:00
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
2023-08-08 14:35:18 +08:00
|
|
|
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.ClearingWithdrawInfo" useGeneratedKeys="true">
|
2023-07-21 16:30:31 +08:00
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into clearing_withdraw_info
|
2023-08-08 14:35:18 +08:00
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id,
|
|
|
|
|
</if>
|
|
|
|
|
merchant_id,
|
2023-08-21 11:25:01 +08:00
|
|
|
order_no,
|
2023-08-08 14:35:18 +08:00
|
|
|
withdraw_code,
|
|
|
|
|
withdraw_status,
|
2023-09-22 15:25:21 +08:00
|
|
|
withdraw_amt,
|
|
|
|
|
fee_amt,
|
|
|
|
|
credited_amt,
|
2023-08-08 14:35:18 +08:00
|
|
|
application_time,
|
|
|
|
|
arrival_time,
|
|
|
|
|
create_by,
|
|
|
|
|
create_time,
|
|
|
|
|
update_by,
|
|
|
|
|
update_time,
|
|
|
|
|
del_flag,
|
|
|
|
|
</trim>
|
2023-07-21 16:30:31 +08:00
|
|
|
values
|
2023-08-08 14:35:18 +08:00
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
#{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
#{merchantId,jdbcType=VARCHAR},
|
2023-08-21 11:25:01 +08:00
|
|
|
#{orderNo,jdbcType=VARCHAR},
|
2023-08-08 14:35:18 +08:00
|
|
|
#{withdrawCode,jdbcType=VARCHAR},
|
|
|
|
|
#{withdrawStatus,jdbcType=VARCHAR},
|
2023-09-22 15:25:21 +08:00
|
|
|
#{withdrawAmt,jdbcType=DECIMAL},
|
|
|
|
|
#{feeAmt,jdbcType=DECIMAL},
|
|
|
|
|
#{creditedAmt,jdbcType=DECIMAL},
|
2023-08-08 14:35:18 +08:00
|
|
|
#{applicationTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{arrivalTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{createBy,jdbcType=VARCHAR},
|
|
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{updateBy,jdbcType=VARCHAR},
|
|
|
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{delFlag,jdbcType=VARCHAR},
|
|
|
|
|
</trim>
|
2023-07-21 16:30:31 +08:00
|
|
|
on duplicate key update
|
2023-08-08 14:35:18 +08:00
|
|
|
<trim suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id = #{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
merchant_id = #{merchantId,jdbcType=VARCHAR},
|
2023-08-21 11:25:01 +08:00
|
|
|
order_no = #{orderNo,jdbcType=VARCHAR},
|
2023-08-08 14:35:18 +08:00
|
|
|
withdraw_code = #{withdrawCode,jdbcType=VARCHAR},
|
|
|
|
|
withdraw_status = #{withdrawStatus,jdbcType=VARCHAR},
|
2023-09-22 15:25:21 +08:00
|
|
|
withdraw_amt = #{withdrawAmt,jdbcType=DECIMAL},
|
|
|
|
|
fee_amt = #{feeAmt,jdbcType=DECIMAL},
|
|
|
|
|
credited_amt = #{creditedAmt,jdbcType=DECIMAL},
|
2023-08-08 14:35:18 +08:00
|
|
|
application_time = #{applicationTime,jdbcType=TIMESTAMP},
|
|
|
|
|
arrival_time = #{arrivalTime,jdbcType=TIMESTAMP},
|
|
|
|
|
create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
|
|
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
del_flag = #{delFlag,jdbcType=VARCHAR},
|
|
|
|
|
</trim>
|
2023-07-21 16:30:31 +08:00
|
|
|
</insert>
|
2023-08-08 14:35:18 +08:00
|
|
|
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.ClearingWithdrawInfo" useGeneratedKeys="true">
|
2023-07-21 16:30:31 +08:00
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into clearing_withdraw_info
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id,
|
|
|
|
|
</if>
|
2023-08-08 14:35:18 +08:00
|
|
|
<if test="merchantId != null">
|
|
|
|
|
merchant_id,
|
|
|
|
|
</if>
|
2023-08-21 11:25:01 +08:00
|
|
|
<if test="orderNo != null">
|
|
|
|
|
order_no,
|
|
|
|
|
</if>
|
2023-07-21 16:30:31 +08:00
|
|
|
<if test="withdrawCode != null">
|
|
|
|
|
withdraw_code,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="withdrawStatus != null">
|
|
|
|
|
withdraw_status,
|
|
|
|
|
</if>
|
2023-09-22 15:25:21 +08:00
|
|
|
<if test="withdrawAmt != null">
|
|
|
|
|
withdraw_amt,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="feeAmt != null">
|
|
|
|
|
fee_amt,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="creditedAmt != null">
|
|
|
|
|
credited_amt,
|
|
|
|
|
</if>
|
2023-07-21 16:30:31 +08:00
|
|
|
<if test="applicationTime != null">
|
|
|
|
|
application_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="arrivalTime != null">
|
|
|
|
|
arrival_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
create_by,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null">
|
|
|
|
|
update_by,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
update_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
del_flag,
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
values
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
#{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
2023-08-08 14:35:18 +08:00
|
|
|
<if test="merchantId != null">
|
|
|
|
|
#{merchantId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
2023-08-21 11:25:01 +08:00
|
|
|
<if test="orderNo != null">
|
|
|
|
|
#{orderNo,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
2023-07-21 16:30:31 +08:00
|
|
|
<if test="withdrawCode != null">
|
|
|
|
|
#{withdrawCode,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="withdrawStatus != null">
|
|
|
|
|
#{withdrawStatus,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
2023-09-22 15:25:21 +08:00
|
|
|
<if test="withdrawAmt != null">
|
|
|
|
|
#{withdrawAmt,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="feeAmt != null">
|
|
|
|
|
#{feeAmt,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="creditedAmt != null">
|
|
|
|
|
#{creditedAmt,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
2023-07-21 16:30:31 +08:00
|
|
|
<if test="applicationTime != null">
|
|
|
|
|
#{applicationTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="arrivalTime != null">
|
|
|
|
|
#{arrivalTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
#{createBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null">
|
|
|
|
|
#{updateBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
#{delFlag,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
on duplicate key update
|
|
|
|
|
<trim suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id = #{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
2023-08-08 14:35:18 +08:00
|
|
|
<if test="merchantId != null">
|
|
|
|
|
merchant_id = #{merchantId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
2023-08-21 11:25:01 +08:00
|
|
|
<if test="orderNo != null">
|
|
|
|
|
order_no = #{orderNo,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
2023-07-21 16:30:31 +08:00
|
|
|
<if test="withdrawCode != null">
|
|
|
|
|
withdraw_code = #{withdrawCode,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="withdrawStatus != null">
|
|
|
|
|
withdraw_status = #{withdrawStatus,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
2023-09-22 15:25:21 +08:00
|
|
|
<if test="withdrawAmt != null">
|
|
|
|
|
withdraw_amt = #{withdrawAmt,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="feeAmt != null">
|
|
|
|
|
fee_amt = #{feeAmt,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="creditedAmt != null">
|
|
|
|
|
credited_amt = #{creditedAmt,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
2023-07-21 16:30:31 +08:00
|
|
|
<if test="applicationTime != null">
|
|
|
|
|
application_time = #{applicationTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="arrivalTime != null">
|
|
|
|
|
arrival_time = #{arrivalTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null">
|
|
|
|
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
del_flag = #{delFlag,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
2023-08-08 14:16:05 +08:00
|
|
|
|
|
|
|
|
<select id="selectByWithdrawCode" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
from clearing_withdraw_info
|
|
|
|
|
where del_flag = '0'
|
|
|
|
|
and withdraw_code = #{withdrawCode,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
2023-08-22 09:42:30 +08:00
|
|
|
|
|
|
|
|
<select id="selectWithdrawInfoByOrderCode" resultType="com.jsowell.pile.vo.web.ClearingBillVO">
|
|
|
|
|
select
|
|
|
|
|
t1.clearing_bill_code as clearingBillCode,
|
|
|
|
|
t3.withdraw_code as withdrawCode,
|
|
|
|
|
t3.withdraw_status as withdrawStatus
|
|
|
|
|
from clearing_bill_info t1
|
|
|
|
|
left join clearing_bill_detail t2 on t2.clearing_bill_code = t1.clearing_bill_code and t2.del_flag = '0'
|
|
|
|
|
left join clearing_withdraw_info t3 on t3.withdraw_code = t1.withdraw_code and t3.del_flag = '0'
|
|
|
|
|
where t1.del_flag = '0'
|
|
|
|
|
and t2.order_code = #{orderCode,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
2023-08-22 13:44:10 +08:00
|
|
|
|
|
|
|
|
<select id="selectWithdrawInfoByOrderCodeList" resultType="com.jsowell.pile.vo.web.ClearingBillVO">
|
2025-08-08 13:58:21 +08:00
|
|
|
select DISTINCT(t1.clearing_bill_code) as clearingBillCode,
|
2023-08-22 13:44:10 +08:00
|
|
|
t2.order_code as orderCode,
|
2023-08-29 16:40:20 +08:00
|
|
|
t5.settle_amount as settleAmount,
|
2023-08-22 13:44:10 +08:00
|
|
|
t3.withdraw_code as withdrawCode,
|
|
|
|
|
t3.withdraw_status as withdrawStatus,
|
|
|
|
|
t4.payment_id as paymentId
|
|
|
|
|
from clearing_bill_info t1
|
|
|
|
|
left join clearing_bill_detail t2 on t2.clearing_bill_code = t1.clearing_bill_code and t2.del_flag = '0'
|
|
|
|
|
left join clearing_withdraw_info t3 on t3.withdraw_code = t1.withdraw_code and t3.del_flag = '0'
|
|
|
|
|
left join adapay_callback_record t4 on t4.order_code = t2.order_code and t4.del_flag = '0'
|
2023-08-29 16:40:20 +08:00
|
|
|
left join order_basic_info t5 on t5.order_code = t2.order_code and t5.del_flag = '0'
|
2023-08-22 13:44:10 +08:00
|
|
|
where t1.del_flag = '0'
|
|
|
|
|
and t2.order_code in
|
2023-09-22 15:25:21 +08:00
|
|
|
<foreach close=")" collection="orderCodeList" item="orderCode" open="(" separator=",">
|
2023-08-22 13:44:10 +08:00
|
|
|
#{orderCode,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</select>
|
2023-09-19 17:05:16 +08:00
|
|
|
|
|
|
|
|
<select id="selectByMerchantId" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
from clearing_withdraw_info
|
|
|
|
|
where del_flag = '0'
|
|
|
|
|
and merchant_id = #{merchantId,jdbcType=VARCHAR}
|
2024-09-09 16:25:01 +08:00
|
|
|
order by create_time desc
|
2023-09-19 17:05:16 +08:00
|
|
|
</select>
|
2024-01-05 15:26:22 +08:00
|
|
|
|
|
|
|
|
<select id="queryTotalWithdraw" resultType="java.math.BigDecimal">
|
|
|
|
|
select
|
|
|
|
|
sum(withdraw_amt)
|
|
|
|
|
from clearing_withdraw_info
|
|
|
|
|
where del_flag = '0'
|
2024-05-31 15:17:59 +08:00
|
|
|
and withdraw_status = '1'
|
2024-01-05 15:26:22 +08:00
|
|
|
and merchant_id = #{merchantId,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
2023-07-21 16:30:31 +08:00
|
|
|
</mapper>
|