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.CustomIndexDeviceHistoryMapper;
import com.tofly.xrtygis.custom.service.CustomIndexDeviceHistoryService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

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

/**
 * 流量采集数据记录历史信息
 *
 * @author JF
 * @date 2022-4-21 16:32:46
 */
@Service
@AllArgsConstructor
public class CustomIndexDeviceHistoryServiceImpl implements CustomIndexDeviceHistoryService {

    private final CustomIndexDeviceHistoryMapper customIndexDeviceHistoryMapper;

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