123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- <?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.xc.dao.UserWithdrawMapper" >
- <resultMap id="BaseResultMap" type="com.xc.pojo.UserWithdraw" >
- <constructor >
- <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="user_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="nick_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="agent_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="with_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
- <arg column="apply_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
- <arg column="trans_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
- <arg column="with_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="bank_no" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="bank_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="bank_address" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="with_status" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="with_fee" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
- <arg column="with_msg" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="with_amt_rMB" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
- <arg column="with_fee_rMB" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
- <arg column="agent_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="phone" jdbcType="VARCHAR" javaType="java.lang.String" />
- <!-- <arg column="ordersn" jdbcType="VARCHAR" javaType="java.lang.String" />-->
- </constructor>
- </resultMap>
- <sql id="Base_Column_List" >
- id, user_id, nick_name, agent_id, with_amt, apply_time, trans_time, with_name, bank_no,
- bank_name, bank_address, with_status, with_fee, with_msg, with_amt_rMB, with_fee_rMB,agent_name ,phone
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from user_withdraw
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from user_withdraw
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.xc.pojo.UserWithdraw" >
- insert into user_withdraw (id, user_id, nick_name,
- agent_id, with_amt, apply_time,
- trans_time, with_name, bank_no,
- bank_name, bank_address, with_status,
- with_fee, with_msg, with_amt_rMB, with_fee_rMB ,agent_name, phone)
- values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{nickName,jdbcType=VARCHAR},
- #{agentId,jdbcType=INTEGER}, #{withAmt,jdbcType=DECIMAL}, #{applyTime,jdbcType=TIMESTAMP},
- #{transTime,jdbcType=TIMESTAMP}, #{withName,jdbcType=VARCHAR}, #{bankNo,jdbcType=VARCHAR},
- #{bankName,jdbcType=VARCHAR}, #{bankAddress,jdbcType=VARCHAR}, #{withStatus,jdbcType=INTEGER},
- #{withFee,jdbcType=DECIMAL}, #{withMsg,jdbcType=VARCHAR}, #{withAmtRMB,jdbcType=DECIMAL}, #{withFeeRMB,jdbcType=DECIMAL},
- #{agentName,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.xc.pojo.UserWithdraw" >
- insert into user_withdraw
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="userId != null" >
- user_id,
- </if>
- <if test="nickName != null" >
- nick_name,
- </if>
- <if test="agentId != null" >
- agent_id,
- </if>
- <if test="withAmt != null" >
- with_amt,
- </if>
- <if test="applyTime != null" >
- apply_time,
- </if>
- <if test="transTime != null" >
- trans_time,
- </if>
- <if test="withName != null" >
- with_name,
- </if>
- <if test="bankNo != null" >
- bank_no,
- </if>
- <if test="bankName != null" >
- bank_name,
- </if>
- <if test="bankAddress != null" >
- bank_address,
- </if>
- <if test="withStatus != null" >
- with_status,
- </if>
- <if test="withFee != null" >
- with_fee,
- </if>
- <if test="withMsg != null" >
- with_msg,
- </if>
- <if test="withAmtRMB != null" >
- with_amt_rMB,
- </if>
- <if test="withFeeRMB != null" >
- with_fee_rMB,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=INTEGER},
- </if>
- <if test="userId != null" >
- #{userId,jdbcType=INTEGER},
- </if>
- <if test="nickName != null" >
- #{nickName,jdbcType=VARCHAR},
- </if>
- <if test="agentId != null" >
- #{agentId,jdbcType=INTEGER},
- </if>
- <if test="withAmt != null" >
- #{withAmt,jdbcType=DECIMAL},
- </if>
- <if test="applyTime != null" >
- #{applyTime,jdbcType=TIMESTAMP},
- </if>
- <if test="transTime != null" >
- #{transTime,jdbcType=TIMESTAMP},
- </if>
- <if test="withName != null" >
- #{withName,jdbcType=VARCHAR},
- </if>
- <if test="bankNo != null" >
- #{bankNo,jdbcType=VARCHAR},
- </if>
- <if test="bankName != null" >
- #{bankName,jdbcType=VARCHAR},
- </if>
- <if test="bankAddress != null" >
- #{bankAddress,jdbcType=VARCHAR},
- </if>
- <if test="withStatus != null" >
- #{withStatus,jdbcType=INTEGER},
- </if>
- <if test="withFee != null" >
- #{withFee,jdbcType=DECIMAL},
- </if>
- <if test="withMsg != null" >
- #{withMsg,jdbcType=VARCHAR},
- </if>
- <if test="withAmtRMB != null" >
- #{withAmtRMB,jdbcType=DECIMAL},
- </if>
- <if test="withFeeRMB != null" >
- #{withFeeRMB,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xc.pojo.UserWithdraw" >
- update user_withdraw
- <set >
- <if test="userId != null" >
- user_id = #{userId,jdbcType=INTEGER},
- </if>
- <if test="nickName != null" >
- nick_name = #{nickName,jdbcType=VARCHAR},
- </if>
- <if test="agentId != null" >
- agent_id = #{agentId,jdbcType=INTEGER},
- </if>
- <if test="withAmt != null" >
- with_amt = #{withAmt,jdbcType=DECIMAL},
- </if>
- <if test="applyTime != null" >
- apply_time = #{applyTime,jdbcType=TIMESTAMP},
- </if>
- <if test="transTime != null" >
- trans_time = #{transTime,jdbcType=TIMESTAMP},
- </if>
- <if test="withName != null" >
- with_name = #{withName,jdbcType=VARCHAR},
- </if>
- <if test="bankNo != null" >
- bank_no = #{bankNo,jdbcType=VARCHAR},
- </if>
- <if test="bankName != null" >
- bank_name = #{bankName,jdbcType=VARCHAR},
- </if>
- <if test="bankAddress != null" >
- bank_address = #{bankAddress,jdbcType=VARCHAR},
- </if>
- <if test="withStatus != null" >
- with_status = #{withStatus,jdbcType=INTEGER},
- </if>
- <if test="withFee != null" >
- with_fee = #{withFee,jdbcType=DECIMAL},
- </if>
- <if test="withMsg != null" >
- with_msg = #{withMsg,jdbcType=VARCHAR},
- </if>
- <if test="withAmtRMB != null" >
- with_amt_rMB = #{withAmtRMB,jdbcType=DECIMAL},
- </if>
- <if test="withFeeRMB != null" >
- with_fee_rMB = #{withFeeRMB,jdbcType=DECIMAL},
- </if>
- <if test="agentName != null" >
- agent_name = #{agentName,jdbcType=VARCHAR},
- </if>
- <if test="phone != null" >
- phone = #{phone,jdbcType=VARCHAR},
- </if>
- <!-- <if test="ordersn != null" >-->
- <!-- ordersn = #{ordersn,jdbcType=VARCHAR},-->
- <!-- </if>-->
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.xc.pojo.UserWithdraw" >
- update user_withdraw
- set user_id = #{userId,jdbcType=INTEGER},
- nick_name = #{nickName,jdbcType=VARCHAR},
- agent_id = #{agentId,jdbcType=INTEGER},
- with_amt = #{withAmt,jdbcType=DECIMAL},
- apply_time = #{applyTime,jdbcType=TIMESTAMP},
- trans_time = #{transTime,jdbcType=TIMESTAMP},
- with_name = #{withName,jdbcType=VARCHAR},
- bank_no = #{bankNo,jdbcType=VARCHAR},
- bank_name = #{bankName,jdbcType=VARCHAR},
- bank_address = #{bankAddress,jdbcType=VARCHAR},
- with_status = #{withStatus,jdbcType=INTEGER},
- with_fee = #{withFee,jdbcType=DECIMAL},
- with_msg = #{withMsg,jdbcType=VARCHAR},
- with_amt_rMB = #{withAmtRMB,jdbcType=DECIMAL},
- with_fee_rMB = #{withFeeRMB,jdbcType=DECIMAL}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="findUserWithList" parameterType="map" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM user_withdraw
- <where>
- user_id = #{uid}
- <if test="withStatus != null and withStatus != '' ">
- and with_status = #{withStatus}
- </if>
- </where>
- order by id desc
- </select>
- <!-- <select id="selectByOrdersn" resultMap="BaseResultMap">-->
- <!-- select-->
- <!-- <include refid="Base_Column_List" />-->
- <!-- from user_withdraw-->
- <!-- where ordersn = #{ordersn,jdbcType=VARCHAR}-->
- <!-- </select>-->
- <select id="listByAgent" resultMap="BaseResultMap" parameterType="map">
- SELECT
- <include refid="Base_Column_List"/>
- FROM user_withdraw
- <where>
- agent_id = #{searchId}
- <if test="realName != null and realName != '' ">
- and nick_name like CONCAT('%','${realName}','%')
- </if>
- <if test="state != null">
- and with_status = #{state}
- </if>
- </where>
- ORDER BY id DESC
- </select>
- <select id="listByAdmin" resultMap="BaseResultMap" parameterType="map">
- SELECT
- <include refid="Base_Column_List"/>
- FROM user_withdraw
- <where>
- <if test="agentId != null">
- and agent_id = #{agentId}
- </if>
- <if test="userId != null">
- and user_id = #{userId}
- </if>
- <if test="realName != null and realName != '' ">
- and nick_name like CONCAT('%','${realName}','%')
- </if>
- <if test="state != null">
- and with_status = #{state}
- </if>
- <if test="beginTime != null and beginTime != '' ">
- and trans_time <![CDATA[>=]]> #{beginTime}
- </if>
- <if test="endTime != null and endTime != '' ">
- and trans_time <![CDATA[<=]]> #{endTime}
- </if>
- </where>
- ORDER BY id DESC
- </select>
- <select id="CountSpWithSumAmtByState" parameterType="integer" resultType="decimal">
- SELECT sum(with_amt) FROM user_withdraw WHERE with_status = #{withState}
- </select>
- <select id="CountSpWithSumRmbAmtByState" parameterType="integer" resultType="decimal">
- SELECT sum(with_amt_rMB) FROM user_withdraw WHERE with_status = #{withState}
- </select>
- <select id="CountSpWithSumAmtFeeRmbByState" parameterType="integer" resultType="decimal">
- SELECT sum(with_fee_rMB) FROM user_withdraw WHERE with_status = #{withState}
- </select>
- <delete id="deleteByUserId" parameterType="integer">
- DELETE FROM user_withdraw WHERE user_id = #{userId}
- </delete>
- </mapper>
|