增加统计间隔

This commit is contained in:
zy 2025-11-19 11:04:12 +08:00
parent c5e158f273
commit 30fb0df4a3
4 changed files with 21 additions and 2 deletions

View File

@ -24,6 +24,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication @SpringBootApplication
@EnableScheduling @EnableScheduling
@MapperScan("org.jeecg.system.applet.mapper") @MapperScan("org.jeecg.system.applet.mapper")
@EnableFeignClients
public class ZhkjAppletCloudApplication implements CommandLineRunner { public class ZhkjAppletCloudApplication implements CommandLineRunner {
@Autowired @Autowired

View File

@ -74,6 +74,12 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- feign -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -0,0 +1,12 @@
package org.jeecg.system.applet.client;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@FeignClient(value = "zh-applet-admin")
public interface ZhAdminFeignClient {
@GetMapping("/inner/b/hello/{name}")
String callServiceB(@PathVariable("name") String name);
}

View File

@ -78,14 +78,14 @@
SELECT SELECT
DATE(ALERT_TIME) as date_part, DATE(ALERT_TIME) as date_part,
HOUR(ALERT_TIME) as hour_part, HOUR(ALERT_TIME) as hour_part,
FLOOR(MINUTE(ALERT_TIME) / 5) as minute_group, FLOOR(MINUTE(ALERT_TIME) / 15) as minute_group,
MIN(ALERT_TIME) as first_time_in_interval MIN(ALERT_TIME) as first_time_in_interval
FROM surv_alert_record FROM surv_alert_record
WHERE ALERT_TIME &gt;= #{startDateTime} AND ALERT_TIME &lt;= #{endDateTime} AND DEPLOY_ID = #{deployId} AND ITEM_CODE = #{itemCode} WHERE ALERT_TIME &gt;= #{startDateTime} AND ALERT_TIME &lt;= #{endDateTime} AND DEPLOY_ID = #{deployId} AND ITEM_CODE = #{itemCode}
GROUP BY date_part, hour_part, minute_group GROUP BY date_part, hour_part, minute_group
) t2 ON DATE(t1.ALERT_TIME) = t2.date_part ) t2 ON DATE(t1.ALERT_TIME) = t2.date_part
AND HOUR(t1.ALERT_TIME) = t2.hour_part AND HOUR(t1.ALERT_TIME) = t2.hour_part
AND FLOOR(MINUTE(t1.ALERT_TIME) / 5) = t2.minute_group AND FLOOR(MINUTE(t1.ALERT_TIME) / 15) = t2.minute_group
AND t1.ALERT_TIME = t2.first_time_in_interval AND t1.ALERT_TIME = t2.first_time_in_interval
) ad ON ad.ALERT_TIME >= ti.interval_start ) ad ON ad.ALERT_TIME >= ti.interval_start
AND ad.ALERT_TIME &lt; DATE_ADD(ti.interval_start, INTERVAL 5 MINUTE) AND ad.ALERT_TIME &lt; DATE_ADD(ti.interval_start, INTERVAL 5 MINUTE)