blob: 8328b66fa8759c8f593c5f5ee1cce4b64e1790e4 [file] [log] [blame]
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
You under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="org.apache.rocketmq.eventbridge.adapter.persistence.apidestination.mybatis.mapper.EventApiDestinationMapper" >
<resultMap id="BaseResultMap" type="org.apache.rocketmq.eventbridge.adapter.persistence.apidestination.mybatis.dataobject.ApiDestinationDO" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result column="account_id" property="accountId" jdbcType="VARCHAR" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="protocol" property="protocol" jdbcType="VARCHAR" />
<result column="connection_name" property="connectionName" jdbcType="VARCHAR" />
<result column="invocation_rate_limit_per_second" property="invocationRateLimitPerSecond" jdbcType="INTEGER" />
<result column="description" property="description" jdbcType="VARCHAR" />
<result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP" />
<result column="gmt_modify" property="gmtModify" jdbcType="TIMESTAMP" />
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="org.apache.rocketmq.eventbridge.adapter.persistence.apidestination.mybatis.dataobject.ApiDestinationDO" extends="BaseResultMap" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result column="api_params" property="apiParams" jdbcType="LONGVARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, account_id, name, protocol, connection_name, invocation_rate_limit_per_second, description,
gmt_create, gmt_modify
</sql>
<sql id="Blob_Column_List" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
api_params
</sql>
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from event_api_destination
where id = #{id,jdbcType=INTEGER}
</select>
<select id="listApiDestinations" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from event_api_destination
<where>
<if test="accountId != null and accountId != ''"> account_id = #{accountId}</if>
<if test="name != null and name != ''">and name like concat('%',#{name},'%')</if>
</where>
order by gmt_modify desc LIMIT #{nextToken} , #{maxResults}
</select>
<select id="selectByAccountIdAndName" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from event_api_destination
<where>
<if test="accountId != null and accountId != ''"> account_id = #{accountId}</if>
<if test="name != null and name != ''">and name = #{name}</if>
</where>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from event_api_destination
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="org.apache.rocketmq.eventbridge.adapter.persistence.apidestination.mybatis.dataobject.ApiDestinationDO" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into event_api_destination (id, name, protocol,
connection_name, invocation_rate_limit_per_second,
description, gmt_create, gmt_modify,
api_params)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR},
#{connectionName,jdbcType=VARCHAR}, #{invocationRateLimitPerSecond,jdbcType=INTEGER},
#{description,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModify,jdbcType=TIMESTAMP},
#{apiParams,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="org.apache.rocketmq.eventbridge.adapter.persistence.apidestination.mybatis.dataobject.ApiDestinationDO" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into event_api_destination
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="accountId != null" >
account_id,
</if>
<if test="name != null" >
name,
</if>
<if test="protocol != null" >
protocol,
</if>
<if test="connectionName != null" >
connection_name,
</if>
<if test="invocationRateLimitPerSecond != null" >
invocation_rate_limit_per_second,
</if>
<if test="description != null" >
description,
</if>
<if test="gmtCreate != null" >
gmt_create,
</if>
<if test="gmtModify != null" >
gmt_modify,
</if>
<if test="apiParams != null" >
api_params,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="accountId != null" >
#{accountId,jdbcType=VARCHAR},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="protocol != null" >
#{protocol,jdbcType=VARCHAR},
</if>
<if test="connectionName != null" >
#{connectionName,jdbcType=VARCHAR},
</if>
<if test="invocationRateLimitPerSecond != null" >
#{invocationRateLimitPerSecond,jdbcType=INTEGER},
</if>
<if test="description != null" >
#{description,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null" >
#{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModify != null" >
#{gmtModify,jdbcType=TIMESTAMP},
</if>
<if test="apiParams != null" >
#{apiParams,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="org.apache.rocketmq.eventbridge.adapter.persistence.apidestination.mybatis.dataobject.ApiDestinationDO" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update event_api_destination
<set >
<if test="accountId != null" >
account_id = #{accountId,jdbcType=VARCHAR},
</if>
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="protocol != null" >
protocol = #{protocol,jdbcType=VARCHAR},
</if>
<if test="connectionName != null" >
connection_name = #{connectionName,jdbcType=VARCHAR},
</if>
<if test="invocationRateLimitPerSecond != null" >
invocation_rate_limit_per_second = #{invocationRateLimitPerSecond,jdbcType=INTEGER},
</if>
<if test="description != null" >
description = #{description,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null" >
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModify != null" >
gmt_modify = #{gmtModify,jdbcType=TIMESTAMP},
</if>
<if test="apiParams != null" >
api_params = #{apiParams,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByNameAndAccountId" parameterType="org.apache.rocketmq.eventbridge.adapter.persistence.apidestination.mybatis.dataobject.ApiDestinationDO" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update event_api_destination
<set >
<if test="accountId != null" >
account_id = #{accountId,jdbcType=VARCHAR},
</if>
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="protocol != null" >
protocol = #{protocol,jdbcType=VARCHAR},
</if>
<if test="connectionName != null" >
connection_name = #{connectionName,jdbcType=VARCHAR},
</if>
<if test="invocationRateLimitPerSecond != null" >
invocation_rate_limit_per_second = #{invocationRateLimitPerSecond,jdbcType=INTEGER},
</if>
<if test="description != null" >
description = #{description,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null" >
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModify != null" >
gmt_modify = #{gmtModify,jdbcType=TIMESTAMP},
</if>
<if test="apiParams != null" >
api_params = #{apiParams,jdbcType=LONGVARCHAR},
</if>
</set>
where account_id = #{accountId} AND name = #{name}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="org.apache.rocketmq.eventbridge.adapter.persistence.apidestination.mybatis.dataobject.ApiDestinationDO" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update event_api_destination
set account_id = #{accountId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
protocol = #{protocol,jdbcType=VARCHAR},
connection_name = #{connectionName,jdbcType=VARCHAR},
invocation_rate_limit_per_second = #{invocationRateLimitPerSecond,jdbcType=INTEGER},
description = #{description,jdbcType=VARCHAR},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modify = #{gmtModify,jdbcType=TIMESTAMP},
api_params = #{apiParams,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="org.apache.rocketmq.eventbridge.adapter.persistence.apidestination.mybatis.dataobject.ApiDestinationDO" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update event_api_destination
set account_id = #{accountId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
protocol = #{protocol,jdbcType=VARCHAR},
connection_name = #{connectionName,jdbcType=VARCHAR},
invocation_rate_limit_per_second = #{invocationRateLimitPerSecond,jdbcType=INTEGER},
description = #{description,jdbcType=VARCHAR},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modify = #{gmtModify,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteByAccountIdAndName">
delete from event_api_destination
where account_id = #{accountId} AND name = #{name,jdbcType=VARCHAR}
</delete>
<select id="getApiDestinationCount" parameterType="java.util.Map" resultType="java.lang.Integer">
select
count(1)
from event_api_destination
<where>
<if test="accountId != null and accountId != ''"> account_id = #{accountId}</if>
</where>
</select>
</mapper>