InvChannelAccountServiceImpl.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package com.ydtech.modules.inv.service.impl;
  2. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  3. import com.baomidou.mybatisplus.core.metadata.IPage;
  4. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  5. import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  6. import com.ydtech.core.page.PageRequest;
  7. import com.ydtech.modules.inv.dao.InvChannelAccountMapper;
  8. import com.ydtech.modules.inv.model.po.InvChannelAccount;
  9. import com.ydtech.modules.inv.model.po.QueryInvChannelAccount;
  10. import com.ydtech.modules.inv.service.InvChannelAccountService;
  11. import org.springframework.stereotype.Service;
  12. /**
  13. * @author Administrator
  14. * @description 针对表【inv_channel_account(渠道账户表)】的数据库操作Service实现
  15. * @createDate 2024-01-20 10:29:30
  16. */
  17. @Service
  18. public class InvChannelAccountServiceImpl extends ServiceImpl<InvChannelAccountMapper, InvChannelAccount>
  19. implements InvChannelAccountService {
  20. @Override
  21. public IPage<InvChannelAccount> selectAccountsList(QueryInvChannelAccount invChannelAccount) {
  22. PageRequest pageRequest = new PageRequest();
  23. pageRequest.setPageNum(invChannelAccount.getPageNum());
  24. pageRequest.setPageSize(invChannelAccount.getPageSize());
  25. Page page = PageRequest.buildPageRequest(pageRequest);
  26. LambdaQueryWrapper<InvChannelAccount> wrapper = new LambdaQueryWrapper<>();
  27. if(invChannelAccount.getEmployeeId() != null && !invChannelAccount.getEmployeeId().equals("")) {
  28. wrapper.eq(InvChannelAccount::getEmployeeId, invChannelAccount.getEmployeeId());
  29. }
  30. if(invChannelAccount.getAccount() != null && !invChannelAccount.getAccount().equals("")) {
  31. wrapper.eq(InvChannelAccount::getAccount, invChannelAccount.getAccount());
  32. }
  33. if(invChannelAccount.getMember() != null && !invChannelAccount.getMember().equals("")) {
  34. wrapper.eq(InvChannelAccount::getMember, invChannelAccount.getMember());
  35. }
  36. if(invChannelAccount.getPayee() != null && !invChannelAccount.getPayee().equals("")){
  37. wrapper.eq(InvChannelAccount::getProvince, invChannelAccount.getProvince());
  38. }
  39. if(invChannelAccount.getChannelName() != null && !invChannelAccount.getChannelName().equals("")){
  40. wrapper.like(InvChannelAccount::getChannelName, invChannelAccount.getChannelName());
  41. }
  42. return baseMapper.selectPage(page, wrapper);
  43. }
  44. }