|
@@ -151,7 +151,10 @@ public class CamelJDBCConfiguration {
|
151
|
151
|
|
152
|
152
|
from("timer:mytimer-insert-statusDaily?period=3600000")
|
153
|
153
|
.routeId("insert-statusDaily")
|
154
|
|
- .setHeader("date", constant(getDate()))
|
|
154
|
+ .split(body()).process(exchange -> {
|
|
155
|
+ Message in = exchange.getIn();
|
|
156
|
+ in.setHeader("date",getDate());
|
|
157
|
+ })
|
155
|
158
|
.setBody(simple("select distinct jh,rq,cyfs,yz,hysx , yysx ,tysx,bs,dym from DBA01 where rq = to_date('${header.date}','yyyy-MM-dd') and qyrq is not null "))
|
156
|
159
|
.to("jdbc:oracle")
|
157
|
160
|
.split(body()).process(exchange -> {
|
|
@@ -175,7 +178,10 @@ public class CamelJDBCConfiguration {
|
175
|
178
|
|
176
|
179
|
from("timer:mytimer-update-statusDaily-DYM?period=3600000")
|
177
|
180
|
.routeId("update-statusDaily-DYM")
|
178
|
|
- .setHeader("date", constant(getDate()))
|
|
181
|
+ .split(body()).process(exchange -> {
|
|
182
|
+ Message in = exchange.getIn();
|
|
183
|
+ in.setHeader("date",getDate());
|
|
184
|
+ })
|
179
|
185
|
.setBody(simple("select distinct jh , rq , dym from DBA01 where (jh,rq) in (SELECT jh,max(rq) rq FROM DBA01 WHERE dym is not null and rq<= to_date('${header.date}','yyyy-MM-dd') group by jh)"))
|
180
|
186
|
.to("jdbc:oracle")
|
181
|
187
|
.split(body())
|
|
@@ -188,7 +194,10 @@ public class CamelJDBCConfiguration {
|
188
|
194
|
//因为数据库有可能会查出多条数据,现在的做法时,在数据库中增加两个个字段,用来记录BJ和DYM 的更新时间 ,只有获取到的时间大于数据库中存储的时间时,才会更新,并且该字段也会更新
|
189
|
195
|
from("timer:mytimer-update-statusDaily-BJ?period=3600000")
|
190
|
196
|
.routeId("update-statusDaily-BJ")
|
191
|
|
- .setHeader("date", constant(getDate()))
|
|
197
|
+ .split(body()).process(exchange -> {
|
|
198
|
+ Message in = exchange.getIn();
|
|
199
|
+ in.setHeader("date",getDate());
|
|
200
|
+ })
|
192
|
201
|
.setBody(simple("select distinct jh , rq , bj from DBA01 where (jh,rq) in (SELECT jh,max(rq) rq FROM DBA01 WHERE bj is not null and rq<= to_date('${header.date}','yyyy-MM-dd') group by jh)"))
|
193
|
202
|
.to("jdbc:oracle")
|
194
|
203
|
.split(body()).process(exchange -> {
|
|
@@ -203,7 +212,10 @@ public class CamelJDBCConfiguration {
|
203
|
212
|
|
204
|
213
|
from("timer:mytimer-update-statusDaily-submergenceDepth?period=3600000")
|
205
|
214
|
.routeId("update-statusDaily-submergenceDepth")
|
206
|
|
- .setHeader("date", constant(getDate() + " 00:00:00"))
|
|
215
|
+ .split(body()).process(exchange -> {
|
|
216
|
+ Message in = exchange.getIn();
|
|
217
|
+ in.setHeader("date",getDate()+" 00:00:00");
|
|
218
|
+ })
|
207
|
219
|
.setBody(simple("select well_id,prod_date,start_pump_liq_level,pump_depth from centralbase.cb_pc_pro_wellbore_status_daily where prod_date = '${header.date}' "))
|
208
|
220
|
.to("jdbc:centralbase")
|
209
|
221
|
.split(body()).process(exchange -> {
|
|
@@ -247,7 +259,10 @@ public class CamelJDBCConfiguration {
|
247
|
259
|
|
248
|
260
|
from("timer:mytimer-insert-volDaily?period=3600000")
|
249
|
261
|
.routeId("insert-volDaily")
|
250
|
|
- .setHeader("date", constant(getDate()))
|
|
262
|
+ .split(body()).process(exchange -> {
|
|
263
|
+ Message in = exchange.getIn();
|
|
264
|
+ in.setHeader("date",getDate());
|
|
265
|
+ })
|
251
|
266
|
.setBody(simple("select distinct jh,rq,scsj, rcyl1,rcyl,rcql,hs, bz from DBA01 where rq = to_date('${header.date}','yyyy-MM-dd') and qyrq is not null "))
|
252
|
267
|
.to("jdbc:oracle")
|
253
|
268
|
.split(body()).process(exchange -> {
|
|
@@ -311,7 +326,10 @@ public class CamelJDBCConfiguration {
|
311
|
326
|
|
312
|
327
|
from("timer:mytimer-update-volDaily-liq_prod_daily?period=3600000")
|
313
|
328
|
.routeId("update-volDaily-liq_prod_daily")
|
314
|
|
- .setHeader("date", constant(getDate()))
|
|
329
|
+ .split(body()).process(exchange -> {
|
|
330
|
+ Message in = exchange.getIn();
|
|
331
|
+ in.setHeader("date",getDate());
|
|
332
|
+ })
|
315
|
333
|
.setBody(simple("select distinct jh,rq,scsj, rcyl1,rcyl,rcql,hs, bz from DBA01 where rq = to_date('${header.date}','yyyy-MM-dd') and qyrq is not null "))
|
316
|
334
|
.to("jdbc:oracle")
|
317
|
335
|
.split(body()).process(exchange -> {
|