admin
2019-01-03 f8545df1b8de09c4e0d663bf678a299d83d3077a
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
<?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.HongBaoV2Mapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.HongBaoV2">
        <id column="hb_id" property="id" jdbcType="BIGINT" />
        <result column="hb_urank" property="urank" jdbcType="INTEGER" />
        <result column="hb_money" property="money" jdbcType="DECIMAL" />
        <result column="hb_type" property="type" jdbcType="INTEGER" />
        <result column="hb_state" property="state" jdbcType="INTEGER" />
        <result column="hb_version" property="version" jdbcType="INTEGER" />
        <result column="hb_beizhu" property="beizhu" jdbcType="VARCHAR" />
        <result column="hb_pre_get_time" property="preGetTime"
            jdbcType="TIMESTAMP" />
        <result column="hb_get_time" property="getTime" jdbcType="TIMESTAMP" />
        <result column="hb_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="hb_update_time" property="updateTime" jdbcType="TIMESTAMP" />
 
        <association property="userInfo" column="hb_uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="hb_uid" property="id" jdbcType="BIGINT" />
        </association>
 
        <association property="parent" column="hb_pid"
            javaType="com.yeshi.fanli.entity.bus.user.HongBaoV2">
            <id column="hb_pid" property="id" jdbcType="BIGINT" />
        </association>
 
        <!-- <association property="userInfo" column="hb_uid" resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap"/> -->
    </resultMap>
    <sql id="Base_Column_List">hb_id,hb_uid,hb_urank,hb_pid,hb_money,hb_type,hb_state,hb_version,hb_beizhu,hb_pre_get_time,hb_get_time,hb_create_time,hb_update_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_hongbao_v2 where hb_id = #{id,jdbcType=BIGINT}
    </select>
    
    
    <select id="listChildrenById" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_hongbao_v2 where hb_pid = #{0}
    </select>
    
    
    
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_hongbao_v2 where hb_id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.HongBaoV2"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_hongbao_v2
        (hb_id,hb_uid,hb_urank,hb_pid,hb_money,hb_type,hb_state,hb_version,hb_beizhu,hb_pre_get_time,hb_get_time,hb_create_time,hb_update_time)
        values
        (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{urank,jdbcType=INTEGER},#{parent.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{type,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{version,jdbcType=INTEGER},#{beizhu,jdbcType=VARCHAR},#{preGetTime,jdbcType=TIMESTAMP},#{getTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.HongBaoV2"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_hongbao_v2
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">hb_id,</if>
            <if test="userInfo != null">hb_uid,</if>
            <if test="urank != null">hb_urank,</if>
            <if test="parent != null">hb_pid,</if>
            <if test="money != null">hb_money,</if>
            <if test="type != null">hb_type,</if>
            <if test="state != null">hb_state,</if>
            <if test="version != null">hb_version,</if>
            <if test="beizhu != null">hb_beizhu,</if>
            <if test="preGetTime != null">hb_pre_get_time,</if>
            <if test="getTime != null">hb_get_time,</if>
            <if test="createTime != null">hb_create_time,</if>
            <if test="updateTime != null">hb_update_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if>
            <if test="urank != null">#{urank,jdbcType=INTEGER},</if>
            <if test="parent != null">#{parent.id,jdbcType=BIGINT},</if>
            <if test="money != null">#{money,jdbcType=DECIMAL},</if>
            <if test="type != null">#{type,jdbcType=INTEGER},</if>
            <if test="state != null">#{state,jdbcType=INTEGER},</if>
            <if test="version != null">#{version,jdbcType=INTEGER},</if>
            <if test="beizhu != null">#{beizhu,jdbcType=VARCHAR},</if>
            <if test="preGetTime != null">#{preGetTime,jdbcType=TIMESTAMP},</if>
            <if test="getTime != null">#{getTime,jdbcType=TIMESTAMP},</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.bus.user.HongBaoV2">update
        yeshi_ec_hongbao_v2 set hb_uid =
        #{userInfo.id,jdbcType=BIGINT},hb_urank =
        #{urank,jdbcType=INTEGER},hb_pid =
        #{parent.id,jdbcType=BIGINT},hb_money =
        #{money,jdbcType=DECIMAL},hb_type = #{type,jdbcType=INTEGER},hb_state
        = #{state,jdbcType=INTEGER},hb_version =
        #{version,jdbcType=INTEGER},hb_beizhu =
        #{beizhu,jdbcType=VARCHAR},hb_pre_get_time =
        #{preGetTime,jdbcType=TIMESTAMP},hb_get_time =
        #{getTime,jdbcType=TIMESTAMP},hb_create_time =
        #{createTime,jdbcType=TIMESTAMP},hb_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where hb_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.HongBaoV2">
        update yeshi_ec_hongbao_v2
        <set>
            <if test="userInfo != null">hb_uid=#{userInfo.id,jdbcType=BIGINT},</if>
            <if test="urank != null">hb_urank=#{urank,jdbcType=INTEGER},</if>
            <if test="parent != null">hb_pid=#{parent.id,jdbcType=BIGINT},</if>
            <if test="money != null">hb_money=#{money,jdbcType=DECIMAL},</if>
            <if test="type != null">hb_type=#{type,jdbcType=INTEGER},</if>
            <if test="state != null">hb_state=#{state,jdbcType=INTEGER},</if>
            <if test="version != null">hb_version=#{version,jdbcType=INTEGER},</if>
            <if test="beizhu != null">hb_beizhu=#{beizhu,jdbcType=VARCHAR},</if>
            <if test="preGetTime != null">hb_pre_get_time=#{preGetTime,jdbcType=TIMESTAMP},</if>
            <if test="getTime != null">hb_get_time=#{getTime,jdbcType=TIMESTAMP},</if>
            <if test="createTime != null">hb_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">hb_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where hb_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>