`

关于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 * FROM  CNNCTIC.SYS_OPTION  WHERE parent_id=#{a,jdbcType=DECIMAL} and ladder=#{b,jdbcType=DECIMAL}+1[/b]   </select>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics