package com.engine.organization.transmethod;

import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.hrmresource.HrmResourceMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.util.db.MapperProxyFactory;

/**
 * @author:dxfeng
 * @createTime: 2022/06/21
 * @version: 1.0
 */
public class HrmResourceTransMethod {

    public static String getDepartmentName(String departmentId) {
        return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(Long.parseLong(departmentId));
    }

    public static String getCompanyName(String companyId) {
        return MapperProxyFactory.getProxy(CompMapper.class).listById(Long.parseLong(companyId)).getCompName();
    }

    public static String getManagerName(String managerId) {
        return MapperProxyFactory.getProxy(HrmResourceMapper.class).getLastNameById(Long.parseLong(managerId));
    }

    public static String getScDepartmentName(String departmentId) {
        return MapperProxyFactory.getProxy(SystemDataMapper.class).getScDepartmentNameById(departmentId);
    }

    public static String getScCompanyName(String subCompanyId) {
        return MapperProxyFactory.getProxy(SystemDataMapper.class).getScDepartmentNameById(subCompanyId);
    }

    public static String getScManagerName(String managerId) {
        if ("0".equals(managerId)) {
            return "";
        }
        return MapperProxyFactory.getProxy(SystemDataMapper.class).getScHrmResourceNameById(managerId);
    }
}
