package com.unis.crk.basic.mapper;

import com.unis.crk.basic.entity.BasicEnum;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

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

/**
 * <p>
 * 数据字典大类 Mapper 接口
 * </p>
 *
 * @author TangSong
 * @since 2021-08-04
 */
@Repository
public interface BasicEnumMapper extends BaseMapper<BasicEnum> {

    int importData(Map<String, String> map);

    List<BasicEnum> getAllParen();

    int getCountChildren(@Param("enumId")String enumId);

    @Select("SELECT enumId,enumcode,enumname,gbcode,parentId FROM depot_qh.basic_enum where parentId= #{parentId}")
    List<Map<String,Object>> findEnumByDepot(@Param("parentId") String parentId);
}
