package com.njcn.product.event.transientes.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.product.event.transientes.pojo.po.PqsDicTreePO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PqsDicTreeMapper extends BaseMapper<PqsDicTreePO> {

    @Select("SELECT ID,NAME,CODE,PARENT_ID as parentId,level FROM PQS_DICTREE " +
            "START WITH CODE = #{code} " +
            "CONNECT BY PRIOR ID = PARENT_ID")
    List<PqsDicTreePO> selectChildrenByCode(@Param("code") String code);
}
