Explorar o código

提供其他数据库递归查询语句

caixiaofeng hai 5 meses
pai
achega
f55e9e878e

+ 3 - 3
flow-app/src/main/resources/mapper/system/DeptDao.xml

@@ -27,8 +27,8 @@
     </sql>
 
     <sql id="getList_oracle">
-        SELECT * FROM SYS_DEPT
-        START WITH
+        SELECT DISTINCT * FROM SYS_DEPT
+        START WITH 0 = 0
         <include refid="deptWheres"></include>
         CONNECT BY PRIOR pid = id
     </sql>
@@ -43,7 +43,7 @@
     </sql>
 
     <select id="getList" resultMap="BaseResultMap">
-        <include refid="getList_mysql"></include>
+        <include refid="getList_oracle"></include>
     </select>
 
 

+ 4 - 4
flow-app/src/main/resources/mapper/system/MenuDao.xml

@@ -29,7 +29,7 @@
             and pid = #{menuQuery.pid}
         </if>
         <if test="menuQuery.title != null and menuQuery.title != ''">
-            and title like concat('%',#{menuQuery.title},'%')
+            and title like '%' || #{menuQuery.title} || '%'
         </if>
     </sql>
 
@@ -46,14 +46,14 @@
     </sql>
 
     <sql id="getTree_oracle">
-        SELECT * FROM SYS_MENU
-        START WITH
+        SELECT DISTINCT * FROM SYS_MENU
+        START WITH 0=0
         <include refid="menuWheres"></include>
         CONNECT BY PRIOR pid = id
     </sql>
 
     <select id="getTree" resultMap="BaseResultMap">
-        <include refid="getTree_mysql"></include>
+        <include refid="getTree_oracle"></include>
     </select>