package com.diagbot.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.diagbot.entity.Organization;
import com.diagbot.mapper.OrganizationMapper;
import com.diagbot.service.OrganizationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Description: 机构Service实现类
 * @Author: ztg
 * @Date: 2018/9/13 16:56
 */
@Service
@Slf4j
public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Organization> implements OrganizationService {

    /**
     * 根据参数查询机构信息
     * @param map 参数
     * @return
     */
    @Override
    public List<Organization> selectByMap(Map map) {
        return baseMapper.selectByMap(map);
    }

    /**
     * @Description: 通过用户id获取组织结构
     * @Author: ztg
     * @Date: 2018/9/13 19:24
     */
    public Organization getByUserId(Long userId){
        return baseMapper.getByUserId(userId);
    }
    /**
     * @Description: 通过机构名称获取组织结构
     * @Author: zhaops
     * @Date: 2018/9/13 19:24
     */
    public Organization getByName(String name){
        return baseMapper.getByName(name);
    }

    /**
     * @Description: 模糊查询机构名称
     * @Author: wangfeng
     * @Date: 2018/9/19 15:24
     */
    public List<Organization> findOrganization(String organizationName){
    	 return baseMapper.findOrganization(organizationName);
    }

}
