Merge remote-tracking branch 'origin/main'

This commit is contained in:
zhanghan11 2024-04-10 15:51:01 +08:00
commit bdccb4b596
2 changed files with 28 additions and 0 deletions

View File

@ -34,6 +34,10 @@
<groupId>com.inspur</groupId> <groupId>com.inspur</groupId>
<artifactId>tzipc-common</artifactId> <artifactId>tzipc-common</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.inspur</groupId>
<artifactId>tzipc-system</artifactId>
</dependency>
</dependencies> </dependencies>

View File

@ -0,0 +1,24 @@
package com.inspur.quartz.task;
import com.inspur.common.utils.spring.SpringUtils;
import com.inspur.ipc.utils.IpcConstant;
import com.inspur.system.service.influx.InfluxDBService;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
@Component("expDataDeletionTask")
public class ExpDataDeletionTask {
public void deleteExpDataByDate(Integer params)
{
System.out.println("执行有参方法:" + params);
InfluxDBService i = SpringUtils.getBean(InfluxDBService.class);
StringBuffer sql1 = new StringBuffer("");
StringBuffer sql2 = new StringBuffer("");
sql1.append("SELECT * FROM ").append(IpcConstant.PLC_MEASUREMENT).append(" where isAlarm = '0' and time < '").append(LocalDate.now().toString()).append("T00:00:00Z' -8h -").append(params.toString()).append("d");
sql2.append("SELECT * FROM ").append(IpcConstant.SENSOR_MEASUREMENT).append(" where isAlarm = '0' and time < '").append(LocalDate.now().toString()).append("T00:00:00Z' -8h -").append(params.toString()).append("d");
i.query(sql1.toString());
i.query(sql2.toString());
}
}