---
title: "关于mybatis 级连查询  多查询条件方法"
author: "hackpro"
date: "2013-08-16T20:34:39Z"
tags: []
categories: ["编程语言"]
slug: "mybatis"
draft: false
lastmod: "2013-08-16T20:36:23Z"
id: 1926311
url: "https://hackpro.iteye.com/blog/1926311"
---

<resultMap id="SysOptionResultMap" type="com.cnnct.util.GlobalTree" >
	    <id column="PID" property="id" jdbcType="DECIMAL" />
	    <result column="LADDER" property="level" jdbcType="DECIMAL" />
	    <result column="OPION_CODE" property="code" jdbcType="VARCHAR" />
	    <result column="OPION_COMMENTS" property="name" jdbcType="VARCHAR" />
	    <result column="PARENT_ID" property="parentId" jdbcType="DECIMAL" />
	    <association property="children"**<span style="color:red"> column="a=pid,b=ladder"</span>** select="selectByParentId"/>
    </resultMap>
	  <select id="selectByParentId" resultMap="SysOptionResultMap">            
	   	SELECT * FROM  CNNCTIC.SYS_OPTION  WHERE parent_id=<span style="color:red">#{a,jdbcType=DECIMAL} and ladder=#{b,jdbcType=DECIMAL}+1**</span>	  </select>