Kaynağa Gözat

统一方法

gaodm 6 yıl önce
ebeveyn
işleme
3802e34ff3

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

@@ -15,6 +15,10 @@ public class ConceptWrapper {
     private Long startId;
     //关系起点术语名称
     private String startName;
+    //关系起点术语性别类型
+    private Integer startSex;
+    //关系起点术语年龄
+    private Integer startAge;
     //关系起点术语类型
     private Integer startType;
     //关系类型
@@ -23,6 +27,10 @@ public class ConceptWrapper {
     private Long endId;
     //关系终点术语名称
     private String endName;
+    //关系终点术语性别类型
+    private Integer endSex;
+    //关系终点术语年龄
+    private Integer endAge;
     //关系终点术语类型
     private Integer endType;
 }

+ 88 - 0
aipt-service/src/main/resources/mapper/ConceptMapper.xml

@@ -37,6 +37,28 @@
         <if test="startName != null and startName != ''">
             AND t1.lib_name = #{startName}
         </if>
+        <if test="startSex != null or startAge != null">
+            AND t2.start_id = (
+            SELECT
+            id
+            FROM
+            kl_concept_common
+            WHERE
+            is_deleted = 'N'
+            <if test="startSex != null">
+                <if test="startSex == 3">
+                    and sex_type in ('1','2','3')
+                </if>
+                <if test="startSex != 3">
+                    and sex_type in ('3',#{startSex})
+                </if>
+            </if>
+            <if test="startAge != null">
+                <![CDATA[ AND min_age <= #{startAge} ]]>
+                <![CDATA[ AND max_age >= #{startAge} ]]>
+            </if>
+            )
+        </if>
         <if test="startType != null">
             AND t1.lib_type = #{startType}
         </if>
@@ -49,6 +71,28 @@
         <if test="endName != null and endName != ''">
             AND t3.lib_name = #{endName}
         </if>
+        <if test="endSex != null or endAge != null">
+            AND t2.end_id = (
+            SELECT
+            id
+            FROM
+            kl_concept_common
+            WHERE
+            is_deleted = 'N'
+            <if test="endSex != null">
+                <if test="endSex == 3">
+                    and sex_type in ('1','2','3')
+                </if>
+                <if test="endSex != 3">
+                    and sex_type in ('3',#{endSex})
+                </if>
+            </if>
+            <if test="endAge != null">
+                <![CDATA[ AND min_age <= #{endAge} ]]>
+                <![CDATA[ AND max_age >= #{endAge} ]]>
+            </if>
+            )
+        </if>
         <if test="endType != null">
             AND t3.lib_type = #{endType}
         </if>
@@ -80,6 +124,28 @@
         <if test="startName != null and startName != ''">
             AND t1.lib_name = #{startName}
         </if>
+        <if test="startSex != null or startAge != null">
+            AND t2.start_id = (
+            SELECT
+            id
+            FROM
+            kl_concept_common
+            WHERE
+            is_deleted = 'N'
+            <if test="startSex != null">
+                <if test="startSex == 3">
+                    and sex_type in ('1','2','3')
+                </if>
+                <if test="startSex != 3">
+                    and sex_type in ('3',#{startSex})
+                </if>
+            </if>
+            <if test="startAge != null">
+                <![CDATA[ AND min_age <= #{startAge} ]]>
+                <![CDATA[ AND max_age >= #{startAge} ]]>
+            </if>
+            )
+        </if>
         <if test="startType != null">
             AND t1.lib_type = #{startType}
         </if>
@@ -92,6 +158,28 @@
         <if test="endName != null and endName != ''">
             AND t3.lib_name = #{endName}
         </if>
+        <if test="endSex != null or endAge != null">
+            AND t2.end_id = (
+            SELECT
+            id
+            FROM
+            kl_concept_common
+            WHERE
+            is_deleted = 'N'
+            <if test="endSex != null">
+                <if test="endSex == 3">
+                    and sex_type in ('1','2','3')
+                </if>
+                <if test="endSex != 3">
+                    and sex_type in ('3',#{endSex})
+                </if>
+            </if>
+            <if test="endAge != null">
+                <![CDATA[ AND min_age <= #{endAge} ]]>
+                <![CDATA[ AND max_age >= #{endAge} ]]>
+            </if>
+            )
+        </if>
         <if test="endType != null">
             AND t3.lib_type = #{endType}
         </if>