Kaynağa Gözat

mysql版本 提交

gaodd 1 yıl önce
ebeveyn
işleme
a72aa062a6

+ 8 - 2
pom.xml

@@ -60,11 +60,17 @@
60 60
 		<artifactId>ojdbc14</artifactId>
61 61
 		<version>10.2.0.5.0</version>
62 62
 	</dependency> -->
63
-	<dependency>
63
+	<!-- <dependency>
64 64
 		<groupId>com.oracle</groupId>
65 65
 		<artifactId>ojdbc6</artifactId>
66 66
 		<version>11.2.0.3</version>
67
-	</dependency>
67
+	</dependency> -->
68
+	
69
+    <dependency>
70
+			<groupId>mysql</groupId>
71
+			<artifactId>mysql-connector-java</artifactId>
72
+	</dependency> 
73
+		
68 74
 	<dependency>
69 75
 		<groupId>com.alibaba</groupId>
70 76
 		<artifactId>druid-spring-boot-starter</artifactId>

+ 32 - 30
src/main/java/com/unis/hlht/server/mapper/tabledata/TableDataMapper.java

@@ -22,36 +22,38 @@ import java.util.Map;
22 22
 @Repository
23 23
 public interface TableDataMapper extends MyMapper<Map> {
24 24
 
25
-    @Select({"<script> SELECT * FROM ( "
26
-            + "SELECT t.*,rownum num FROM ${tableName} t where is_upload = 0 "
27
-            + "and rownum &lt;= #{pageSize}",
25
+    @Select({"<script>"
26
+            + "SELECT t.* FROM ${tableName} t where is_upload = 0 ",
28 27
             "<if test = 'startTime != null'>",
29
-            "and to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &gt;= to_date(#{startTime},'yyyy-MM-dd HH24:MI:SS')",
28
+            /*"and str_to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &gt;= str_to_date(#{startTime},'yyyy-MM-dd HH24:MI:SS')",*/
29
+            "and (zhgxsj) &gt;= (#{startTime})",
30 30
             "</if>",
31 31
             "<if test = 'endTime != null'>",
32
-            "and to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &lt;= to_date(#{endTime},'yyyy-MM-dd HH24:MI:SS')",
32
+            /*"and str_to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &lt;= str_to_date(#{endTime},'yyyy-MM-dd HH24:MI:SS')",*/
33
+            "and (zhgxsj) &lt;= (#{endTime})",
33 34
             "</if>",
34 35
             "<if test = 'depDwdm != null'>",
35 36
             "and ${selectByDwdmOfCol} like #{depDwdm}",
36 37
             "</if>",
37
-            ") where num &gt; #{pageIndex}",
38
+            "limit #{pageIndex},#{pageSize}",
38 39
             "</script>"})
39 40
     List<Map> findAllByLoadDate(Map params);
40 41
 
41 42
     @Select({"<script> SELECT * FROM ( "
42 43
             + "SELECT t.*,rownum num FROM ${tableName} t where is_upload = 0 and id = #{busId}"
43
-            + " and rownum &lt;= #{pageSize} ",
44
-            " ) where num &gt; #{pageIndex} ",
44
+            +" ) a limit #{pageIndex},#{pageSize}",
45 45
             "</script>"})
46 46
     List<Map> findById(@Param("tableName") String tableName, @Param("busId") String busId,
47 47
                        @Param("pageSize") Integer pageSize, @Param("pageIndex") Integer pageIndex);
48 48
 
49 49
     @Select({"<script> SELECT count(*)  FROM ${tableName} where is_upload = 0 ",
50 50
             "<if test = 'startTime != null'>",
51
-            "and to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &gt;= to_date(#{startTime},'yyyy-MM-dd HH24:MI:SS')",
51
+            /*"and str_to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &gt;= str_to_date(#{startTime},'yyyy-MM-dd HH24:MI:SS')",*/
52
+            "and (zhgxsj) &gt;= (#{startTime})",
52 53
             "</if>",
53 54
             "<if test = 'endTime != null'>",
54
-            "and to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &lt;= to_date(#{endTime},'yyyy-MM-dd HH24:MI:SS')",
55
+            /*"and str_to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &lt;= str_to_date(#{endTime},'yyyy-MM-dd HH24:MI:SS')",*/
56
+            "and (zhgxsj) &lt;= (#{endTime})",
55 57
             "</if>",
56 58
             "<if test = 'depDwdm != null'>",
57 59
             "and ${selectByDwdmOfCol} like #{depDwdm} ",
@@ -85,19 +87,20 @@ public interface TableDataMapper extends MyMapper<Map> {
85 87
      */
86 88
     @Select({"<script> SELECT * FROM ( "
87 89
             + "SELECT t.WSDJCDH,t.JCSJ,t.HWDM,t.CFWW,t.CFWS,t.CFNW,t.CFNS,t.LSZGW,t.LSZDW,t.LSPJW,REPLACE(t.LSSDZJH,CHR(0),'') as LSSDZJH,t.CZBZ,t.ZHGXSJ,"
88
-            + "t.id,t.IS_UPLOAD,t.LOAD_DATE,t.DEP_DWDM,t.DEP_KQDM,t.TYHWBM,REPLACE(t.LSWDZJH,CHR(0),'') as LSWDZJH,"
89
-    		+"rownum num FROM ${tableName} t where is_upload = 0 "
90
-            + "and rownum &lt;= #{pageSize}",
90
+            + "t.id,t.IS_UPLOAD,t.LOAD_DATE,t.DEP_DWDM,t.DEP_KQDM,t.TYHWBM,REPLACE(t.LSWDZJH,CHR(0),'') as LSWDZJH"
91
+    		+"FROM ${tableName} t where is_upload = 0 ",
91 92
             "<if test = 'startTime != null'>",
92
-            "and to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &gt;= to_date(#{startTime},'yyyy-MM-dd HH24:MI:SS')",
93
+            /*"and str_to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &gt;= str_to_date(#{startTime},'yyyy-MM-dd HH24:MI:SS')",*/
94
+            "and (zhgxsj) &gt;= (#{startTime})",
93 95
             "</if>",
94 96
             "<if test = 'endTime != null'>",
95
-            "and to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &lt;= to_date(#{endTime},'yyyy-MM-dd HH24:MI:SS')",
97
+            /*"and str_to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &lt;= str_to_date(#{endTime},'yyyy-MM-dd HH24:MI:SS')",*/
98
+            "and (zhgxsj) &lt;= (#{endTime})",
96 99
             "</if>",
97 100
             "<if test = 'depDwdm != null'>",
98 101
             "and ${selectByDwdmOfCol} like #{depDwdm}",
99 102
             "</if>",
100
-            ") where num &gt; #{pageIndex}",
103
+            ") a limit #{pageIndex},#{pageSize}",
101 104
             "</script>"})
102 105
     List<Map> findAllByLoadDateLOB(Map params);
103 106
     
@@ -105,10 +108,9 @@ public interface TableDataMapper extends MyMapper<Map> {
105 108
     
106 109
     @Select({"<script> SELECT * FROM ( "
107 110
     		+ "SELECT t.WSDJCDH,t.JCSJ,t.HWDM,t.CFWW,t.CFWS,t.CFNW,t.CFNS,t.LSZGW,t.LSZDW,t.LSPJW,REPLACE(t.LSSDZJH,CHR(0),'') as LSSDZJH,t.CZBZ,t.ZHGXSJ,"
108
-            + "t.id,t.IS_UPLOAD,t.LOAD_DATE,t.DEP_DWDM,t.DEP_KQDM,t.TYHWBM,REPLACE(t.LSWDZJH,CHR(0),'') as LSWDZJH,"
109
-            + "rownum num FROM ${tableName} t where is_upload = 0 and id = #{busId}"
110
-            + " and rownum &lt;= #{pageSize} ",
111
-            " ) where num &gt; #{pageIndex} ",
111
+            + "t.id,t.IS_UPLOAD,t.LOAD_DATE,t.DEP_DWDM,t.DEP_KQDM,t.TYHWBM,REPLACE(t.LSWDZJH,CHR(0),'') as LSWDZJH"
112
+            + "FROM ${tableName} t where is_upload = 0 and id = #{busId}",
113
+            " ) a limit #{pageIndex},#{pageSize}",
112 114
             "</script>"})
113 115
     List<Map> findByIdLOB(@Param("tableName") String tableName, @Param("busId") String busId,
114 116
                        @Param("pageSize") Integer pageSize, @Param("pageIndex") Integer pageIndex);
@@ -119,10 +121,9 @@ public interface TableDataMapper extends MyMapper<Map> {
119 121
             + "SELECT QTNDJCDH,JCSJ,HWDM,CZBZ,ZHGXSJ,id,IS_UPLOAD,LOAD_DATE,DEP_DWDM,DEP_KQDM,ZYLX,TYHWBM,"
120 122
     		+"REPLACE(t.YQHLZJH,CHR(0),'') as YQHLZJH,REPLACE(t.EYHTHLZJH,CHR(0),'') as EYHTHLZJH,"
121 123
             +"REPLACE(t.LXFNDZJH,CHR(0),'') as LXFNDZJH,REPLACE(t.LHQNDZJH,CHR(0),'') as LHQNDZJH,"
122
-    		+"REPLACE(t.YYHDHLZJH,CHR(0),'') as YYHDHLZJH,REPLACE(t.YYHTHLZJH,CHR(0),'') as YYHTHLZJH,"
123
-            + "rownum num FROM ${tableName} t where is_upload = 0 and id = #{busId}"
124
-            + " and rownum &lt;= #{pageSize} ",
125
-            " ) where num &gt; #{pageIndex} ",
124
+    		+"REPLACE(t.YYHDHLZJH,CHR(0),'') as YYHDHLZJH,REPLACE(t.YYHTHLZJH,CHR(0),'') as YYHTHLZJH"
125
+            + "FROM ${tableName} t where is_upload = 0 and id = #{busId}",
126
+            " )a limit #{pageIndex},#{pageSize}",
126 127
             "</script>"})
127 128
     List<Map> findByIdQt(@Param("tableName") String tableName, @Param("busId") String busId,
128 129
                        @Param("pageSize") Integer pageSize, @Param("pageIndex") Integer pageIndex);
@@ -132,19 +133,20 @@ public interface TableDataMapper extends MyMapper<Map> {
132 133
             + "SELECT QTNDJCDH,JCSJ,HWDM,CZBZ,ZHGXSJ,id,IS_UPLOAD,LOAD_DATE,DEP_DWDM,DEP_KQDM,ZYLX,TYHWBM,"
133 134
             +"REPLACE(t.YQHLZJH,CHR(0),'') as YQHLZJH,REPLACE(t.EYHTHLZJH,CHR(0),'') as EYHTHLZJH,"
134 135
             +"REPLACE(t.LXFNDZJH,CHR(0),'') as LXFNDZJH,REPLACE(t.LHQNDZJH,CHR(0),'') as LHQNDZJH,"
135
-    		+"REPLACE(t.YYHDHLZJH,CHR(0),'') as YYHDHLZJH,REPLACE(t.YYHTHLZJH,CHR(0),'') as YYHTHLZJH,"
136
-    		+"rownum num FROM ${tableName} t where is_upload = 0 "
137
-            + "and rownum &lt;= #{pageSize}",
136
+    		+"REPLACE(t.YYHDHLZJH,CHR(0),'') as YYHDHLZJH,REPLACE(t.YYHTHLZJH,CHR(0),'') as YYHTHLZJH"
137
+    		+"FROM ${tableName} t where is_upload = 0 ",
138 138
             "<if test = 'startTime != null'>",
139
-            "and to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &gt;= to_date(#{startTime},'yyyy-MM-dd HH24:MI:SS')",
139
+            /*"and str_to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &gt;= str_to_date(#{startTime},'yyyy-MM-dd HH24:MI:SS')",*/
140
+            "and (zhgxsj) &gt;= (#{startTime})",
140 141
             "</if>",
141 142
             "<if test = 'endTime != null'>",
142
-            "and to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &lt;= to_date(#{endTime},'yyyy-MM-dd HH24:MI:SS')",
143
+            /*"and str_to_date(zhgxsj,'yyyy-MM-dd HH24:MI:SS') &lt;= str_to_date(#{endTime},'yyyy-MM-dd HH24:MI:SS')",*/
144
+            "and (zhgxsj) &lt;= (#{endTime})",
143 145
             "</if>",
144 146
             "<if test = 'depDwdm != null'>",
145 147
             "and ${selectByDwdmOfCol} like #{depDwdm}",
146 148
             "</if>",
147
-            ") where num &gt; #{pageIndex}",
149
+            ") a limit #{pageIndex},#{pageSize}",
148 150
             "</script>"})
149 151
     List<Map> findAllByLoadDateQt(Map params);
150 152
 

+ 9 - 46
src/main/resources/application.yml

@@ -35,51 +35,10 @@ spring:
35 35
     exceptiontranslation:
36 36
       enabled: true
37 37
   datasource:
38
-    type: com.alibaba.druid.pool.DruidDataSource
39
-    druid:
40
-      db-type: oracle
41
-      #数据库链接--青海
42
-      url: jdbc:oracle:thin:@(DESCRIPTION =
43
-        (ADDRESS_LIST =
44
-        (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.0.12)(PORT = 1521))
45
-        (LOAD_BALANCE = no)(FAILOVER=YES)
46
-        )
47
-        (CONNECT_DATA =
48
-        (SERVER = DEDICATED)
49
-        (SERVICE_NAME = ORCL)
50
-        )
51
-        )
52
-      username: updb_qh_n
53
-      password: 123456
54
-      driver-class-name: oracle.jdbc.driver.OracleDriver
55
-      initial-size: 30
56
-      max-active: 100
57
-      min-idle: 25
58
-      max-wait: 6000
59
-      pool-prepared-statements: true
60
-      max-pool-prepared-statement-per-connection-size: 1000
61
-      validation-query: SELECT 1 FROM DUAL
62
-      test-on-borrow: false
63
-      test-on-return: false
64
-      test-while-idle: true
65
-      time-between-connect-error-millis: 60000
66
-      min-evictable-idle-time-millis: 300000
67
-      max-evictable-idle-time-millis: 3000000
68
-      filters: stat
69
-      connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
70
-      use-global-data-source-stat: true
71
-      #      aop-patterns: com.unis.user.server.repository.*
72
-      web-stat-filter:
73
-        url-pattern: /*
74
-        exclusions: /druid/*,*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico
75
-        enabled: true
76
-        session-stat-enable: true
77
-        session-stat-max-count: 10
78
-      stat-view-servlet:
79
-        url-pattern: /druid/*
80
-        reset-enable: true
81
-        login-username: druid
82
-        login-password: Admin@1238Sxls
38
+    driver-class-name: com.mysql.jdbc.Driver
39
+    url: jdbc:mysql://172.16.0.36:3306/up_country_qh?useUnicode=true&characterEncoding=utf-8&useSSL=false
40
+    username: root
41
+    password: admin@1234
83 42
   # Redis 配置
84 43
   redis:
85 44
     # Redis 服务器地址
@@ -117,4 +76,8 @@ swagger:
117 76
 #本地测试地址
118 77
 #baseFilePath: C:\Users\18513\Pictures\targets
119 78
 #服务器地址
120
-baseFilePath: E:\lkMediaFile
79
+baseFilePath: E:\lkMediaFile
80
+
81
+logging:
82
+  level:
83
+    com.unis.hlht.server.mapper.tabledata: debug

+ 2 - 1
src/main/resources/secure/secure.yml

@@ -30,7 +30,8 @@ national:
30 30
   nationalprikey:
31 31
   #http://106.3.145.72:49880/dep/service/API/UPLOAD/1101
32 32
 #  uploadip: 106.3.145.72
33
-  uploadip: 121.36.17.6
33
+  #uploadip: 121.36.17.6
34
+  uploadip: 121.36.17.6111
34 35
   uploadport: 9101
35 36
 #  uploaduri: dep/service/API/UPLOAD/V2020/
36 37
   #uploaduri: dep/service/API/UPLOAD/V2022/