admin
2019-07-09 531d93708df8017e59830f15b41f3cc42d6126e6
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
<?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.push.DeviceActiveMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.push.DeviceActive">
        <id column="da_id" property="id" jdbcType="BIGINT" />
        <result column="da_platform" property="platform" jdbcType="INTEGER" />
        <result column="da_device" property="device" jdbcType="VARCHAR" />
        <result column="da_device_token_md5" property="deviceTokenMd5"
            jdbcType="VARCHAR" />
        <result column="da_device_token" property="deviceToken"
            jdbcType="VARCHAR" />
        <result column="da_version_code" property="versionCode"
            jdbcType="INTEGER" />
        <result column="da_createtime" property="createTime" jdbcType="TIMESTAMP" />
        <result column="da_updatetime" property="updateTime" jdbcType="TIMESTAMP" />
        <result column="da_ip" property="ipInfo" jdbcType="VARCHAR" />
    </resultMap>
    <sql id="Base_Column_List">da_id,da_platform,da_device,da_device_token_md5,da_device_token,da_version_code,da_createtime,da_updatetime,da_ip
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_device_active where da_id = #{id,jdbcType=BIGINT}
    </select>
 
 
    <select id="selectByDeviceAndPlatform" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_device_active where da_device = #{device} and
        da_platform=#{platform} order by da_id desc  limit 1
    </select>
 
    <select id="selectByDeviceToeknMd5AndPlatform" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_device_active where da_device_token_md5 =
        #{deviceTokenMd5} and da_platform=#{platform}
    </select>
    
    
    <select id="selectFirst" resultMap="BaseResultMap" parameterType="java.lang.String">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_device_active where da_device =
        #{0} order by da_id limit 1
    </select>
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_device_active where da_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.push.DeviceActive"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_device_active
        (da_id,da_platform,da_device,da_device_token_md5,da_device_token,da_version_code,da_createtime,da_updatetime,da_ip)
        values
        (#{id,jdbcType=BIGINT},#{platform,jdbcType=INTEGER},#{device,jdbcType=VARCHAR},#{deviceTokenMd5,jdbcType=VARCHAR},#{deviceToken,jdbcType=VARCHAR},#{versionCode,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{ipInfo,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.push.DeviceActive"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_device_active
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">da_id,</if>
            <if test="platform != null">da_platform,</if>
            <if test="device != null">da_device,</if>
            <if test="deviceTokenMd5 != null">da_device_token_md5,</if>
            <if test="deviceToken != null">da_device_token,</if>
            <if test="versionCode != null">da_version_code,</if>
            <if test="createTime != null">da_createtime,</if>
            <if test="updateTime != null">da_updatetime,</if>
            <if test="ipInfo != null">da_ip,</if>
 
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="platform != null">#{platform,jdbcType=INTEGER},</if>
            <if test="device != null">#{device,jdbcType=VARCHAR},</if>
            <if test="deviceTokenMd5 != null">#{deviceTokenMd5,jdbcType=VARCHAR},</if>
            <if test="deviceToken != null">#{deviceToken,jdbcType=VARCHAR},</if>
            <if test="versionCode != null">#{versionCode,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="ipInfo != null">#{ipInfo,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.push.DeviceActive">update
        yeshi_ec_device_active set da_platform =
        #{platform,jdbcType=INTEGER},da_device =
        #{device,jdbcType=VARCHAR},da_device_token_md5 =
        #{deviceTokenMd5,jdbcType=VARCHAR},da_device_token =
        #{deviceToken,jdbcType=VARCHAR},da_version_code =
        #{versionCode,jdbcType=INTEGER},da_createtime =
        #{createTime,jdbcType=TIMESTAMP},da_updatetime =
        #{updateTime,jdbcType=TIMESTAMP},da_ip =
        #{ipInfo,jdbcType=VARCHAR}
        where da_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.push.DeviceActive">
        update yeshi_ec_device_active
        <set>
            <if test="platform != null">da_platform=#{platform,jdbcType=INTEGER},</if>
            <if test="device != null">da_device=#{device,jdbcType=VARCHAR},</if>
            <if test="deviceTokenMd5 != null">da_device_token_md5=#{deviceTokenMd5,jdbcType=VARCHAR},
            </if>
            <if test="deviceToken != null">da_device_token=#{deviceToken,jdbcType=VARCHAR},</if>
            <if test="versionCode != null">da_version_code=#{versionCode,jdbcType=INTEGER},</if>
            <if test="createTime != null">da_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">da_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="ipInfo != null">da_ip=#{ipInfo,jdbcType=VARCHAR},</if>
        </set>
        where da_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>