123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <?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.juxiao.xchat.module.xbd.mapper.record.PacketWithDrawRecordMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.record.PacketWithDrawRecord" >
- <id column="record_id" property="recordId" jdbcType="VARCHAR" />
- <result column="uid" property="uid" jdbcType="BIGINT" />
- <result column="packet_prod_cash_id" property="packetProdCashId" jdbcType="INTEGER" />
- <result column="packet_num" property="packetNum" jdbcType="DOUBLE" />
- <result column="record_status" property="recordStatus" jdbcType="TINYINT" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="bank_card" property="bankCard" jdbcType="VARCHAR" />
- <result column="bank_card_name" property="bankCardName" jdbcType="VARCHAR" />
- <result column="open_bank_code" property="openBankCode" jdbcType="VARCHAR" />
- <result column="real_tran_type" property="realTranType" jdbcType="BIT" />
- <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
- <result column="tran_type" property="tranType" jdbcType="INTEGER"/>
- <result column="merchant_order_no" property="merchantOrderNo" jdbcType="VARCHAR"/>
- <result column="admin_id" property="adminId" jdbcType="INTEGER"/>
- <result column="pingxx_id" property="pingxxId" jdbcType="VARCHAR"/>
- <result column="wx_open_id" property="wxOpenId" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="Base_Column_List" >
- record_id, uid, packet_prod_cash_id, packet_num, record_status, create_time, bank_card,
- bank_card_name, open_bank_code, real_tran_type, update_time,tran_type,merchant_order_no,admin_id,pingxx_id,wx_open_id
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from packet_withdraw_record
- where record_id = #{recordId,jdbcType=VARCHAR}
- </select>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.record.PacketWithDrawRecord" >
- update packet_withdraw_record
- <set >
- <if test="uid != null" >
- uid = #{uid,jdbcType=BIGINT},
- </if>
- <if test="packetProdCashId != null" >
- packet_prod_cash_id = #{packetProdCashId,jdbcType=INTEGER},
- </if>
- <if test="packetNum != null" >
- packet_num = #{packetNum,jdbcType=DOUBLE},
- </if>
- <if test="recordStatus != null" >
- record_status = #{recordStatus,jdbcType=TINYINT},
- </if>
- <if test="bankCard != null" >
- bank_card = #{bankCard,jdbcType=VARCHAR},
- </if>
- <if test="bankCardName != null" >
- bank_card_name = #{bankCardName,jdbcType=VARCHAR},
- </if>
- <if test="openBankCode != null" >
- open_bank_code = #{openBankCode,jdbcType=VARCHAR},
- </if>
- <if test="realTranType != null" >
- real_tran_type = #{realTranType,jdbcType=BIT},
- </if>
- <if test="updateTime != null" >
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="tranType != null" >
- tran_type = #{tranType,jdbcType=BIT},
- </if>
- <if test="merchantOrderNo != null" >
- merchant_order_no = #{merchantOrderNo,jdbcType=VARCHAR},
- </if>
- <if test="adminId != null" >
- admin_id = #{adminId,jdbcType=INTEGER},
- </if>
- <if test="pingxxId != null" >
- pingxx_id = #{pingxxId,jdbcType=VARCHAR},
- </if>
- </set>
- where record_id = #{recordId,jdbcType=VARCHAR}
- </update>
- <select id="selectByPacketWithdrawRecordByList" resultType="com.juxiao.xchat.module.xbd.vo.PacketWithdrawRecordVO">
- select ur.record_id as recordId, ur.packet_num as packetNum, ur.record_status as recordStatus, ur.create_time as createTime,
- u.uid as uid ,u.erban_no as erbanNo,u.nick as nick,u.phone as phone ,u.alipay_account as aliPayAccount,u.alipay_account_name as aliPayAccountName,
- ur.bank_card as cardNumber,ur.bank_card_name as cardName,ur.open_bank_code as openBankCode,u.withdraw_status as withdrawStatus,ur.wx_open_id as wxOpenId,
- ur.real_tran_type as realTranType,ur.tran_type as tranType,ur.merchant_order_no as merchantOrderNo,ur.admin_id as adminId,ur.pingxx_id as pingxxId
- from packet_withdraw_record ur
- INNER JOIN users u ON ur.uid=u.uid
- where 1 = 1
- <if test="erBanNo != null">
- u.erban_no = #{erBanNo}
- </if>
- <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
- AND ur.create_time between #{beginTime} and #{endTime}
- </if>
- <if test="withdrawStatus != null">
- AND ur.record_status = #{withdrawStatus}
- </if>
- <if test="tranType !=null">
- AND ur.tran_type = #{tranType}
- </if>
- <if test="realTranType != null">
- AND ur.real_tran_type = #{realTranType}
- </if>
- <if test="accountStatus != null">
- AND u.withdraw_status = #{accountStatus}
- </if>
- ORDER BY ur.create_time DESC
- </select>
- <select id="selectByPacketWithdrawRecordByCount" resultType="com.juxiao.xchat.module.xbd.vo.PacketWithdrawRecordVO">
- select COUNT(DISTINCT ur.uid) as userNum , sum(ur.packet_num) as money
- from packet_withdraw_record ur
- inner join users us on ur.uid = us.uid
- where 1 = 1
- <if test="erBanNo != null">
- and us.erban_no = #{erBanNo}
- </if>
- <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
- AND ur.create_time between #{beginTime} and #{endTime}
- </if>
- <if test="withdrawStatus != null">
- AND ur.record_status = #{withdrawStatus}
- </if>
- <if test="tranType != null">
- AND ur.tran_type = #{tranType}
- </if>
- <if test="realTranType != null">
- AND ur.real_tran_type = #{realTranType}
- </if>
- <if test="accountStatus != null">
- AND us.withdraw_status = #{accountStatus}
- </if>
- </select>
- <select id="selectByRecordIds" resultType="com.juxiao.xchat.module.xbd.vo.PacketWithdrawRecordVO">
- SELECT ur.record_id as recordId, ur.packet_num as packetNum, ur.record_status as recordStatus, ur.create_time as createTime,
- u.uid as uid ,u.erban_no as erbanNo,u.nick as nick,u.phone as phone ,u.alipay_account as aliPayAccount,u.alipay_account_name as aliPayAccountName,
- ubc.bank_card as cardNumber,ubc.bank_card_name as cardName,ubc.open_bank_code as openBankCode,u.withdraw_status as withdrawStatus,ur.wx_open_id as wxOpenId,
- ur.real_tran_type as realTranType,ur.tran_type as tranType,ur.merchant_order_no as merchantOrderNo,ur.admin_id as adminId,ur.pingxx_id as pingxxId
- FROM packet_withdraw_record ur
- INNER JOIN users u ON ur.uid= u.uid
- LEFT JOIN user_bank_card ubc on ur.uid = ubc.uid and ubc.is_use = 1
- WHERE ur.record_status !=2 and u.withdraw_status = 0 and ur.record_id IN
- <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </select>
- <select id="selectByRecordId" resultType="com.juxiao.xchat.module.xbd.vo.PacketWithdrawRecordVO">
- SELECT ur.record_id as recordId, ur.packet_num as packetNum, ur.record_status as recordStatus, ur.create_time as createTime,
- u.uid as uid ,u.erban_no as erbanNo,u.nick as nick,u.phone as phone ,u.alipay_account as aliPayAccount,u.alipay_account_name as aliPayAccountName,
- ubc.bank_card as cardNumber,ubc.bank_card_name as cardName,ubc.open_bank_code as openBankCode,u.withdraw_status as withdrawStatus,ur.wx_open_id as wxOpenId,
- ur.real_tran_type as realTranType,ur.tran_type as tranType,ur.merchant_order_no as merchantOrderNo,ur.admin_id as adminId,ur.pingxx_id as pingxxId
- FROM packet_withdraw_record ur
- INNER JOIN users u ON ur.uid= u.uid
- LEFT JOIN user_bank_card ubc on ur.uid = ubc.uid and ubc.is_use = 1
- WHERE ur.record_status !=2 and u.withdraw_status = 0 and ur.record_id = #{recordId}
- </select>
- <select id="selectByMerchantOrderNo" resultMap="BaseResultMap">
- select ur.record_id as record_id, ur.packet_num as packet_num, ur.record_status as record_status, ur.create_time as create_time,ur.bank_card as cardNumber,ur.bank_card_name as cardName,ur.open_bank_code as openBankCode
- from packet_withdraw_record ur
- WHERE ur.merchant_order_no = #{merchantOrderNo}
- </select>
- </mapper>
|