| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.mapper.TInvoiceMapper; |
| | | import com.ruoyi.system.model.TInvoice; |
| | | import com.ruoyi.system.query.TInvoiceQuery; |
| | | import com.ruoyi.system.service.TInvoiceService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TInvoiceServiceImpl extends ServiceImpl<TInvoiceMapper, TInvoice> implements TInvoiceService { |
| | | |
| | | @Override |
| | | public PageInfo<TInvoice> pageList(TInvoiceQuery query) { |
| | | PageInfo<TInvoice> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TInvoice> list = makeQuery(query); |
| | | pageInfo.setRecords(list); |
| | | pageInfo.setTotal(list.size()); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public List<TInvoice> makeQuery(TInvoiceQuery query) { |
| | | LambdaQueryWrapper<TInvoice> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(null != query.getTitleType(),TInvoice::getTitleType,query.getTitleType()) |
| | | .like(StringUtils.isNotEmpty(query.getTitleName()),TInvoice::getTitleName,query.getTitleName()) |
| | | .eq(null != query.getStatus(),TInvoice::getStatus,query.getStatus()) |
| | | .ge(StringUtils.isNotEmpty(query.getInvoiceStartTime()),TInvoice::getInvoiceTime,query.getInvoiceStartTime()) |
| | | .le(StringUtils.isNotEmpty(query.getInvoiceEndTime()),TInvoice::getInvoiceTime,query.getInvoiceEndTime()) |
| | | .orderByDesc(TInvoice::getCreateTime); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | } |
| | | } |