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.AccountingProductMapper;
import com.kcim.dao.model.AccountingProduct;
import com.kcim.vo.ProductMapVO;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @program: CostAccount
 * @description:
 * @author: Wang.YS
 * @create: 2023-12-13 16:39
 **/
@Repository
public class AccountingProductRepository extends ServiceImpl<AccountingProductMapper, AccountingProduct> {
    public List<AccountingProduct> getList() {
        LambdaQueryWrapper<AccountingProduct> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(AccountingProduct::getHospId, UserContext.getHospId());
        return this.list(queryWrapper);
    }

    public List<ProductMapVO> getProductMap(List<Long> accountIds){
        return this.baseMapper.selectProductMap(UserContext.getHospId(),accountIds);
    }
}
