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.ComputePatientCostAccountMapper;
import com.kcim.dao.model.ComputePatientCostAccount;
import com.kcim.vo.DiseaseCostDetailVO;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @program: CostAccount
 * @description:
 * @author: Wang.YS
 * @create: 2023-11-27 17:52
 **/
@Repository
public class ComputePatientCostAccountRepository extends ServiceImpl<ComputePatientCostAccountMapper, ComputePatientCostAccount> {
    public List<ComputePatientCostAccount> getList(String computeDate) {
        LambdaQueryWrapper<ComputePatientCostAccount> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ComputePatientCostAccount::getHospId, UserContext.getHospId());
        queryWrapper.eq(ComputePatientCostAccount::getComputeDate, computeDate);
        return this.list(queryWrapper);
    }

    public List<DiseaseCostDetailVO> getDiseaseCostDetailList(String computeDate, String diseaseFilter) {
        return this.baseMapper.getDiseaseCostDetailList(computeDate, UserContext.getHospId(), diseaseFilter);
    }

    public List<DiseaseCostDetailVO> getDiseaseCostCompositionDetail(String computeDate, String diseaseFilter) {
        return this.baseMapper.getDiseaseCostCompositionDetail(computeDate, UserContext.getHospId(), diseaseFilter);
    }

    public List<DiseaseCostDetailVO> getDeptDiseaseCostCompositionDetail(String computeDate, String diseaseFilter) {
        return this.baseMapper.getDeptDiseaseCostCompositionDetail(computeDate, UserContext.getHospId(), diseaseFilter);
    }

    public List<DiseaseCostDetailVO> getDrgCostDetailList(String computeDate) {
        return this.baseMapper.getDrgCostDetailList(computeDate, UserContext.getHospId());
    }

    public List<DiseaseCostDetailVO> getDrgCostCompositionDetail(String computeDate) {
        return this.baseMapper.getDrgCostCompositionDetail(computeDate, UserContext.getHospId());
    }

    public List<DiseaseCostDetailVO> getDeptDrgCostCompositionDetail(String computeDate) {
        return this.baseMapper.getDeptDrgCostCompositionDetail(computeDate, UserContext.getHospId());
    }
}
