admin
2020-05-06 24a8d17e007545f7426c48352109aa1a9c6587ee
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
<?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.elme.ElmeHongBaoOrderMapMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.elme.ElmeHongBaoOrderMap">
        <id column="eoh_id" property="id" jdbcType="BIGINT" />
        <result column="eoh_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
        <association property="elmeOrder" column="eoh_order_id"
            javaType="com.yeshi.fanli.entity.elme.ElmeOrder"
            select="com.yeshi.fanli.dao.mybatis.elme.ElmeOrderMapper.selectByPrimaryKey">
        </association>
        <association property="hongBao" column="eoh_hongbao_id"
            javaType="com.yeshi.fanli.entity.bus.user.HongBaoV2"
            select="com.yeshi.fanli.dao.mybatis.HongBaoV2Mapper.selectByPrimaryKey">
        </association>
 
    </resultMap>
    <sql id="Base_Column_List">eoh_id,eoh_order_id,eoh_hongbao_id,eoh_create_time</sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_elme_order_hongbao where eoh_id = #{id,jdbcType=BIGINT}
    </select>
 
 
    <select id="selectByHongBaoId" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_elme_order_hongbao where eoh_hongbao_id = #{0}
    </select>
 
    <select id="selectByOrderId" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_elme_order_hongbao where eoh_order_id = #{0}
    </select>
 
 
    <select id="listByHongBaoUid" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_elme_order_hongbao left join yeshi_ec_hongbao_v2 v on
        v.hb_id=eoh_hongbao_id where v.hb_uid = #{uid} order by eoh_id desc limit #{start},#{count}
    </select>
 
 
    <select id="countByHongBaoUid" resultType="java.lang.Long"
        parameterType="java.lang.Long">
        select
        count(eoh_id)
        from yeshi_ec_elme_order_hongbao left
        join yeshi_ec_hongbao_v2 v on
        v.hb_id=eoh_hongbao_id where v.hb_uid =
        #{0}
    </select>
 
 
 
 
 
 
 
 
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_elme_order_hongbao where eoh_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.elme.ElmeHongBaoOrderMap"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_elme_order_hongbao
        (eoh_id,eoh_order_id,eoh_hongbao_id,eoh_create_time) values
        (#{id,jdbcType=BIGINT},#{elmeOrder.id,jdbcType=BIGINT},#{hongBao.id,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.elme.ElmeHongBaoOrderMap"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_elme_order_hongbao
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">eoh_id,</if>
            <if test="elmeOrder != null">eoh_order_id,</if>
            <if test="hongBao != null">eoh_hongbao_id,</if>
            <if test="createTime != null">eoh_create_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="elmeOrder != null">#{elmeOrder.id,jdbcType=BIGINT},</if>
            <if test="hongBao != null">#{hongBao.id,jdbcType=BIGINT},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.elme.ElmeHongBaoOrderMap">update
        yeshi_ec_elme_order_hongbao set eoh_order_id =
        #{elmeOrder.id,jdbcType=BIGINT},eoh_hongbao_id =
        #{hongBao.id,jdbcType=BIGINT},eoh_create_time =
        #{createTime,jdbcType=TIMESTAMP} where eoh_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.elme.ElmeHongBaoOrderMap">
        update yeshi_ec_elme_order_hongbao
        <set>
            <if test="elmeOrder != null">eoh_order_id=#{elmeOrder.id,jdbcType=BIGINT},</if>
            <if test="hongBao != null">eoh_hongbao_id=#{hongBao.id,jdbcType=BIGINT},</if>
            <if test="createTime != null">eoh_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
        </set>
        where eoh_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>