昊漫玉 发表于 2016-11-28 09:28:27

关于mybatis 级连查询 多查询条件方法

<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" column="a=pid,b=ladder" select="selectByParentId"/>
    </resultMap>
<select id="selectByParentId" resultMap="SysOptionResultMap">            
   SELECT * FROMCNNCTIC.SYS_OPTIONWHERE parent_id=#{a,jdbcType=DECIMAL} and ladder=#{b,jdbcType=DECIMAL}+1</select>
页: [1]
查看完整版本: 关于mybatis 级连查询 多查询条件方法