package com.changhu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.changhu.common.pojo.vo.TreeNodeVo;
import com.changhu.pojo.entity.AdministrativeDivision;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * administrative_division (全国行政区划表(2023/12/04))  固化类
 * author: luozhun
 * desc 由groovy脚本自动生成
 */
@Mapper
public interface AdministrativeDivisionMapper extends BaseMapper<AdministrativeDivision> {

    /**
     * 树列表
     *
     * @param level 等级
     * @return 结果
     */
    List<TreeNodeVo<String>> treeList(@Param("level") Integer level);

    /**
     * 根据父编码查询子级行政区划
     *
     * @param parentCode 父编码
     * @return 结果
     */
    List<TreeNodeVo<String>> administrativeDivisionByParentCode(@Param("parentCode") String parentCode);
}
