admin
2025-08-20 f318c9c7c127b00f353bf45f273096d1dc4b424f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?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 &gt;= #{query.minPayTime}</if>
        <if test="query.maxPayTime!=null">AND #{query.maxPayTime} &gt; _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 &gt;= #{query.minSettleTime}</if>
        <if test="query.maxSettleTime!=null">AND #{query.maxSettleTime} &gt; _settle_time</if>
        <if test="query.minWithDrawApplyTime!=null">AND _withdraw_apply_time &gt;= #{query.minWithDrawApplyTime}</if>
        <if test="query.maxWithDrawApplyTime!=null">AND #{query.maxWithDrawApplyTime} &gt; _withdraw_apply_time</if>
        <if test="query.minWithDrawProcessTime!=null">AND _withdraw_process_time &gt;= #{query.minWithDrawProcessTime}
        </if>
        <if test="query.maxWithDrawProcessTime!=null">AND #{query.maxWithDrawProcessTime} &gt; _withdraw_process_time
        </if>
        <if test="query.minCreateTime!=null">AND _create_time &gt;= #{query.minCreateTime}</if>
        <if test="query.maxCreateTime!=null">AND #{query.maxCreateTime} &gt; _create_time</if>
        <if test="query.minUpdateTime!=null">AND _update_time &gt;= #{query.minUpdateTime}</if>
        <if test="query.maxUpdateTime!=null">AND #{query.maxUpdateTime} &gt; _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>