zoukankan      html  css  js  c++  java
  • mybatis 递归

    <!-- 递归查询 map -->
    <resultMap id="RecursionMap" type="com.ws.project.transfer.project.xin.wbs.entity.CodeTree">
      <id column="ID" jdbcType="VARCHAR" property="id" />
      <result column="PID" jdbcType="VARCHAR" property="pid" />
      <result column="CODE" jdbcType="VARCHAR" property="code" />
      <result column="NAME" jdbcType="VARCHAR" property="name" />
      <result column="LEVELON" jdbcType="DECIMAL" property="levelon" />
      <result column="ORDERBY" jdbcType="DECIMAL" property="orderby" />
      <result column="DEMO" jdbcType="VARCHAR" property="demo" />
      <result column="EXTFIELD" jdbcType="VARCHAR" property="extfield" />
      <result column="OPERUSER" jdbcType="VARCHAR" property="operuser" />
      <result column="OPERTIME" jdbcType="TIMESTAMP" property="opertime" />
      <collection property="codeTrees" ofType="com.ws.project.transfer.project.xin.wbs.entity.CodeTree" column="id" select="findChild" />
    </resultMap>
    <!-- 递归查询 sep1: 根 -->
    <select id="recursion" resultMap="RecursionMap">
      <!-- 不要当前节点,所以是 PID = #{id} -->
      SELECT <include refid="Base_Column_List" /> FROM T_CODE_TREE WHERE PID = #{id}
    </select>
    <!-- 递归查询 sep2:子节点 -->
    <select id="findChild" resultMap="RecursionMap">
      SELECT <include refid="Base_Column_List" /> FROM T_CODE_TREE WHERE PID = #{id}
    </select>
    
  • 相关阅读:
    python 默认编码( UnicodeDecodeError: 'ascii' codec can't decode)
    python发送各类邮件的主要方法
    python输出htmltestrunner中文乱码如何解决
    Python unittest 官方文档
    Python pip 安装包
    Python easy_insatll 安装包
    linux 解压操作命令
    vim 操作指令2
    vim 操作指令1
    (转)水波纹过渡特效
  • 原文地址:https://www.cnblogs.com/huanggy/p/15151156.html
Copyright © 2011-2022 走看看