admin
2020-05-19 744594ef1a2f530fc3e86ea9dc48b62247f79420
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?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.common.JumpDetailV2Mapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.common.JumpDetailV2">
        <id column="jp_id" property="id" jdbcType="BIGINT" />
        <result column="jp_name" property="name" jdbcType="VARCHAR" />
        <result column="jp_activity" property="activity" jdbcType="VARCHAR" />
        <result column="jp_controller" property="controller" jdbcType="VARCHAR" />
        <result column="jp_type" property="type" jdbcType="VARCHAR" />
        <result column="jp_need_login" property="needLogin" jdbcType="BOOLEAN" />
        <result column="jp_path" property="path" jdbcType="VARCHAR" />
        <result column="jp_min_android_version" property="minAndroidAppVersion"
            jdbcType="INTEGER" />
        <result column="jp_min_ios_version" property="minIOSAppVersion"
            jdbcType="INTEGER" />
    </resultMap>
    <sql id="Base_Column_List">jp_id,jp_name,jp_activity,jp_controller,jp_type,jp_need_login,jp_min_android_version,jp_min_ios_version,jp_path
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_action_jumpdetail_v2 where jp_id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_action_jumpdetail_v2 where jp_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_action_jumpdetail_v2
        (jp_id,jp_name,jp_activity,jp_controller,jp_type,jp_need_login,jp_min_android_version,jp_min_ios_version,jp_path)
        values
        (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{activity,jdbcType=VARCHAR},#{controller,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{needLogin,jdbcType=BOOLEAN},#{minAndroidAppVersion,jdbcType=INTEGER},#{minIOSAppVersion,jdbcType=INTEGER},#{path,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_action_jumpdetail_v2
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">jp_id,</if>
            <if test="name != null">jp_name,</if>
            <if test="activity != null">jp_activity,</if>
            <if test="controller != null">jp_controller,</if>
            <if test="type != null">jp_type,</if>
            <if test="needLogin != null">jp_need_login,</if>
            <if test="minAndroidAppVersion != null">jp_min_android_version,</if>
            <if test="minIOSAppVersion != null">jp_min_ios_version,</if>
            <if test="path != null">jp_path,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="name != null">#{name,jdbcType=VARCHAR},</if>
            <if test="activity != null">#{activity,jdbcType=VARCHAR},</if>
            <if test="controller != null">#{controller,jdbcType=VARCHAR},</if>
            <if test="type != null">#{type,jdbcType=VARCHAR},</if>
            <if test="needLogin != null">#{jp_need_login,jdbcType=BOOLEAN},</if>
            <if test="minAndroidAppVersion != null">#{minAndroidAppVersion,jdbcType=INTEGER}</if>
            <if test="minIOSAppVersion != null">#{minIOSAppVersion,jdbcType=INTEGER}</if>
            <if test="path != null">#{path,jdbcType=VARCHAR}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2">update
        yeshi_ec_action_jumpdetail_v2 set jp_name =
        #{name,jdbcType=VARCHAR},jp_activity =
        #{activity,jdbcType=VARCHAR},jp_controller =
        #{controller,jdbcType=VARCHAR},jp_type =
        #{type,jdbcType=VARCHAR},jp_need_login = #{needLogin,jdbcType=BOOLEAN}
        ,jp_min_android_version =#{minAndroidAppVersion,jdbcType=INTEGER}
        ,jp_min_ios_version =#{minIOSAppVersion,jdbcType=INTEGER} 
        ,jp_path =#{path,jdbcType=VARCHAR}
        
        where jp_id
        = #{id,jdbcType=BIGINT}</update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2">
        update yeshi_ec_action_jumpdetail_v2
        <set>
            <if test="name != null">jp_name=#{name,jdbcType=VARCHAR},</if>
            <if test="activity != null">jp_activity=#{activity,jdbcType=VARCHAR},</if>
            <if test="controller != null">jp_controller=#{controller,jdbcType=VARCHAR},</if>
            <if test="type != null">jp_type=#{type,jdbcType=VARCHAR},</if>
            <if test="needLogin != null">jp_need_login=#{needLogin,jdbcType=BOOLEAN},</if>
            <if test="minAndroidAppVersion !=null">jp_min_android_version
                =#{minAndroidAppVersion,jdbcType=INTEGER},</if>
            <if test="minIOSAppVersion !=null">jp_min_ios_version =#{minIOSAppVersion,jdbcType=INTEGER},
            </if>
            
            <if test="path !=null">jp_path =#{path,jdbcType=VARCHAR},
            </if>
        </set>
        where jp_id = #{id,jdbcType=BIGINT}
    </update>
    <select id="listByType" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_action_jumpdetail_v2 where jp_type =
        #{type,jdbcType=VARCHAR}
    </select>
    <select id="listJump" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_action_jumpdetail_v2
    </select>
    <select id="listQuery" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_action_jumpdetail_v2 WHERE 1=1
        <if test="key != null and key != &quot;&quot;">AND (jp_name like '%${key}%')</if>
        ORDER BY jp_id LIMIT ${start},${count}
    </select>
    <select id="countListQuery" resultType="java.lang.Long">
        SELECT IFNULL(count(jp_id),0) FROM yeshi_ec_action_jumpdetail_v2 WHERE
        1=1
        <if test="key != null and key != &quot;&quot;">AND (jp_name like '%${key}%')</if>
    </select>
 
 
    <select id="selectAndroidByTypeAndVersion" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_action_jumpdetail_v2 jv
        WHERE jv.`jp_type`=#{type} AND #{version}>=jv.`jp_min_android_version`
        ORDER BY jv.`jp_min_android_version` DESC LIMIT 1
    </select>
 
    <select id="selectIOSByTypeAndVersion" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_action_jumpdetail_v2 jv
        WHERE jv.`jp_type`=#{type} AND #{version}>=jv.`jp_min_ios_version` ORDER BY
        jv.`jp_min_ios_version` DESC LIMIT 1
    </select>
 
    <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_action_jumpdetail_v2 WHERE jp_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
</mapper>