package com.tofly.xrtygis.custom.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.common.core.util.DateUtil;
import com.tofly.xrtygis.custom.mapper.CustomScadaMonitorMapper;
import com.tofly.xrtygis.custom.service.CustomScadaMonitorService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletResponse;
import java.util.Date;

/**
 * SCADA存储最新值
 *
 * @author JF
 * @date 2022-4-21 16:32:46
 */
@Service
@AllArgsConstructor
public class CustomScadaMonitorServiceImpl implements CustomScadaMonitorService {

    private final CustomScadaMonitorMapper customScadaMonitorMapper;

    @Override
    public Page getListInfo(HttpServletResponse response, Page page, String start_time, String end_time) {
        Date dtBTime = DateUtil.formatDate(start_time, "yyyy-MM-dd hh:mm:ss");
        Date dtETime = DateUtil.formatDate(end_time, "yyyy-MM-dd hh:mm:ss");
        return customScadaMonitorMapper.getListInfo(page,dtBTime,dtETime);
    }
}
