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.util.UserContext;
import com.kcim.dao.mapper.CostShareParamMapper;
import com.kcim.dao.model.CostShareParam;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * @program: CostAccount
 * @description:
 * @author: Wang.YS
 * @create: 2024-04-03 14:49
 **/
@Repository
public class CostShareParamRepository extends ServiceImpl<CostShareParamMapper,CostShareParam> {
    public List<CostShareParam> getList(String filter) {
        LambdaQueryWrapper<CostShareParam> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(CostShareParam::getHospId, UserContext.getHospId());
        if(!StringUtils.isEmpty(filter)){
            queryWrapper.like(CostShareParam::getShareParamName,filter);
        }
        return this.list(queryWrapper);
    }
}
