package com.platform.yijia.service.impl;

import com.platform.yijia.dao.SysDeptMapper;
import com.platform.yijia.pojo.SysDept;
import com.platform.yijia.pojo.SysDeptExample;
import com.platform.yijia.service.SysDeptService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("sysDeptService")
public class SysDeptServiceImpl implements SysDeptService {

    @Resource
    private SysDeptMapper sysDeptMapper;

    /**
     * 根据parentId查询dept信息
     * @param parentId
     * @return
     */
    public List<SysDept> getDeptList(Long parentId){
        SysDeptExample example = new SysDeptExample();
        example.or().andParentIdEqualTo(parentId);
        return sysDeptMapper.selectByExample(example);
    }
}
