package io.renren.modules.levelManage.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.renren.modules.levelManage.entity.LevelEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 层级关系表
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2022-03-28 17:07:26
 */
@Mapper
public interface LevelDao extends BaseMapper<LevelEntity> {
	List<LevelEntity> selectByName(@Param("page") Integer page,@Param("size") Integer size,@Param("name") String name);

	Integer getCountByName(@Param("name") String name);

	List<LevelEntity> getSonLevel(@Param("id") Long id);

	Integer queryEnabledCount();

	List<LevelEntity> getEnabledLevels();

	Integer queryEnabledCountWithParentId(@Param("id") Long id);

	LevelEntity getEnabledSon(@Param("id") Long id);

	List<LevelEntity> getEnabledLevelByProject(@Param("ids") List<Long> ids);
}
