| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- package com.kcim.dao.repository;
- import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
- import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
- import com.kcim.common.constants.NumberConstant;
- import com.kcim.common.util.UserContext;
- import com.kcim.dao.mapper.AccountingMapper;
- import com.kcim.dao.model.Accounting;
- import org.springframework.stereotype.Repository;
- import org.springframework.util.StringUtils;
- import java.util.List;
- /**
- * @program: CostAccount
- * @description:
- * @author: Wang.YS
- * @create: 2023-11-14 14:28
- **/
- @Repository
- public class AccountingRepository extends ServiceImpl<AccountingMapper, Accounting> {
- /**
- * 获取会计科目收入字典
- */
- public List<Accounting> getAccountIncome(String name){
- LambdaQueryWrapper<Accounting> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(Accounting::getHospId, UserContext.getHospId());
- queryWrapper.eq(Accounting::getAccountingType, NumberConstant.ONE);
- if(!StringUtils.isEmpty(name)){
- queryWrapper.like(Accounting::getAccountingName, name);
- }
- return this.list(queryWrapper);
- }
- public List<Accounting> getAllIncome() {
- LambdaQueryWrapper<Accounting> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(Accounting::getHospId, UserContext.getHospId());
- queryWrapper.eq(Accounting::getAccountingType, NumberConstant.ONE);
- return this.list(queryWrapper);
- }
- public List<Accounting> getAllCostAccounting() {
- LambdaQueryWrapper<Accounting> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(Accounting::getHospId, UserContext.getHospId());
- queryWrapper.eq(Accounting::getAccountingType, NumberConstant.TWO);
- return this.list(queryWrapper);
- }
- public List<Accounting> getList(Integer accountType) {
- LambdaQueryWrapper<Accounting> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(Accounting::getHospId, UserContext.getHospId());
- queryWrapper.eq(Accounting::getAccountingType, accountType);
- queryWrapper.orderByDesc(Accounting::getCreateTime);
- return this.list(queryWrapper);
- }
- public List<Accounting> getBaseCostList(String filter) {
- LambdaQueryWrapper<Accounting> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(Accounting::getHospId, UserContext.getHospId());
- queryWrapper.eq(Accounting::getAccountingType, NumberConstant.TWO);
- queryWrapper.eq(Accounting::getIsBaseCost,NumberConstant.ONE);
- if(!StringUtils.isEmpty(filter)){
- queryWrapper.like(Accounting::getAccountingName,filter);
- }
- queryWrapper.orderByDesc(Accounting::getCreateTime);
- return this.list(queryWrapper);
- }
- public List<Accounting> getList(Integer accountType, String filter) {
- LambdaQueryWrapper<Accounting> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(Accounting::getHospId, UserContext.getHospId());
- queryWrapper.eq(Accounting::getAccountingType, accountType);
- queryWrapper.and(q->q.like(Accounting::getAccountingCode,filter).or().like(Accounting::getAccountingName,filter));
- queryWrapper.orderByDesc(Accounting::getCreateTime);
- return this.list(queryWrapper);
- }
- }
|