2024-07-08 17:47:02 +08:00
|
|
|
package com.gunshi.project.xyt.service;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
2024-07-22 11:31:08 +08:00
|
|
|
import com.gunshi.project.xyt.entity.vo.GateStautsVo;
|
2024-07-08 17:47:02 +08:00
|
|
|
import com.gunshi.project.xyt.mapper.GateValveRealMapper;
|
|
|
|
|
import com.gunshi.project.xyt.model.GateValveReal;
|
2024-07-22 11:31:08 +08:00
|
|
|
import com.gunshi.project.xyt.util.DateUtil;
|
2024-07-08 17:47:02 +08:00
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import java.util.Date;
|
2024-07-22 11:31:08 +08:00
|
|
|
import java.util.List;
|
2024-07-08 17:47:02 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 描述: 闸阀开关表
|
|
|
|
|
* author: xusan
|
|
|
|
|
* date: 2024-07-08 17:30:37
|
|
|
|
|
*/
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public class GateValveRealService extends ServiceImpl<GateValveRealMapper, GateValveReal>
|
|
|
|
|
{
|
|
|
|
|
|
2024-07-22 11:31:08 +08:00
|
|
|
public List<GateStautsVo> gateStatusList() {
|
|
|
|
|
List<GateStautsVo> list = baseMapper.gateStatusList();
|
|
|
|
|
for(GateStautsVo vo : list){
|
|
|
|
|
if(vo.getTm() != null && DateUtil.hoursBetweenDate(vo.getTm(), new Date()) > 2){
|
|
|
|
|
vo.setFlag(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
|
}
|
2024-07-08 17:47:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|