浏览代码

Merge remote-tracking branch 'origin/push-dev-diagnose' into push-dev-publicLis

kongwz 5 年之前
父节点
当前提交
af0b6ae874

+ 1 - 1
graphdb/src/main/java/org/diagbot/pub/Ciku.java

@@ -2,7 +2,7 @@ package org.diagbot.pub;
 
 public enum Ciku {
     SYMPTOM("1","1,70"),VITAL_RESULT("2","35,70"),BIGlIS("3","12"),SUBLIS("subLis","13")
-    ,RESULTLIS("resultLis","14,70"),PACS("4","16"),RESULTPACS("resultPacs","17,70"),DISEASE("5","18")
+    ,RESULTLIS("resultLis","14"),PACS("4","16"),RESULTPACS("resultPacs","17"),DISEASE("5","18")
     ,HISTORY("6","18,70"),CAUSE("7","5,70"),PROGNOSIS("8","70"),OTHER("9","70");
     private String name;
     private String label;

+ 15 - 10
graphdb/src/main/java/org/diagbot/service/impl/KnowledgeServiceImpl.java

@@ -28,10 +28,7 @@ import org.springframework.data.domain.Sort;
 import org.springframework.stereotype.Service;
 
 import java.math.RoundingMode;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
+import java.sql.*;
 import java.text.NumberFormat;
 import java.util.*;
 
@@ -1569,9 +1566,9 @@ public class    KnowledgeServiceImpl implements KnowledgeService {
         ResultSet rs = null;
         try {
             String tongName, type,  isConcept,stand;
-            String sql = "SELECT name, type_id,is_concept,IF(is_concept=1,a.name,(select lib_name from kl_concept b where b.id = a.concept_id) ) lib_name \n" +
-                    "from kl_library_info a where  a.is_deleted = 'N'\n" +
-                    "and type_id in (1,5,12,13,14,16,17,18,35,70)";
+            String sql = "SELECT a.name,a.type_id,a.is_concept, b.lib_name  from kl_library_info a, kl_concept b\n" +
+                    " where a.is_deleted = 'N' and b.is_deleted = 'N' and a.concept_id = b.id\n" +
+                    " and a.type_id in (1,5,12,13,14,16,17,18,35,70)";
             st = connection.createStatement();
             rs = st.executeQuery(sql);
             Map<String,String> detail =null;
@@ -2124,7 +2121,7 @@ public class    KnowledgeServiceImpl implements KnowledgeService {
             if(disList != null && disList.size()>0){
                 for (Long disId:disList) {
                    respDTO = this.updateNeo(respDTO, disId, connect, ciKu);
-
+                   this.updateDate(connect,disId);
                 }
             }
             connect.close();
@@ -2134,8 +2131,16 @@ public class    KnowledgeServiceImpl implements KnowledgeService {
 
         return respDTO;
     }
-    public void updateDate(Connection connection,Long disId){
-        String sql = "UPDATE `kl_diagnose` set neo_update='1970-01-01 12:00:00' where id="+disId+";";
+    public void updateDate(Connection connection,Long disId) {
+        String sql = "UPDATE `kl_diagnose` set neo_update='1970-01-01 12:00:00' where id=?";
+        try {
+            PreparedStatement preparedStatement = connection.prepareStatement(sql);
+            preparedStatement.setLong(1,disId);
+            int i = preparedStatement.executeUpdate();
+            preparedStatement.close();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
     }
     public List<Long> getDisList(Connection connection){
         List<Long> disIds = new ArrayList<>();