mappers.StreamHeartbeatEntityMapper.xml Maven / Gradle / Ivy
<?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.StreamHeartbeatEntityMapper"> <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.StreamHeartbeatEntity"> <id column="id" jdbcType="INTEGER" property="id"/> <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="inlong_stream_id" jdbcType="VARCHAR" property="inlongStreamId"/> <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"> id, component, instance, inlong_group_id, inlong_stream_id, status_heartbeat, metric_heartbeat, report_time, create_time, modify_time </sql> <insert id="insert" parameterType="org.apache.inlong.manager.dao.entity.StreamHeartbeatEntity"> insert into stream_heartbeat (component, instance, inlong_group_id, inlong_stream_id, status_heartbeat, metric_heartbeat, report_time, create_time) values (#{component,jdbcType=VARCHAR}, #{instance,jdbcType=VARCHAR}, #{inlongGroupId,jdbcType=VARCHAR}, #{inlongStreamId,jdbcType=VARCHAR}, #{statusHeartbeat,jdbcType=LONGVARCHAR}, #{metricHeartbeat,jdbcType=LONGVARCHAR}, #{reportTime,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}) </insert> <insert id="insertOrUpdateAll" parameterType="org.apache.inlong.manager.dao.entity.StreamHeartbeatEntity"> insert into stream_heartbeat (component, instance, inlong_group_id, inlong_stream_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.inlongStreamId,jdbcType=VARCHAR}, #{item.statusHeartbeat,jdbcType=LONGVARCHAR}, #{item.metricHeartbeat,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="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> from stream_heartbeat where id = #{id,jdbcType=INTEGER} </select> <select id="selectByKey" parameterType="java.lang.String" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> from stream_heartbeat where component = #{component,jdbcType=VARCHAR} and instance = #{instance,jdbcType=VARCHAR} and inlong_group_id = #{inlongGroupId,jdbcType=VARCHAR} and inlong_stream_id = #{inlongStreamId,jdbcType=VARCHAR} </select> <select id="selectByCondition" parameterType="org.apache.inlong.manager.common.pojo.heartbeat.HeartbeatPageRequest" resultType="org.apache.inlong.manager.dao.entity.StreamHeartbeatEntity"> select <include refid="Base_Column_List"/> from stream_heartbeat <where> component = #{request.component, jdbcType=VARCHAR} and inlong_group_id = #{request.inlongGroupId, jdbcType=VARCHAR} <if test="request.instance != null and request.instance != ''"> and instance = #{request.instance, jdbcType=VARCHAR} </if> <if test="request.inlongStreamId != null and request.inlongStreamId != ''"> and inlong_stream_id = #{request.inlongStreamId, jdbcType=VARCHAR} </if> order by modify_time desc </where> </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> delete from stream_heartbeat where id = #{id,jdbcType=INTEGER} </delete> </mapper>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy