package com.mortals.xhx.module.dept.dao.ibatis;


import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.module.dept.dao.DeptDao;
import com.mortals.xhx.module.dept.model.DeptEntity;
import org.springframework.stereotype.Repository;

import java.util.List;
/**
* 部门信息DaoImpl DAO接口
*
* @author zxfei
* @date 2023-03-06
*/
@Repository("deptDao")
public class DeptDaoImpl extends BaseCRUDDaoMybatis<DeptEntity,Long> implements DeptDao {


    @Override
    public List<DeptEntity> selectChildrenDeptById(String deptId) {
        return getSqlSession().selectList(getSqlId("selectChildrenDeptById"), deptId);
    }

    @Override
    public List<DeptEntity> queryAllList() {
        return this.getList(new DeptEntity());
    }

    @Override
    public DeptEntity queryDept(String deptCode) {
        return getSqlSession().selectOne(getSqlId("queryDept"),deptCode);
    }

    @Override
    public DeptEntity queryDeptParient(String parentCode) {
        return getSqlSession().selectOne(getSqlId("queryDeptParient"),parentCode);
    }




}
