<?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.taoke.autopay.dao.agent.ChannelAgentSettleRecordMapper">
|
<resultMap id="BaseResultMap" type="com.taoke.autopay.entity.agent.ChannelAgentSettleRecord">
|
<id column="_id" property="id" jdbcType="BIGINT"/>
|
<result column="_agent_id" property="agentId" jdbcType="BIGINT"/>
|
<result column="_settle_day" property="settleDay" jdbcType="VARCHAR"/>
|
<result column="_settle_money" property="settleMoney" jdbcType="DECIMAL"/>
|
<result column="_actual_settle_money" property="actualSettleMoney" jdbcType="DECIMAL"/>
|
<result column="_pay_time" property="payTime" jdbcType="TIMESTAMP"/>
|
<result column="_status" property="status" jdbcType="INTEGER"/>
|
<result column="_status_desc" property="statusDesc" jdbcType="VARCHAR"/>
|
<result column="_settle_time" property="settleTime" jdbcType="TIMESTAMP"/>
|
<result column="_withdraw_apply_time" property="withDrawApplyTime" jdbcType="TIMESTAMP"/>
|
<result column="_withdraw_process_time" property="withDrawProcessTime" jdbcType="TIMESTAMP"/>
|
<result column="_alipay_name" property="alipayName" jdbcType="VARCHAR"/>
|
<result column="_alipay_account" property="alipayAccount" jdbcType="VARCHAR"/>
|
<result column="_create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
<result column="_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
<association property="agent" column="_agent_id"
|
select="com.taoke.autopay.dao.agent.ChannelAgentMapper.selectByPrimaryKey">
|
|
</association>
|
<collection property="detailList" column="_id" ofType="com.taoke.autopay.entity.agent.ChannelAgentSettleDetail"
|
select="com.taoke.autopay.dao.agent.ChannelAgentSettleDetailMapper.listBySettleId">
|
|
</collection>
|
|
</resultMap>
|
<sql id="Base_Column_List">
|
_id,_agent_id,_settle_day,_settle_money,_actual_settle_money,_pay_time,_status,_status_desc,_settle_time,_withdraw_apply_time,_withdraw_process_time,_alipay_name,_alipay_account,_create_time,_update_time
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
<include refid="Base_Column_List"/>
|
from table_agent_settle_record where _id = #{id,jdbcType=BIGINT}
|
</select>
|
<select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
<include refid="Base_Column_List"/>
|
from table_agent_settle_record where _id = #{id,jdbcType=BIGINT} for update
|
</select>
|
<sql id="listWhereSQL">
|
<if test="query.id!=null">AND _id = #{query.id}</if>
|
<if test="query.agentId!=null">AND _agent_id = #{query.agentId}</if>
|
<if test="query.settleDay!=null">AND _settle_day = #{query.settleDay}</if>
|
|
<if test="query.minSettleDay!=null">AND _settle_day >= #{query.minSettleDay}</if>
|
|
<if test="query.maxSettleDay!=null">AND #{query.maxSettleDay} >=_settle_day</if>
|
|
|
|
|
<if test="query.settleMoney!=null">AND _settle_money = #{query.settleMoney}</if>
|
<if test="query.actualSettleMoney!=null">AND _actual_settle_money = #{query.actualSettleMoney}</if>
|
<if test="query.minPayTime!=null">AND _pay_time >= #{query.minPayTime}</if>
|
<if test="query.maxPayTime!=null">AND #{query.maxPayTime} > _pay_time</if>
|
<if test="query.status!=null">AND _status = #{query.status}</if>
|
<if test="query.statusList!=null">
|
<foreach collection="query.statusList" open=" AND (" close=")" separator=" or " item="status">
|
_status = #{status}
|
</foreach>
|
</if>
|
|
|
|
<if test="query.statusDesc!=null">AND _status_desc = #{query.statusDesc}</if>
|
<if test="query.minSettleTime!=null">AND _settle_time >= #{query.minSettleTime}</if>
|
<if test="query.maxSettleTime!=null">AND #{query.maxSettleTime} > _settle_time</if>
|
<if test="query.minWithDrawApplyTime!=null">AND _withdraw_apply_time >= #{query.minWithDrawApplyTime}</if>
|
<if test="query.maxWithDrawApplyTime!=null">AND #{query.maxWithDrawApplyTime} > _withdraw_apply_time</if>
|
<if test="query.minWithDrawProcessTime!=null">AND _withdraw_process_time >= #{query.minWithDrawProcessTime}
|
</if>
|
<if test="query.maxWithDrawProcessTime!=null">AND #{query.maxWithDrawProcessTime} > _withdraw_process_time
|
</if>
|
<if test="query.minCreateTime!=null">AND _create_time >= #{query.minCreateTime}</if>
|
<if test="query.maxCreateTime!=null">AND #{query.maxCreateTime} > _create_time</if>
|
<if test="query.minUpdateTime!=null">AND _update_time >= #{query.minUpdateTime}</if>
|
<if test="query.maxUpdateTime!=null">AND #{query.maxUpdateTime} > _update_time</if>
|
|
|
|
</sql>
|
<select id="list" resultMap="BaseResultMap">select
|
<include refid="Base_Column_List"/>
|
from table_agent_settle_record where 1=1
|
<include refid="listWhereSQL"/>
|
<if test="query.sortList!=null">
|
<foreach collection="query.sortList" item="item" open=" order by " separator=",">${item}</foreach>
|
</if>
|
limit #{query.start},#{query.count}
|
</select>
|
<select id="count" resultType="java.lang.Long">select count(*) from table_agent_settle_record where 1=1
|
<include refid="listWhereSQL"/>
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete
|
from table_agent_settle_record
|
where _id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.taoke.autopay.entity.agent.ChannelAgentSettleRecord" useGeneratedKeys="true"
|
keyProperty="id">insert into table_agent_settle_record (_id, _agent_id, _settle_day, _settle_money,
|
_actual_settle_money, _pay_time, _status,
|
_status_desc, _settle_time, _withdraw_apply_time,
|
_withdraw_process_time, _create_time, _update_time,
|
_id, _alipay_name, _alipay_account)
|
values (#{id,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, #{settleDay,jdbcType=VARCHAR},
|
#{settleMoney,jdbcType=DECIMAL}, #{actualSettleMoney,jdbcType=DECIMAL},
|
#{payTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER},
|
#{statusDesc,jdbcType=INTEGER}, #{settleTime,jdbcType=TIMESTAMP},
|
#{withDrawApplyTime,jdbcType=TIMESTAMP}, #{withDrawProcessTime,jdbcType=TIMESTAMP},
|
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
|
#{id,jdbcType=BIGINT}, #{alipayName,jdbcType=VARCHAR},
|
#{alipayAccount,jdbcType=VARCHAR})
|
</insert>
|
<insert id="insertSelective" parameterType="com.taoke.autopay.entity.agent.ChannelAgentSettleRecord"
|
useGeneratedKeys="true" keyProperty="id">insert into table_agent_settle_record
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">_id,</if>
|
<if test="agentId != null">_agent_id,</if>
|
<if test="settleDay != null">_settle_day,</if>
|
<if test="settleMoney != null">_settle_money,</if>
|
<if test="actualSettleMoney != null">_actual_settle_money,</if>
|
<if test="payTime != null">_pay_time,</if>
|
<if test="status != null">_status,</if>
|
<if test="statusDesc != null">_status_desc,</if>
|
<if test="settleTime != null">_settle_time,</if>
|
<if test="withDrawApplyTime != null">_withdraw_apply_time,</if>
|
<if test="withDrawProcessTime != null">_withdraw_process_time,</if>
|
<if test="createTime != null">_create_time,</if>
|
<if test="updateTime != null">_update_time,</if>
|
<if test="alipayName != null">_alipay_name,</if>
|
<if test="alipayAccount != null">_alipay_account,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="agentId != null">#{agentId,jdbcType=BIGINT},</if>
|
<if test="settleDay != null">#{settleDay,jdbcType=VARCHAR},</if>
|
<if test="settleMoney != null">#{settleMoney,jdbcType=DECIMAL},</if>
|
<if test="actualSettleMoney != null">#{actualSettleMoney,jdbcType=DECIMAL},</if>
|
<if test="payTime != null">#{payTime,jdbcType=TIMESTAMP},</if>
|
<if test="status != null">#{status,jdbcType=INTEGER},</if>
|
<if test="statusDesc != null">#{statusDesc,jdbcType=VARCHAR},</if>
|
<if test="settleTime != null">#{settleTime,jdbcType=TIMESTAMP},</if>
|
<if test="withDrawApplyTime != null">#{withDrawApplyTime,jdbcType=TIMESTAMP},</if>
|
<if test="withDrawProcessTime != null">#{withDrawProcessTime,jdbcType=TIMESTAMP},</if>
|
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="alipayName != null">#{alipayName,jdbcType=VARCHAR},</if>
|
<if test="alipayAccount != null">#{alipayAccount,jdbcType=VARCHAR},</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey"
|
parameterType="com.taoke.autopay.entity.agent.ChannelAgentSettleRecord">update table_agent_settle_record
|
set _agent_id = #{agentId,jdbcType=BIGINT},
|
_settle_day = #{settleDay,jdbcType=VARCHAR},
|
_settle_money = #{settleMoney,jdbcType=DECIMAL},
|
_actual_settle_money = #{actualSettleMoney,jdbcType=DECIMAL},
|
_pay_time = #{payTime,jdbcType=TIMESTAMP},
|
_status = #{status,jdbcType=INTEGER},
|
_status_desc = #{statusDesc,jdbcType=INTEGER},
|
_settle_time = #{settleTime,jdbcType=TIMESTAMP},
|
_withdraw_apply_time = #{withDrawApplyTime,jdbcType=TIMESTAMP},
|
_withdraw_process_time = #{withDrawProcessTime,jdbcType=TIMESTAMP},
|
_create_time = #{createTime,jdbcType=TIMESTAMP},
|
_update_time = #{updateTime,jdbcType=TIMESTAMP},
|
_alipay_name =#{alipayName,jdbcType=VARCHAR},
|
_alipay_account =#{alipayAccount,jdbcType=VARCHAR},
|
where _id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.taoke.autopay.entity.agent.ChannelAgentSettleRecord">
|
update table_agent_settle_record
|
<set>
|
<if test="agentId != null">_agent_id=#{agentId,jdbcType=BIGINT},</if>
|
<if test="settleDay != null">_settle_day=#{settleDay,jdbcType=VARCHAR},</if>
|
<if test="settleMoney != null">_settle_money=#{settleMoney,jdbcType=DECIMAL},</if>
|
<if test="actualSettleMoney != null">_actual_settle_money=#{actualSettleMoney,jdbcType=DECIMAL},</if>
|
<if test="payTime != null">_pay_time=#{payTime,jdbcType=TIMESTAMP},</if>
|
<if test="status != null">_status=#{status,jdbcType=INTEGER},</if>
|
<if test="statusDesc != null">_status_desc=#{statusDesc,jdbcType=VARCHAR},</if>
|
<if test="settleTime != null">_settle_time=#{settleTime,jdbcType=TIMESTAMP},</if>
|
<if test="withDrawApplyTime != null">_withdraw_apply_time=#{withDrawApplyTime,jdbcType=TIMESTAMP},</if>
|
<if test="withDrawProcessTime != null">_withdraw_process_time=#{withDrawProcessTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="createTime != null">_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="alipayName !=null">_alipay_name =#{alipayName,jdbcType=VARCHAR},</if>
|
<if test="alipayAccount !=null">_alipay_account =#{alipayAccount,jdbcType=VARCHAR},</if>
|
</set>
|
where _id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|