admin
2020-05-20 98b1a0affd69bbe63223c21fdd2c404e8bedfccb
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
<?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.yeshi.fanli.dao.mybatis.integral.UserGetIntegralFromOrderRecordMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord">
        <id column="fo_id" property="id" jdbcType="BIGINT" />
        <result column="fo_event_type" property="eventType" jdbcType="INTEGER" />
        <result column="fo_uid" property="uid" jdbcType="BIGINT" />
        <result column="fo_order_no" property="orderNo" jdbcType="VARCHAR" />
        <result column="fo_order_source_type" property="orderSourceType"
            jdbcType="INTEGER" />
        <result column="fo_integral_count" property="integralCount"
            jdbcType="INTEGER" />
        <result column="fo_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="fo_update_time" property="updateTime" jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">fo_id,fo_event_type,fo_uid,fo_order_no,fo_order_source_type,fo_integral_count,fo_create_time,fo_update_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_integral_get_from_order where fo_id =
        #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_integral_get_from_order where fo_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_integral_get_from_order
        (fo_id,fo_event_type,fo_uid,fo_order_no,fo_order_source_type,fo_integral_count,fo_create_time,fo_update_time)
        values
        (#{id,jdbcType=BIGINT},#{eventType,jdbcType=INTEGER},#{uid,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{orderSourceType,jdbcType=INTEGER},#{integralCount,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_integral_get_from_order
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">fo_id,</if>
            <if test="eventType != null">fo_event_type,</if>
            <if test="uid != null">fo_uid,</if>
            <if test="orderNo != null">fo_order_no,</if>
            <if test="orderSourceType != null">fo_order_source_type,</if>
            <if test="integralCount != null">fo_integral_count,</if>
            <if test="createTime != null">fo_create_time,</if>
            <if test="updateTime != null">fo_update_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="eventType != null">#{eventType,jdbcType=INTEGER},</if>
            <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
            <if test="orderNo != null">#{orderNo,jdbcType=VARCHAR},</if>
            <if test="orderSourceType != null">#{orderSourceType,jdbcType=INTEGER},</if>
            <if test="integralCount != null">#{integralCount,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
        parameterType="com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord">update yeshi_ec_integral_get_from_order set
        fo_event_type = #{eventType,jdbcType=INTEGER},fo_uid =
        #{uid,jdbcType=BIGINT},fo_order_no =
        #{orderNo,jdbcType=VARCHAR},fo_order_source_type =
        #{orderSourceType,jdbcType=INTEGER},fo_integral_count =
        #{integralCount,jdbcType=INTEGER},fo_create_time =
        #{createTime,jdbcType=TIMESTAMP},fo_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where fo_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.integral.UserGetIntegralFromOrderRecord">
        update yeshi_ec_integral_get_from_order
        <set>
            <if test="eventType != null">fo_event_type=#{eventType,jdbcType=INTEGER},</if>
            <if test="uid != null">fo_uid=#{uid,jdbcType=BIGINT},</if>
            <if test="orderNo != null">fo_order_no=#{orderNo,jdbcType=VARCHAR},</if>
            <if test="orderSourceType != null">fo_order_source_type=#{orderSourceType,jdbcType=INTEGER},
            </if>
            <if test="integralCount != null">fo_integral_count=#{integralCount,jdbcType=INTEGER},</if>
            <if test="createTime != null">fo_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">fo_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where fo_id = #{id,jdbcType=BIGINT}
    </update>
 
 
 
    <select id="countByRecordInfo" resultType="java.lang.Long" useCache="false" flushCache="true">
        select
        count(*)
        from yeshi_ec_integral_get_from_order where 1=1
 
        <if test="record!=null">
            <if test="record.eventType!=null">
                and fo_event_type=#{record.eventType}
            </if>
 
            <if test="record.uid!=null">
                and fo_uid=#{record.uid}
            </if>
 
            <if test="record.orderNo!=null">
                and fo_order_no=#{record.orderNo}
            </if>
 
            <if test="record.orderSourceType!=null">
                and fo_order_source_type=#{record.orderSourceType}
            </if>
        </if>
    </select>
</mapper>