Commit 9516c52c by 杨林龙

解决首页统计问题

1 parent 72bc76a6
......@@ -11,7 +11,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -231,7 +230,7 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
* @return
*/
@DataPerm(showSql = true)
Integer getOffLineAlarmCount(@Param("lostBegin") Date lostBegin);
Integer getOffLineAlarmCount(@Param("lostBegin") String lostBegin);
Vehicle selectByOrderId(@Param("workOrderId") Long workOrderId);
......
......@@ -135,7 +135,8 @@ public class HomeService {
returnMap.put("powerOffAlarmCount", powerOffAlarmCount);
// 统计设备离线报警
Date lostBegin = DateUtils.addHours(new Date(), -72);
String lostBegin = DateUtil.formatDateYmd(DateUtils.addHours(new Date(), -72));
log.info("lostBegin===" + lostBegin);
Integer offLineAlarmCount = vehicleMapper.getOffLineAlarmCount(lostBegin);
returnMap.put("offLineAlarmCount", offLineAlarmCount);
......
package cn.com.glsx.test;
import cn.com.glsx.admin.modules.utils.DateUtil;
import com.glsx.plat.common.utils.DateUtils;
import java.util.Date;
public class UtilsTest {
......@@ -7,5 +10,8 @@ public class UtilsTest {
public static void main(String[] args) {
Date date = new Date();
System.out.println("date = " + date.getHours());
String lostBegin = DateUtil.formatDateYmd(DateUtils.addHours(new Date(), -72));
System.out.println("lostBegin = " + lostBegin);
}
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!