Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.inlong.manager.dao.mapper.GroupHeartbeatEntityMapper">
<resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.GroupHeartbeatEntity">
<result column="component" jdbcType="VARCHAR" property="component"/>
<result column="instance" jdbcType="VARCHAR" property="instance"/>
<result column="inlong_group_id" jdbcType="VARCHAR" property="inlongGroupId"/>
<result column="status_heartbeat" jdbcType="LONGVARCHAR" property="statusHeartbeat"/>
<result column="metric_heartbeat" jdbcType="LONGVARCHAR" property="metricHeartbeat"/>
<result column="report_time" jdbcType="BIGINT" property="reportTime"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
</resultMap>
<sql id="Base_Column_List">
component, instance, inlong_group_id, status_heartbeat, metric_heartbeat,
report_time, create_time, modify_time
</sql>
<insert id="insert" parameterType="org.apache.inlong.manager.dao.entity.GroupHeartbeatEntity">
insert into group_heartbeat (component, instance,
inlong_group_id, status_heartbeat,
metric_heartbeat, report_time)
values (#{component,jdbcType=VARCHAR}, #{instance,jdbcType=VARCHAR},
#{inlongGroupId,jdbcType=VARCHAR}, #{statusHeartbeat,jdbcType=LONGVARCHAR},
#{metricHeartbeat,jdbcType=LONGVARCHAR}, #{reportTime,jdbcType=BIGINT})
</insert>
<insert id="insertOrUpdateAll" parameterType="java.util.List">
insert into group_heartbeat (component, instance,
inlong_group_id, status_heartbeat,
metric_heartbeat, report_time)
values
<foreach collection="list" index="index" item="item" open="" close="" separator=",">
(#{component,jdbcType=VARCHAR}, #{instance,jdbcType=VARCHAR},
#{item.inlongGroupId,jdbcType=VARCHAR}, #{item.status,jdbcType=LONGVARCHAR},
#{item.metric,jdbcType=LONGVARCHAR}, #{reportTime,jdbcType=BIGINT})
</foreach>
ON DUPLICATE KEY UPDATE
status_heartbeat = values(status_heartbeat),
metric_heartbeat = values(metric_heartbeat),
report_time = values(report_time)
</insert>
<select id="selectByKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from group_heartbeat
where component = #{component,jdbcType=VARCHAR}
and instance = #{instance,jdbcType=VARCHAR}
and inlong_group_id = #{inlongGroupId,jdbcType=VARCHAR}
</select>
<select id="selectByCondition"
parameterType="org.apache.inlong.manager.pojo.heartbeat.HeartbeatPageRequest"
resultType="org.apache.inlong.manager.dao.entity.GroupHeartbeatEntity">
select
<include refid="Base_Column_List"/>
from group_heartbeat
<where>
component = #{request.component, jdbcType=VARCHAR}
<if test="request.inlongGroupId != null and request.inlongGroupId != ''">
and inlong_group_id = #{request.inlongGroupId, jdbcType=VARCHAR}
</if>
<if test="request.instance != null and request.instance != ''">
and instance = #{request.instance, jdbcType=VARCHAR}
</if>
order by modify_time desc
</where>
</select>
</mapper>