package com.emr.service.ipml;

import com.emr.dao.Archive_Master_FollowingMapper;
import com.emr.entity.Archive_Master_Following;
import com.emr.service.Archive_Master_FollowingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class Archive_Master_FollowingServiceImpl implements Archive_Master_FollowingService {
    @Autowired
    private Archive_Master_FollowingMapper archive_master_followingMapper;
    @Override
    public int insertSelective(Archive_Master_Following record) {
        return archive_master_followingMapper.insertSelective(record);
    }

    @Override
    public List<Archive_Master_Following> selectByMasterId(Integer roleId,String masterId) {
        String roleIds = "16,19,23,24,25,26,29";//小于等于科主任权限的roleId
        HashMap<String, Object> param = new HashMap<>();
        param.put("masterId", masterId);
        if (roleIds.indexOf(roleId)>-1){
            param.put("type", 1);
        }else{
            param.put("type", 0);
        }
        return archive_master_followingMapper.selectByMasterId(param);
    }
}
