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
<?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.credit.UserCreditRecordMapper">
    <resultMap id="BaseResultMap" type="com.taoke.autopay.entity.credit.UserCreditRecord">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="uid" property="uid" jdbcType="BIGINT"/>
        <result column="direction" property="direction" jdbcType="INTEGER"/>
        <result column="identifier_id" property="identifierId" jdbcType="VARCHAR"/>
        <result column="credit_amount" property="creditAmount" jdbcType="INTEGER"/>
        <result column="acquisition_method" property="acquisitionMethod" jdbcType="VARCHAR"/>
        <result column="consumption_method" property="consumptionMethod" jdbcType="VARCHAR"/>
        <result column="description" property="description" jdbcType="VARCHAR"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
    </resultMap>
    <sql id="Base_Column_List">id,uid,direction,identifier_id,credit_amount,acquisition_method,consumption_method,description,create_time,update_time</sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
        <include refid="Base_Column_List"/> from table_user_credit_record where id = #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap" parameterType="java.lang.Long">select
        <include refid="Base_Column_List"/> from table_user_credit_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.uid!=null">AND uid = #{query.uid}</if>
        <if test="query.direction!=null">AND direction = #{query.direction}</if>
        <if test="query.identifierId!=null">AND identifier_id = #{query.identifierId}</if>
        <if test="query.creditAmount!=null">AND credit_amount = #{query.creditAmount}</if>
        <if test="query.acquisitionMethod!=null">AND acquisition_method = #{query.acquisitionMethod}</if>
        <if test="query.consumptionMethod!=null">AND consumption_method = #{query.consumptionMethod}</if>
        <if test="query.description!=null">AND description = #{query.description}</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_user_credit_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_user_credit_record where 1=1
        <include refid="listWhereSQL"/>
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from table_user_credit_record where id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.taoke.autopay.entity.credit.UserCreditRecord" useGeneratedKeys="true" keyProperty="id">insert into table_user_credit_record (id,uid,direction,identifier_id,credit_amount,acquisition_method,consumption_method,description,create_time,update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{direction,jdbcType=INTEGER},#{identifierId,jdbcType=VARCHAR},#{creditAmount,jdbcType=INTEGER},#{acquisitionMethod,jdbcType=VARCHAR},#{consumptionMethod,jdbcType=VARCHAR},#{description,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
    <insert id="insertSelective" parameterType="com.taoke.autopay.entity.credit.UserCreditRecord" useGeneratedKeys="true" keyProperty="id">insert into table_user_credit_record
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="uid != null">uid,</if>
            <if test="direction != null">direction,</if>
            <if test="identifierId != null">identifier_id,</if>
            <if test="creditAmount != null">credit_amount,</if>
            <if test="acquisitionMethod != null">acquisition_method,</if>
            <if test="consumptionMethod != null">consumption_method,</if>
            <if test="description != null">description,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
        </trim>values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
            <if test="direction != null">#{direction,jdbcType=INTEGER},</if>
            <if test="identifierId != null">#{identifierId,jdbcType=VARCHAR},</if>
            <if test="creditAmount != null">#{creditAmount,jdbcType=INTEGER},</if>
            <if test="acquisitionMethod != null">#{acquisitionMethod,jdbcType=VARCHAR},</if>
            <if test="consumptionMethod != null">#{consumptionMethod,jdbcType=VARCHAR},</if>
            <if test="description != null">#{description,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.taoke.autopay.entity.credit.UserCreditRecord">update table_user_credit_record set uid = #{uid,jdbcType=BIGINT},direction = #{direction,jdbcType=INTEGER},identifier_id = #{identifierId,jdbcType=VARCHAR},credit_amount = #{creditAmount,jdbcType=INTEGER},acquisition_method = #{acquisitionMethod,jdbcType=VARCHAR},consumption_method = #{consumptionMethod,jdbcType=VARCHAR},description = #{description,jdbcType=VARCHAR},create_time = #{createTime,jdbcType=TIMESTAMP},update_time = #{updateTime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=BIGINT}</update>
    <update id="updateByPrimaryKeySelective" parameterType="com.taoke.autopay.entity.credit.UserCreditRecord">update table_user_credit_record
        <set>
            <if test="uid != null">uid=#{uid,jdbcType=BIGINT},</if>
            <if test="direction != null">direction=#{direction,jdbcType=INTEGER},</if>
            <if test="identifierId != null">identifier_id=#{identifierId,jdbcType=VARCHAR},</if>
            <if test="creditAmount != null">credit_amount=#{creditAmount,jdbcType=INTEGER},</if>
            <if test="acquisitionMethod != null">acquisition_method=#{acquisitionMethod,jdbcType=VARCHAR},</if>
            <if test="consumptionMethod != null">consumption_method=#{consumptionMethod,jdbcType=VARCHAR},</if>
            <if test="description != null">description=#{description,jdbcType=VARCHAR},</if>
            <if test="createTime != null">create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set> where id = #{id,jdbcType=BIGINT}
    </update>
</mapper>