Administrator
2018-10-30 c0c91fbda1ba601c4c8cb6d12fd43dfbe02eea5d
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
<?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.customerservice.CustomerServiceCommonQuestionMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.customerservice.CustomerServiceCommonQuestion">
        <id column="cscq_id" property="id" jdbcType="BIGINT" />
        <result column="cscq_key" property="key" jdbcType="VARCHAR" />
        <result column="cscq_content" property="content" jdbcType="VARCHAR" />
        <result column="cscq_content_type" property="contentType"
            jdbcType="VARCHAR" />
        <result column="cscq_weight" property="weight" jdbcType="INTEGER" />
        <result column="cscq_createtime" property="createTime"
            jdbcType="TIMESTAMP" />
        <result column="cscq_updatetime" property="updateTime"
            jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">cscq_id,cscq_key,cscq_content,cscq_content_type,cscq_weight,cscq_createtime,cscq_updatetime
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_customer_service_common_question where cscq_id =
        #{id,jdbcType=BIGINT}
    </select>
 
 
    <select id="selectByKey" resultMap="BaseResultMap"
        parameterType="java.lang.String">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_customer_service_common_question where cscq_key like
        '%${key}%'
    </select>
 
 
    <select id="selectOrderByUpdateTime" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_customer_service_common_question order by
        cscq_updatetime desc limit #{start},#{count}
    </select>
 
 
    <select id="selectCount" resultType="java.lang.Long">
        select
        count(cscq_id)
        from
        yeshi_ec_customer_service_common_question
    </select>
 
    <select id="selectKeys" resultType="java.lang.String">
        select
        cscq_key
        from
        yeshi_ec_customer_service_common_question order by cscq_weight desc
    </select>
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_customer_service_common_question where cscq_id =
        #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.customerservice.CustomerServiceCommonQuestion"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_customer_service_common_question
        (cscq_id,cscq_key,cscq_content,cscq_content_type,cscq_weight,cscq_createtime,cscq_updatetime)
        values
        (#{id,jdbcType=BIGINT},#{key,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{contentType,jdbcType=VARCHAR},#{weight,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.customerservice.CustomerServiceCommonQuestion"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_customer_service_common_question
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">cscq_id,</if>
            <if test="key != null">cscq_key,</if>
            <if test="content != null">cscq_content,</if>
            <if test="contentType != null">cscq_content_type,</if>
            <if test="weight != null">cscq_weight,</if>
            <if test="createTime != null">cscq_createtime,</if>
            <if test="updateTime != null">cscq_updatetime,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="key != null">#{key,jdbcType=VARCHAR},</if>
            <if test="content != null">#{content,jdbcType=VARCHAR},</if>
            <if test="contentType != null">#{contentType,jdbcType=VARCHAR},</if>
            <if test="weight != null">#{weight,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
        parameterType="com.yeshi.fanli.entity.customerservice.CustomerServiceCommonQuestion">update yeshi_ec_customer_service_common_question set
        cscq_key = #{key,jdbcType=VARCHAR},cscq_content =
        #{content,jdbcType=VARCHAR},cscq_content_type =
        #{contentType,jdbcType=VARCHAR},cscq_weight =
        #{weight,jdbcType=INTEGER},cscq_createtime =
        #{createTime,jdbcType=TIMESTAMP},cscq_updatetime =
        #{updateTime,jdbcType=TIMESTAMP} where cscq_id =
        #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.customerservice.CustomerServiceCommonQuestion">
        update yeshi_ec_customer_service_common_question
        <set>
            <if test="key != null">cscq_key=#{key,jdbcType=VARCHAR},</if>
            <if test="content != null">cscq_content=#{content,jdbcType=VARCHAR},</if>
            <if test="contentType != null">cscq_content_type=#{contentType,jdbcType=VARCHAR},</if>
            <if test="weight != null">cscq_weight=#{weight,jdbcType=INTEGER},</if>
            <if test="createTime != null">cscq_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">cscq_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where cscq_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>