gaodd hace 2 años
padre
commit
9a6e3abf9f

+ 6 - 2
pom.xml

@@ -41,6 +41,10 @@
41 41
 			<version>1.3.2</version>
42 42
 		</dependency>
43 43
 		<dependency>
44
+            <groupId>mysql</groupId>
45
+            <artifactId>mysql-connector-java</artifactId>
46
+        </dependency>
47
+		<dependency>
44 48
 			<groupId>org.springframework.cloud</groupId>
45 49
 			<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
46 50
 		</dependency>
@@ -51,7 +55,7 @@
51 55
 			<version>1.2.3</version>
52 56
 		</dependency>
53 57
 		<!-- gbase依赖包 -->  
54
-		<dependency>
58
+		<!-- <dependency>
55 59
 	      	<groupId>com.gbase8s</groupId>
56 60
 	      	<artifactId>ifxjdbc</artifactId>
57 61
 	      	<version>1.0</version>
@@ -60,7 +64,7 @@
60 64
       		<groupId>com.gbase</groupId>
61 65
       		<artifactId>druid</artifactId>
62 66
       		<version>1.0.28</version>
63
-    	</dependency>
67
+    	</dependency> -->
64 68
 
65 69
 		<dependency>
66 70
 			<groupId>org.apache.commons</groupId>

+ 4 - 3
src/main/java/com/chinaitop/DepotBasicApplication.java

@@ -15,13 +15,14 @@ import com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration;
15 15
 @EnableEurekaClient
16 16
 @EnableDiscoveryClient
17 17
 @EnableFeignClients
18
-@SpringBootApplication(exclude = PageHelperAutoConfiguration.class)//配置mybatis的配置文件使用,否则报多个分页插件
18
+@SpringBootApplication
19
+//@SpringBootApplication(exclude = PageHelperAutoConfiguration.class)//配置mybatis的配置文件使用,否则报多个分页插件
19 20
 @MapperScan(basePackages = {"com.chinaitop.depot.**.mapper"})
20 21
 public class DepotBasicApplication {
21 22
 
22 23
 	public static void main(String[] args) {
23
-		System.setProperty("druid.testWhileIdle", "true");
24
-		System.setProperty("druid.validationQuery", "SELECT 1 FROM DUAL");
24
+		//System.setProperty("druid.testWhileIdle", "true");
25
+		//System.setProperty("druid.validationQuery", "SELECT 1 FROM DUAL");
25 26
 		SpringApplication.run(DepotBasicApplication.class, args);
26 27
 	}
27 28
 }

+ 19 - 20
src/main/java/com/chinaitop/depot/basic/mapper/BasicStorehouseMapper.xml

@@ -1462,24 +1462,23 @@
1462 1462
   </update>
1463 1463
   
1464 1464
   <select id="getThreeTempCheckList" parameterType="java.util.Map" resultMap="BaseResultMap">
1465
-    select DISTINCT storehouse_id
1466
-    from basic_storehouse storehouse
1467
-    inner join (SELECT
1468
-    *
1469
-    FROM
1470
-    (
1471
-    SELECT
1472
-    org_id,
1473
-    storehouse
1474
-    FROM
1475
-    t_testdata
1476
-    WHERE
1477
-    org_id = #{orgId}
1478
-    ORDER BY
1479
-    storehouse
1480
-    )
1481
-    WHERE
1482
-    rownum = 1) testdata on testdata.org_id = storehouse.org_id and testdata.storehouse = storehouse.storehouse_code
1465
+	SELECT DISTINCT
1466
+		storehouse_id
1467
+	FROM
1468
+		basic_storehouse storehouse
1469
+	INNER JOIN (
1470
+		SELECT
1471
+			org_id,
1472
+			storehouse
1473
+		FROM
1474
+			t_testdata
1475
+		WHERE
1476
+			org_id = #{orgId}
1477
+		ORDER BY
1478
+			storehouse
1479
+		LIMIT 1
1480
+	) testdata ON testdata.org_id = storehouse.org_id
1481
+	AND testdata.storehouse = storehouse.storehouse_code
1483 1482
     <where>
1484 1483
       <if test="orgId != null">
1485 1484
       	storehouse.org_id = #{orgId}
@@ -1558,8 +1557,8 @@
1558 1557
   <!-- 查询当前仓房和油罐的有效容量之和 -->
1559 1558
   <select id="queryCrAndgw" parameterType="java.lang.Integer" resultType="java.util.Map">
1560 1559
   	SELECT 
1561
-	NVL((SELECT SUM(a.actual_capacity) FROM basic_storehouse a WHERE a.del_flag=1 AND a.library_type='0' and a.org_id=#{orgId,jdbcType=INTEGER}),0) as cr_count,
1562
-	NVL((SELECT SUM(a.tank_capacity) FROM basic_tank a WHERE a.del_flag=1 AND a.library_type='0' and a.org_id=#{orgId,jdbcType=INTEGER}),0) as gr_count
1560
+	IFNULL((SELECT SUM(a.actual_capacity) FROM basic_storehouse a WHERE a.del_flag=1 AND a.library_type='0' and a.org_id=#{orgId,jdbcType=INTEGER}),0) as cr_count,
1561
+	IFNULL((SELECT SUM(a.tank_capacity) FROM basic_tank a WHERE a.del_flag=1 AND a.library_type='0' and a.org_id=#{orgId,jdbcType=INTEGER}),0) as gr_count
1563 1562
 	FROM DUAL
1564 1563
   </select>
1565 1564
 </mapper>

+ 18 - 22
src/main/resources/bootstrap.yml

@@ -26,33 +26,29 @@ spring:
26 26
     name: depot-basic
27 27
   # 数据库配置
28 28
   datasource:
29
-    type: com.alibaba.druid.pool.DruidDataSource
30
-    driver-class-name: com.gbasedbt.jdbc.IfxDriver
31
-    url: jdbc:gbasedbt-sqli://101.36.160.140:19089/depot:INFORMIXSERVER=gbaseserver;NEWCODESET=GB18030,GB18030-2000,5488;DB_LOCALE=zh_cn.GB18030-2000;GL_USEGLU=1;IFX_USE_STRENC=true;characterEncoding=utf8;
32
-    username: gbasedbt
33
-    password: cDbK2S0go8
34
-    #url: jdbc:gbasedbt-sqli://111.164.113.172:666/depot:INFORMIXSERVER=gbaseserver;NEWCODESET=GBK,8859-1,819;GL_USEGLU=1;IFX_USE_STRENC=true;characterEncoding=utf8;
35
-    #username: gbasedbt
36
-    #password: GBase123
29
+    driver-class-name: com.mysql.jdbc.Driver
30
+    url: jdbc:mysql://101.36.160.140:21029/depot_gouxiao?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
31
+    username: root
32
+    password: 1qaz@WSX
37 33
   # 缓存配置
38
-  session:
39
-    store-type: redis
40
-  redis:
41
-    database: 3
42
-    host: 172.16.0.2
43
-    port: 6379
44
-    password: 123456
45
-    timeout: 60000
46
-    jedis:
47
-      pool:
34
+  #session:
35
+    #store-type: redis
36
+  #redis:
37
+    #database: 3
38
+    #host: 172.16.0.2
39
+    #port: 6379
40
+    #password: 123456
41
+    #timeout: 60000
42
+    #jedis:
43
+      #pool:
48 44
         # 连接池最大连接数(使用负值表示没有限制)
49
-        max-active: 16
45
+        #max-active: 16
50 46
         # 连接池最大阻塞等待时间(使用负值表示没有限制)
51
-        max-wait: -1
47
+        #max-wait: -1
52 48
         # 连接池中的最大空闲连接
53
-        max-idle: 16
49
+        #max-idle: 16
54 50
         # 连接池中的最小空闲连接
55
-        min-idle: 0
51
+        #min-idle: 0
56 52
   # 静态资源配置
57 53
   resources:
58 54
     static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${web.upload-path}