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.ResponsibilityDepartmentMapper;
import com.kcim.dao.model.ResponsibilityDepartment;
import com.kcim.vo.ResponsibilityDepartIdVO;
import jdk.internal.dynalink.linker.LinkerServices;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @program: CostAccount
 * @description:
 * @author: Wang.YS
 * @create: 2023-12-08 15:07
 **/
@Repository
public class ResponsibilityDepartmentRepository extends ServiceImpl<ResponsibilityDepartmentMapper,ResponsibilityDepartment> {


    public List<ResponsibilityDepartment> getResponsibilityDepartment() {
        LambdaQueryWrapper<ResponsibilityDepartment> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ResponsibilityDepartment::getHospId, UserContext.getHospId());
        return this.list(queryWrapper);
    }

    public List<ResponsibilityDepartIdVO> getResponsibility(Long hospId){
        return baseMapper.getResponsibility(hospId);
    }
}
