GatewayConfigDao.xml 2.3 KB
Newer Older
Z
zengqiao 已提交
1 2 3 4 5 6 7 8 9 10
<?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="GatewayConfigDao">
    <resultMap id="GatewayConfigMap" type="com.xiaojukeji.kafka.manager.common.entity.pojo.gateway.GatewayConfigDO">
        <id column="id"                 property="id" />
        <result column="type"           property="type" />
        <result column="name"           property="name" />
        <result column="value"          property="value" />
        <result column="version"        property="version" />
Z
zengqiao 已提交
11
        <result column="description"    property="description" />
Z
zengqiao 已提交
12 13 14 15 16 17 18 19 20 21 22
        <result column="create_time"    property="createTime" />
        <result column="modify_time"    property="modifyTime" />
    </resultMap>

    <select id="getByConfigType" parameterType="java.lang.String" resultMap="GatewayConfigMap">
        SELECT * FROM gateway_config WHERE `type`=#{configType}
    </select>

    <select id="getByConfigTypeAndName" parameterType="java.util.Map" resultMap="GatewayConfigMap">
        SELECT * FROM gateway_config WHERE `type`=#{configType} AND `name`=#{configName}
    </select>
Z
zengqiao 已提交
23 24 25 26 27 28 29 30

    <select id="list" resultMap="GatewayConfigMap">
        SELECT * FROM gateway_config
    </select>

    <insert id="insert" parameterType="com.xiaojukeji.kafka.manager.common.entity.pojo.gateway.GatewayConfigDO">
        <![CDATA[
        INSERT INTO gateway_config
Z
zengqiao 已提交
31
        (`type`, name, value, version, description)
Z
zengqiao 已提交
32
        VALUES
Z
zengqiao 已提交
33
        (#{type}, #{name}, #{value}, #{version}, #{description})
Z
zengqiao 已提交
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
        ]]>
    </insert>

    <delete id="deleteById" parameterType="java.lang.Long">
        <![CDATA[
        DELETE FROM gateway_config WHERE id=#{id}
        ]]>
    </delete>

    <update id="updateById" parameterType="com.xiaojukeji.kafka.manager.common.entity.pojo.gateway.GatewayConfigDO">
        <![CDATA[
        UPDATE gateway_config SET
            `type`=#{type},
            `name`=#{name},
            `value`=#{value},
Z
zengqiao 已提交
49 50
            `version`=#{version},
            `description`=#{description}
Z
zengqiao 已提交
51 52 53 54 55 56 57
        WHERE id=#{id}
        ]]>
    </update>

    <select id="getById" parameterType="java.lang.Long" resultMap="GatewayConfigMap">
        SELECT * FROM gateway_config WHERE id=#{id}
    </select>
Z
zengqiao 已提交
58
</mapper>