All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mappers.AuditEntityMapper.xml Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
<?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.AuditEntityMapper">
    <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.AuditEntity">
        <result column="ip" jdbcType="VARCHAR" property="ip"/>
        <result column="docker_id" jdbcType="VARCHAR" property="dockerId"/>
        <result column="thread_id" jdbcType="VARCHAR" property="threadId"/>
        <result column="sdk_ts" jdbcType="TIMESTAMP" property="sdkTs"/>
        <result column="packet_id" jdbcType="BIGINT" property="packetId"/>
        <result column="log_ts" jdbcType="TIMESTAMP" property="logTs"/>
        <result column="inlong_group_id" jdbcType="VARCHAR" property="inlongGroupId"/>
        <result column="inlong_stream_id" jdbcType="VARCHAR" property="inlongStreamId"/>
        <result column="audit_id" jdbcType="VARCHAR" property="auditId"/>
        <result column="count" jdbcType="BIGINT" property="count"/>
        <result column="size" jdbcType="BIGINT" property="size"/>
        <result column="delay" jdbcType="BIGINT" property="delay"/>
    </resultMap>

    <resultMap id="SumByLogTsResultMap" type="java.util.Map">
        <result column="log_ts" property="logTs" jdbcType="VARCHAR"/>
        <result column="total" property="total" jdbcType="BIGINT"/>
    </resultMap>

    <select id="sumByLogTs" resultMap="SumByLogTsResultMap">
        select date_format(log_ts, #{format, jdbcType=VARCHAR}) as log_ts, sum(`count`) as total
        from apache_inlong_audit.audit_data
        where inlong_group_id = #{groupId,jdbcType=VARCHAR}
          and inlong_stream_id = #{streamId,jdbcType=VARCHAR}
          and audit_id = #{auditId,jdbcType=VARCHAR}
          and log_ts &gt;= #{sDate, jdbcType=VARCHAR}
          and log_ts &lt; #{eDate, jdbcType=VARCHAR}
        group by log_ts
        order by log_ts
    </select>
</mapper>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy