瀏覽代碼

词库通用方法

gaodm 6 年之前
父節點
當前提交
f4f387337c

+ 4 - 0
aipt-service/src/main/java/com/diagbot/entity/wrapper/ConceptWrapper.java

@@ -11,12 +11,16 @@ import lombok.Setter;
 @Getter
 @Setter
 public class ConceptWrapper {
+    //关系起点术语id
+    private Long startId;
     //关系起点术语名称
     private String startName;
     //关系起点术语类型
     private Integer startType;
     //关系类型
     private Integer relationType;
+    //关系终点术语id
+    private Long endId;
     //关系终点术语名称
     private String endName;
     //关系终点术语类型

+ 18 - 6
aipt-service/src/main/resources/mapper/ConceptMapper.xml

@@ -31,19 +31,25 @@
         AND t3.is_deleted = 'N'
         AND t1.id = t2.start_id
         AND t3.id = t2.end_id
+        <if test="startId != null">
+            AND t2.start_id = #{startId}
+        </if>
         <if test="startName != null and startName != ''">
             AND t1.lib_name = #{startName}
         </if>
-        <if test="startType != null and startType != ''">
+        <if test="startType != null">
             AND t1.lib_type = #{startType}
         </if>
-        <if test="relationType != null and relationType != ''">
+        <if test="relationType != null">
             AND t2.relation_id = #{relationType}
         </if>
+        <if test="endId != null">
+            AND t2.end_id = #{endId}
+        </if>
         <if test="endName != null and endName != ''">
             AND t3.lib_name = #{endName}
         </if>
-        <if test="endType != null and endType != ''">
+        <if test="endType != null">
             AND t3.lib_type = #{endType}
         </if>
     </select>
@@ -68,19 +74,25 @@
         AND t1.id = t2.start_id
         AND t3.id = t2.end_id
         AND t2.id = t4.t_relation_id
+        <if test="startId != null">
+            AND t2.start_id = #{startId}
+        </if>
         <if test="startName != null and startName != ''">
             AND t1.lib_name = #{startName}
         </if>
-        <if test="startType != null and startType != ''">
+        <if test="startType != null">
             AND t1.lib_type = #{startType}
         </if>
-        <if test="relationType != null and relationType != ''">
+        <if test="relationType != null">
             AND t2.relation_id = #{relationType}
         </if>
+        <if test="endId != null">
+            AND t2.end_id = #{endId}
+        </if>
         <if test="endName != null and endName != ''">
             AND t3.lib_name = #{endName}
         </if>
-        <if test="endType != null and endType != ''">
+        <if test="endType != null">
             AND t3.lib_type = #{endType}
         </if>
         ORDER BY t4.order_no