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.CustomScadaHistoryMapper;
import com.tofly.xrtygis.custom.service.CustomScadaHistoryService;
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 CustomScadaHistoryServiceImpl implements CustomScadaHistoryService {

    private final CustomScadaHistoryMapper customScadaHistoryMapper;

    @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 customScadaHistoryMapper.getListInfo(page,dtBTime,dtETime);
    }
}
