package com.shanghaichengdi.ghjgitem.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.shanghaichengdi.ghjgitem.domain.WaterTemporaryFlights;
import com.shanghaichengdi.ghjgitem.mapper.WaterTemporaryFlightsMapper;
import com.shanghaichengdi.ghjgitem.service.WaterTemporaryFlightsService;
import com.shanghaichengdi.ghjgitem.util.PrintLogUtils;
import com.shanghaichengdi.ghjgitem.vo.request.WaterExcursionReq;
import com.shanghaichengdi.ghjgitem.vo.response.WaterTemporaryFlightsRes;
import org.springframework.stereotype.Service;

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

@Service
public class WaterTemporaryFlightsServiceImpl implements WaterTemporaryFlightsService {

  @Resource
  private WaterTemporaryFlightsMapper mapper;

  @Override
  public List<WaterTemporaryFlightsRes> getPageList(WaterExcursionReq req) {
    try{
      PageHelper.startPage(req.getPageIndex(), req.getPageSize());
      List<WaterTemporaryFlightsRes> list = mapper.getPageList(req.getStartDate(), req.getEndDate());
      // 附件暂时不提供
      /*list.forEach(item->{

      });*/
      return list;
    }catch (Exception err){
      PrintLogUtils.printErrorLogInfo(err,"getPageList异常：");
      return null;
    }
  }

}
