admin
2019-07-11 3824cbcaec6e6c67418d5280a53e9c2fedeef6f9
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.yeshi.fanli.dao.mybatis.user.UserAccountBindingHistoryMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory">
        <id column="uabh_id" property="id" jdbcType="BIGINT" />
        <result column="uabh_uid" property="uid" jdbcType="BIGINT" />
        <result column="uabh_type" property="type" jdbcType="INTEGER" />
        <result column="uabh_content" property="content" jdbcType="VARCHAR" />
        <result column="uabh_first" property="first" jdbcType="BOOLEAN" />
        <result column="uabh_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">uabh_id,uabh_uid,uabh_type,uabh_content,uabh_first,uabh_create_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_user_account_bind_history where uabh_id =
        #{id,jdbcType=BIGINT}
    </select>
 
 
    <select id="selectLatestByTypeAndUid" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_user_account_bind_history where uabh_uid =#{uid} and
        uabh_type=#{type} order by uabh_create_time desc limit 1
    </select>
 
 
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_user_account_bind_history where uabh_id =
        #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_user_account_bind_history
        (uabh_id,uabh_uid,uabh_type,uabh_content,uabh_first,uabh_create_time)
        values
        (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{type,jdbcType=INTEGER},#{content,jdbcType=VARCHAR},#{first,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_user_account_bind_history
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">uabh_id,</if>
            <if test="uid != null">uabh_uid,</if>
            <if test="type != null">uabh_type,</if>
            <if test="content != null">uabh_content,</if>
            <if test="first != null">uabh_first,</if>
            <if test="createTime != null">uabh_create_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="type != null">#{type,jdbcType=INTEGER},</if>
            <if test="content != null">#{content,jdbcType=VARCHAR},</if>
            <if test="first != null">#{first,jdbcType=BOOLEAN},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
        parameterType="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory">update yeshi_ec_user_account_bind_history set uabh_uid =
        #{uid,jdbcType=BIGINT},uabh_type =
        #{type,jdbcType=INTEGER},uabh_content =
        #{content,jdbcType=VARCHAR},uabh_first =
        #{first,jdbcType=BOOLEAN},uabh_create_time =
        #{createTime,jdbcType=TIMESTAMP} where uabh_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory">
        update yeshi_ec_user_account_bind_history
        <set>
            <if test="uid != null">uabh_uid=#{uid,jdbcType=BIGINT},</if>
            <if test="type != null">uabh_type=#{type,jdbcType=INTEGER},</if>
            <if test="content != null">uabh_content=#{content,jdbcType=VARCHAR},</if>
            <if test="first != null">uabh_first=#{first,jdbcType=BOOLEAN},</if>
            <if test="createTime != null">uabh_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
        </set>
        where uabh_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>