| | |
| | | logger.warn("BattRealDataPro_Thread Started ...");
|
| | |
|
| | | Date lastTime = new Date();
|
| | | Date lastdelTime = new Date();
|
| | | //线程启动前休眠60秒 //用于甄别还未通讯上的设备
|
| | | for(int i =0; i<60; i++) {
|
| | | try {
|
| | |
| | | /**********************************************************/
|
| | | nowTime = new Date();
|
| | | long timelong =(nowTime.getTime()-lastTime.getTime())/1000;
|
| | | long deltimelong =(nowTime.getTime()-lastdelTime.getTime())/1000;
|
| | | try {
|
| | | /**************** lijun add @ 20200906 ***************/
|
| | | //获取指定天数之前的时间
|
| | | Date critical = getDateBefore(nowTime, MaxRecordTimeLong);
|
| | | //删除修改时间超时的数据表
|
| | | BattRealDataPro_Thread_SQL.deleteHistoryData(con_pool, critical);
|
| | | //BattRealDataPro_Thread_SQL.deleteHistoryData(con_pool, critical);
|
| | | if(deltimelong > 60*60*24) {
|
| | | /**
|
| | | * 2021-08-25 @lijun 24小时定期检测删除指定天数之前的历史实时表,该查询占用SQL资源较大,减轻SQL查询负担
|
| | | */
|
| | | BattRealDataPro_Thread_SQL.deleteHistoryData(con_pool, critical);
|
| | | lastdelTime = nowTime;
|
| | | }
|
| | | /**********************************************************/
|
| | | if(timelong < MinRecordTimeLong) {
|
| | | continue;
|