package cn.hnthyy.thmz.service.impl.his.mz;

import cn.hnthyy.thmz.Utils.StringUtil;
import cn.hnthyy.thmz.entity.his.mz.Employee;
import cn.hnthyy.thmz.mapper.his.mz.EmployeeMapper;
import cn.hnthyy.thmz.service.his.mz.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class EmployeeServiceImpl implements EmployeeService {
    @SuppressWarnings("all")
    @Autowired
    private EmployeeMapper employeeMapper;


    @Override
    public Employee queryByCodeRs(String codeRs) {
        return employeeMapper.selectByCodeRs(codeRs);
    }

    @Override
    public List<Employee> queryEmployeeByDepts(String depts) {
        return employeeMapper.selectEmployeeByDepts(StringUtil.formatToList(depts));
    }

    @Override
    public List<Employee> queryEmployeeByDept(String dept) {
        return employeeMapper.selectEmployeeByDept(dept);
    }

    @Override
    public Employee queryByUserName(String name) {
        return employeeMapper.selectByUserName(name);
    }

    @Override
    public Employee queryByUserCode(String userCode) {
        return employeeMapper.selectByUserCode(userCode);
    }

    @Override
    public List<Employee> queryByCodes(List<String> codes) {
        if(codes==null || codes.size()==0){
            return null;
        }
        return employeeMapper.selectByCodes(codes);
    }

    @Override
    public List<Employee> queryAll() {
        return employeeMapper.selectAll();
    }

    @Override
    public List<Employee> queryEmployeeByDepts(List<String> depts) {
        return employeeMapper.selectEmployeeByDepts(depts);
    }
}
