增加统计间隔

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
@EnableScheduling
@MapperScan("org.jeecg.system.applet.mapper")
@EnableFeignClients
public class ZhkjAppletCloudApplication implements CommandLineRunner {
@Autowired

View File

@ -74,6 +74,12 @@
<scope>compile</scope>
</dependency>
<!-- feign -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
</dependencies>
</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
DATE(ALERT_TIME) as date_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
FROM surv_alert_record
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
) t2 ON DATE(t1.ALERT_TIME) = t2.date_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
) ad ON ad.ALERT_TIME >= ti.interval_start
AND ad.ALERT_TIME &lt; DATE_ADD(ti.interval_start, INTERVAL 5 MINUTE)