|
@@ -58,7 +58,7 @@ public class BaseDataController {
|
58
|
58
|
sql = "insert into centralbase.cb_pc_pro_wellbore_status_daily(well_id,prod_date,oil_prod_method,oil_nozzle,back_pres,tubing_pres,casing_pres,pump_depth) " +
|
59
|
59
|
"values (?,?,?,?,?,?,?,?)";
|
60
|
60
|
insertCount = insertBaseDataSourceOfStatusDaily(sql, map);
|
61
|
|
- sql = "select jh , rq , dym from centralbase.cb_pc_pro_wellbore_status_daily where (jh,rq) in (SELECT jh,max(rq) rq FROM DBA01 WHERE dym is not null and to_date('"+date+"','yyyy-MM-dd') group by jh)";
|
|
61
|
+ sql = "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('"+date+"','yyyy-MM-dd') group by jh)";
|
62
|
62
|
List<Map<String, Object>> dymIsNotNUllList = selectA2DataOfNotIsNullDYMOrBJ(sql);
|
63
|
63
|
for (Map<String, Object> stringObjectMap : dymIsNotNUllList) {
|
64
|
64
|
sql = "update centralbase.cb_pc_pro_wellbore_status_daily set start_pump_liq_level = '" + stringObjectMap.get("DYM") + "' where well_id = '" + stringObjectMap.get("JH") + "' and prod_date::date = '" + stringObjectMap.get("RQ") + "' ";
|
|
@@ -78,7 +78,7 @@ public class BaseDataController {
|
78
|
78
|
sql = " update centralbase.cb_pc_pro_wellbore_status_daily set submergence_depth = '" + stringObjectMap.get("submergence_depth") + "' where well_id = '" + stringObjectMap.get("well_id") + "' and prod_date = '" + stringObjectMap.get("prod_date") + "' ";
|
79
|
79
|
updateCMDCount = updateBaseDataSourceOfStatusDaily(sql) + updateCMDCount;
|
80
|
80
|
}
|
81
|
|
- sql = "select jh , rq , bj from centralbase.cb_pc_pro_wellbore_status_daily where (jh,rq) in (SELECT jh,max(rq) rq FROM DBA01 WHERE bj is not null and to_date('"+date+"','yyyy-MM-dd') group by jh)";
|
|
81
|
+ sql = "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('"+date+"','yyyy-MM-dd') group by jh)";
|
82
|
82
|
List<Map<String, Object>> oilNozzleList = selectA2DataOfNotIsNullDYMOrBJ(sql);
|
83
|
83
|
for (Map<String, Object> stringObjectMap : oilNozzleList) {
|
84
|
84
|
sql = " update centralbase.cb_pc_pro_wellbore_status_daily set oil_nozzle = '" + stringObjectMap.get("BJ") + "' where well_id ='" + stringObjectMap.get("JH") + "' and prod_date='" + stringObjectMap.get("RQ") + "' ";
|