InvChannelAccountServiceImpl.java 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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.InvAccount;
  9. import com.ydtech.modules.inv.model.po.InvChannelAccount;
  10. import com.ydtech.modules.inv.model.po.QueryInvChannelAccount;
  11. import com.ydtech.modules.inv.service.InvChannelAccountService;
  12. import org.springframework.stereotype.Service;
  13. /**
  14. * @author Administrator
  15. * @description 针对表【inv_channel_account(渠道账户表)】的数据库操作Service实现
  16. * @createDate 2024-01-20 10:29:30
  17. */
  18. @Service
  19. public class InvChannelAccountServiceImpl extends ServiceImpl<InvChannelAccountMapper, InvChannelAccount>
  20. implements InvChannelAccountService {
  21. @Override
  22. public IPage<InvChannelAccount> selectAccountsList(QueryInvChannelAccount invChannelAccount) {
  23. PageRequest pageRequest = new PageRequest();
  24. pageRequest.setPageNum(invChannelAccount.getPageNum());
  25. pageRequest.setPageSize(invChannelAccount.getPageSize());
  26. Page page = PageRequest.buildPageRequest(pageRequest);
  27. LambdaQueryWrapper<InvChannelAccount> wrapper = new LambdaQueryWrapper<>();
  28. if(invChannelAccount.getEmployeeId() != null) {
  29. wrapper.eq(InvChannelAccount::getEmployeeId, invChannelAccount.getEmployeeId());
  30. }
  31. if(invChannelAccount.getAccount() != null) {
  32. wrapper.eq(InvChannelAccount::getAccount, invChannelAccount.getAccount());
  33. }
  34. if(invChannelAccount.getMember() != null){
  35. wrapper.eq(InvChannelAccount::getMember, invChannelAccount.getMember());
  36. }
  37. if(invChannelAccount.getPayee() != null){
  38. wrapper.eq(InvChannelAccount::getProvince, invChannelAccount.getProvince());
  39. }
  40. return baseMapper.selectPage(page, wrapper);
  41. }
  42. }