mappers.GroupHeartbeatEntityMapper.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.GroupHeartbeatEntityMapper"> <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.GroupHeartbeatEntity"> <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="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, 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.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 group_heartbeat where id = #{id,jdbcType=INTEGER} </select> <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.common.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> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> delete from group_heartbeat where id = #{id,jdbcType=INTEGER} </delete> </mapper>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy