/*
* Copyright (c) 京北方信息技术股份有限公司 Corporation 2022 . All rights reserved.
*
*/
package net.northking.cctp.device.db.impl;

import net.northking.cctp.device.db.dao.CdDeviceStatusDao;
import net.northking.cctp.device.db.service.CdDeviceStatusService;
import net.northking.cctp.device.db.entity.CdDeviceStatus;

import net.northking.cctp.common.db.BasicDao;
import net.northking.cctp.common.db.PaginationService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;


/**
 * 设备状态信息表
 *
 * <p>文件内容由代码生成器产生，请不要手动修改！ <br>
 * createdate:  2022-09-21 14:45:06  <br>
 * @author:  maven-cctp-plugin  <br>
 * @since:  1.0 <br>
 */
@Service
@ConditionalOnMissingBean(name = "CdDeviceStatusServiceImpl")
public class CdDeviceStatusServiceImpl extends PaginationService<CdDeviceStatus> implements CdDeviceStatusService
{
private static final Logger logger = LoggerFactory.getLogger(CdDeviceStatusServiceImpl.class);

  private final CdDeviceStatusDao cdDeviceStatusDao;

  public CdDeviceStatusServiceImpl(CdDeviceStatusDao cdDeviceStatusDao) {this.cdDeviceStatusDao = cdDeviceStatusDao;}

  public BasicDao<CdDeviceStatus> getDao() {return cdDeviceStatusDao;}

  public CdDeviceStatus createEntity() { return new CdDeviceStatus();}

  @Override
  protected void beforeInsert(CdDeviceStatus record) {

  }

  @Override
  protected void beforeUpdate(CdDeviceStatus record) {

  }

  @Override
  public List<CdDeviceStatus> findOfflineDevice() {
    Date date = new Date();
    List<CdDeviceStatus> device = this.cdDeviceStatusDao.findOfflineDevice(date);
    return device;
  }

  @Override
  public void updateDeviceStatus(List<String> ids) {
    this.cdDeviceStatusDao.updateDeviceStatus(ids);
  }

  @Override
  public void updateHeartbeatTime(List<String> ids) {
    this.cdDeviceStatusDao.updateHeartbeatTime(ids);
  }


// ----      The End by Generator     ----//




}

