| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- package com.ydtech.modules.inv.service.impl;
- import com.baomidou.mybatisplus.core.metadata.IPage;
- import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
- import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
- import com.ydtech.core.page.HttpResult;
- import com.ydtech.core.page.PageRequest;
- import com.ydtech.modules.inv.dao.InvAccountMapper;
- import com.ydtech.modules.inv.model.InvAccount;
- import com.ydtech.modules.inv.model.vo.InvAccountQueryVo;
- import com.ydtech.modules.inv.service.InvAccountService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import java.util.List;
- /**
- * @author Administrator
- * @description 针对表【ins_account(账户信息表)】的数据库操作Service实现
- * @createDate 2024-01-04 18:29:20
- */
- @Service
- public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAccount>
- implements InvAccountService {
- @Autowired
- private InvAccountMapper insAccountMapper;
- /**
- * 分页查询
- *
- * @param account
- * @return
- */
- @Override
- public IPage<InvAccount> selectAccountsListPage(InvAccountQueryVo invAccountQueryVo) {
- PageRequest pageRequest = new PageRequest();
- pageRequest.setPageNum(invAccountQueryVo.getPageNo());
- pageRequest.setPageSize(invAccountQueryVo.getPageSize());
- Page page = PageRequest.buildPageRequest(pageRequest);
- IPage<InvAccount> invAccountIPage = insAccountMapper.selectAccountsListPage(page, invAccountQueryVo);
- List<InvAccount> records = invAccountIPage.getRecords();
- records.forEach(invAccount -> {
- if (invAccount.getInvAccountCardList().size() < 2) {
- if (invAccount.getInvAccountCardList().get(0).getBankCardNum() == null) {
- invAccount.setInvAccountCardList(null);
- }
- }
- });
- return invAccountIPage;
- }
- @Override
- public List<InvAccount> selectAccounts(InvAccount account) {
- return insAccountMapper.selectAccountsList(account);
- }
- /**
- * 根据户名分类
- *
- * @return
- */
- @Override
- public HttpResult selectByAccountName() {
- InvAccount invAccount = new InvAccount();
- List<InvAccount> insAccounts = insAccountMapper.selectAccountsList(invAccount);
- if (!insAccounts.isEmpty()) {
- insAccounts.forEach(invAccountN -> {
- if (invAccountN.getInvAccountCardList().size() < 2) {
- if (invAccountN.getInvAccountCardList().get(0).getBankCardNum() == null) {
- invAccountN.setInvAccountCardList(null);
- }
- }
- });
- return HttpResult.ok("", insAccounts);
- }
- return HttpResult.error("查询错误");
- }
- }
|