package com.huimv.env.input.service.impl;

import cn.hutool.core.date.DateTime;
import com.huimv.env.input.entity.BaseFarm;
import com.huimv.env.input.entity.Gateway;
import com.huimv.env.input.entity.vo.DataInfoVO;
import com.huimv.env.input.entity.vo.HeartInfoVo;
import com.huimv.env.input.mapper.BaseFarmMapper;
import com.huimv.env.input.mapper.GatewayMapper;
import com.huimv.env.input.service.IBaseFarmService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2024-05-09
 */
@Service
public class BaseFarmServiceImpl extends ServiceImpl<BaseFarmMapper, BaseFarm> implements IBaseFarmService {

    @Autowired
    private GatewayMapper gatewayMapper;

    @Override
    public List<Gateway> getUploadFarm() {
        return gatewayMapper.getUploadFarm();
    }

    @Override
    public List<HeartInfoVo> trackImport(DateTime dateTime,String gateWay) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return gatewayMapper.trackImport(dateTime,gateWay);
    }

    @Override
    public  List<DataInfoVO>  dataImport(DateTime dateTime, String deviceCode) {
        return  gatewayMapper.dataImport(dateTime,deviceCode);
    }
}
