admin
2020-05-20 98b1a0affd69bbe63223c21fdd2c404e8bedfccb
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
<?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.DataMonitorMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.common.DataMonitor">
        <id column="md_id" property="id" jdbcType="BIGINT" />
        <result column="md_name" property="name" jdbcType="VARCHAR" />
        <result column="md_key" property="key" jdbcType="VARCHAR" />
        <result column="md_value" property="value" jdbcType="VARCHAR" />
        <result column="md_createtime" property="createTime" jdbcType="TIMESTAMP" />
        <result column="md_updatetime" property="updateTime" jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">md_id,md_name,md_key,md_value,md_createtime,md_updatetime
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_monitor_data where md_id = #{id,jdbcType=BIGINT}
    </select>
 
 
    <select id="selectByKey" resultMap="BaseResultMap"
        parameterType="java.lang.String">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_monitor_data where md_key = #{0} limit 1
    </select>
 
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_monitor_data where md_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.common.DataMonitor"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_monitor_data
        (md_id,md_name,md_key,md_value,md_createtime,md_updatetime) values
        (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{key,jdbcType=VARCHAR},#{value,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.common.DataMonitor"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_monitor_data
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">md_id,</if>
            <if test="name != null">md_name,</if>
            <if test="key != null">md_key,</if>
            <if test="value != null">md_value,</if>
            <if test="createTime != null">md_createtime,</if>
            <if test="updateTime != null">md_updatetime,</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="key != null">#{key,jdbcType=VARCHAR},</if>
            <if test="value != null">#{value,jdbcType=VARCHAR},</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.common.DataMonitor">update
        yeshi_ec_monitor_data set md_name = #{name,jdbcType=VARCHAR},md_key =
        #{key,jdbcType=VARCHAR},md_value =
        #{value,jdbcType=VARCHAR},md_createtime =
        #{createTime,jdbcType=TIMESTAMP},md_updatetime =
        #{updateTime,jdbcType=TIMESTAMP} where md_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.common.DataMonitor">
        update yeshi_ec_monitor_data
        <set>
            <if test="name != null">md_name=#{name,jdbcType=VARCHAR},</if>
            <if test="key != null">md_key=#{key,jdbcType=VARCHAR},</if>
            <if test="value != null">md_value=#{value,jdbcType=VARCHAR},</if>
            <if test="createTime != null">md_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">md_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where md_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>