package com.shanghaichengdi.ghjgitem.service.impl;

import com.github.pagehelper.PageHelper;
import com.shanghaichengdi.ghjgitem.mapper.WaterPublicFlightsMapper;
import com.shanghaichengdi.ghjgitem.service.WaterPublicFlightsService;
import com.shanghaichengdi.ghjgitem.util.PrintLogUtils;
import com.shanghaichengdi.ghjgitem.vo.request.WaterExcursionReq;
import com.shanghaichengdi.ghjgitem.vo.response.WaterPublicFlightsRes;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class WaterPublickFlightsServiceImpl implements WaterPublicFlightsService {

  @Resource
  WaterPublicFlightsMapper mapper;

  @Override
  public List<WaterPublicFlightsRes> getPageList(WaterExcursionReq req) {
    try{
      PageHelper.startPage(req.getPageIndex(), req.getPageSize());
      List<WaterPublicFlightsRes> list = mapper.getPageList(req.getStartDate(), req.getEndDate());
      return list;
    }catch (Exception err){
      PrintLogUtils.printErrorLogInfo(err,"getPageList异常：");
      return null;
    }
  }

}
