yujian
2019-10-29 9b55262bb45c81c997ab04e55e8de13e14b8ca7d
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
<?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.msg.UserMsgUnReadNumMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.bus.msg.UserMsgUnReadNum">
        <id column="mrs_id" property="id" jdbcType="BIGINT" />
        <result column="mrs_type_order" property="typeOrder" jdbcType="INTEGER" />
        <result column="mrs_type_money" property="typeMoney" jdbcType="INTEGER" />
        <result column="mrs_type_account" property="typeAccount"
            jdbcType="INTEGER" />
        <result column="mrs_type_invite" property="typeInvite"
            jdbcType="INTEGER" />
        <result column="mrs_type_score" property="typeScore" jdbcType="INTEGER" />
        <result column="mrs_type_system" property="typeSystem"
            jdbcType="INTEGER" />
        <result column="mrs_type_other" property="typeOther" jdbcType="INTEGER" />
        <result column="mrs_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
        <result column="mrs_update_time" property="updateTime"
            jdbcType="TIMESTAMP" />
        <result column="mrs_type_guanxuan_read_time" property="guanXuanReadTime"
            jdbcType="TIMESTAMP" />
        <association property="user" column="mrs_uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="mrs_uid" property="id" jdbcType="BIGINT" />
        </association>
 
    </resultMap>
    <sql id="Base_Column_List">mrs_id,mrs_uid,mrs_type_order,mrs_type_money,mrs_type_account,mrs_type_invite,mrs_type_score,mrs_type_system,mrs_type_other,mrs_create_time,mrs_update_time,mrs_type_guanxuan_read_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_msg_read_state where mrs_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByUid" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_msg_read_state where mrs_uid = #{uid,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_msg_read_state where mrs_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.msg.UserMsgUnReadNum"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_msg_read_state
        (mrs_id,mrs_uid,mrs_type_order,mrs_type_money,mrs_type_account,mrs_type_invite,mrs_type_score,mrs_type_system,mrs_type_other,mrs_create_time,mrs_update_time,mrs_type_zhushou_read_time,mrs_type_guanxuan_read_time,mrs_type_recommend_read_time)
        values
        (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{typeOrder,jdbcType=INTEGER},#{typeMoney,jdbcType=INTEGER},#{typeAccount,jdbcType=INTEGER},#{typeInvite,jdbcType=INTEGER},#{typeScore,jdbcType=INTEGER},#{typeSystem,jdbcType=INTEGER},#{typeOther,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{guanXuanReadTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.UserMsgUnReadNum"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_msg_read_state
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">mrs_id,</if>
            <if test="user != null">mrs_uid,</if>
            <if test="typeOrder != null">mrs_type_order,</if>
            <if test="typeMoney != null">mrs_type_money,</if>
            <if test="typeAccount != null">mrs_type_account,</if>
            <if test="typeInvite != null">mrs_type_invite,</if>
            <if test="typeScore != null">mrs_type_score,</if>
            <if test="typeSystem != null">mrs_type_system,</if>
            <if test="typeOther != null">mrs_type_other,</if>
            <if test="createTime != null">mrs_create_time,</if>
            <if test="updateTime != null">mrs_update_time,</if>
            <if test="guanXuanReadTime != null">mrs_type_guanxuan_read_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="user != null">#{user.id,jdbcType=BIGINT},</if>
            <if test="typeOrder != null">#{typeOrder,jdbcType=INTEGER},</if>
            <if test="typeMoney != null">#{typeMoney,jdbcType=INTEGER},</if>
            <if test="typeAccount != null">#{typeAccount,jdbcType=INTEGER},</if>
            <if test="typeInvite != null">#{typeInvite,jdbcType=INTEGER},</if>
            <if test="typeScore != null">#{typeScore,jdbcType=INTEGER},</if>
            <if test="typeSystem != null">#{typeSystem,jdbcType=INTEGER},</if>
            <if test="typeOther != null">#{typeOther,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="guanXuanReadTime != null">#{guanXuanReadTime,jdbcType=TIMESTAMP}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.UserMsgUnReadNum">update
        yeshi_ec_msg_read_state set mrs_uid =
        #{user.id,jdbcType=BIGINT},mrs_type_order =
        #{typeOrder,jdbcType=INTEGER},mrs_type_money =
        #{typeMoney,jdbcType=INTEGER},mrs_type_account =
        #{typeAccount,jdbcType=INTEGER},mrs_type_invite =
        #{typeInvite,jdbcType=INTEGER},mrs_type_score =
        #{typeScore,jdbcType=INTEGER},mrs_type_system =
        #{typeSystem,jdbcType=INTEGER},mrs_type_other =
        #{typeOther,jdbcType=INTEGER},mrs_create_time =
        #{createTime,jdbcType=TIMESTAMP},mrs_update_time =
        #{updateTime,jdbcType=TIMESTAMP} ,mrs_type_guanxuan_read_time
        =#{guanXuanReadTime,jdbcType=TIMESTAMP} where mrs_id =
        #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.msg.UserMsgUnReadNum">
        update yeshi_ec_msg_read_state
        <set>
            <if test="user != null">mrs_uid=#{user.id,jdbcType=BIGINT},</if>
            <if test="typeOrder != null">mrs_type_order=#{typeOrder,jdbcType=INTEGER},</if>
            <if test="typeMoney != null">mrs_type_money=#{typeMoney,jdbcType=INTEGER},</if>
            <if test="typeAccount != null">mrs_type_account=#{typeAccount,jdbcType=INTEGER},</if>
            <if test="typeInvite != null">mrs_type_invite=#{typeInvite,jdbcType=INTEGER},</if>
            <if test="typeScore != null">mrs_type_score=#{typeScore,jdbcType=INTEGER},</if>
            <if test="typeSystem != null">mrs_type_system=#{typeSystem,jdbcType=INTEGER},</if>
            <if test="typeOther != null">mrs_type_other=#{typeOther,jdbcType=INTEGER},</if>
            <if test="createTime != null">mrs_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">mrs_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="id !=null">mrs_id =#{id,jdbcType=BIGINT},</if>
    
            <if test="guanXuanReadTime !=null">mrs_type_guanxuan_read_time
                =#{guanXuanReadTime,jdbcType=TIMESTAMP},
            </if>
        </set>
        where mrs_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>