ShutdownEvent2Service.java 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package com.gyee.runeconomy.service;
  2. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  3. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  4. import com.gyee.runeconomy.model.auto.ProEconShutdownEvent2;
  5. import com.gyee.runeconomy.service.auto.IProEconShutdownEvent2Service;
  6. import com.gyee.runeconomy.util.StringUtils;
  7. import org.springframework.stereotype.Service;
  8. import javax.annotation.Resource;
  9. import java.util.Date;
  10. @Service
  11. public class ShutdownEvent2Service {
  12. @Resource
  13. private IProEconShutdownEvent2Service proEconShutdownEvent2Service;
  14. public Page<ProEconShutdownEvent2> getShutdownEventList(Integer pageNum, Integer pageSize, String wtId, Date beginDate, Date endDate) {
  15. if(StringUtils.empty(pageNum))
  16. {
  17. pageNum=1;
  18. }
  19. if(StringUtils.empty(pageSize))
  20. {
  21. pageSize=10;
  22. }
  23. //构造分页构造器
  24. Page<ProEconShutdownEvent2> pageInfo = new Page<>(pageNum, pageSize);
  25. if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate) )
  26. {
  27. //构造条件构造器
  28. LambdaQueryWrapper<ProEconShutdownEvent2> queryWrapper = new LambdaQueryWrapper<>();
  29. //添加过滤条件
  30. queryWrapper.eq(ProEconShutdownEvent2::getWindturbineId, wtId).
  31. ge(ProEconShutdownEvent2::getStopTime, beginDate).
  32. le(ProEconShutdownEvent2::getStopTime, endDate);
  33. //执行查询
  34. proEconShutdownEvent2Service.page(pageInfo, queryWrapper);
  35. }
  36. return pageInfo;
  37. }
  38. }