|
@@ -8,14 +8,16 @@
|
|
|
SUM(t.oil_prod_daily) oil,
|
|
|
SUM(t.fluid_prod_daily) fluid,
|
|
|
SUM(t.water_prod_daily) water,
|
|
|
- SUM(t.water_cut) watercut
|
|
|
+ SUM(t.water_cut) watercut,
|
|
|
+ SUM(inj_vol_daily) vol
|
|
|
FROM ( SELECT wd.well_id,
|
|
|
TO_CHAR(wd.prod_date , 'YYYY-MM-DD') prod_time_str,
|
|
|
COALESCE(wd.gas_prod_daily, 0) gas_prod_daily,
|
|
|
COALESCE(wd.oil_prod_daily, 0) oil_prod_daily,
|
|
|
COALESCE(wd.fluid_prod_daily, 0) fluid_prod_daily,
|
|
|
COALESCE(wd.water_prod_daily, 0) water_prod_daily,
|
|
|
- COALESCE(wd.water_cut, 0) water_cut
|
|
|
+ COALESCE(wd.water_cut, 0) water_cut,
|
|
|
+ COALESCE(wd.inj_vol_daily) inj_vol_daily
|
|
|
FROM by_dwr.fact_dwr_pc_pro_well_vol_d wd
|
|
|
WHERE wd.prod_date <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
|
|
|
and wd.prod_date <![CDATA[ <= ]]> to_date(#{endDay},'YYYY-MM-DD')
|
|
@@ -26,7 +28,7 @@
|
|
|
GROUP BY t.well_id, t.prod_time_str
|
|
|
</select>
|
|
|
|
|
|
- <select id="getMonthGroupList" resultType="com.bowintek.practice.vo.FactWell.FactWellGroupList">
|
|
|
+ <select id="getMonthShowInList" resultType="com.bowintek.practice.vo.FactWell.FactWellGroupList">
|
|
|
SELECT t.well_id,
|
|
|
t.prod_time_str time_str,
|
|
|
MAX(t.gas_prod_mon) gas,
|
|
@@ -35,7 +37,7 @@
|
|
|
MAX(t.fluid_prod_mon) fluid,
|
|
|
0 watercut
|
|
|
FROM ( SELECT wm.well_id,
|
|
|
- TO_CHAR(wm.prod_date , 'YYYY-MM-DD') prod_time_str,
|
|
|
+ TO_CHAR(wm.prod_date , 'YYYY年MM月') prod_time_str,
|
|
|
COALESCE(wm.gas_prod_cum, 0) gas_prod_mon,
|
|
|
COALESCE(wm.oil_prod_cum, 0) oil_prod_mon,
|
|
|
COALESCE(wm.water_prod_cum, 0) water_prod_mon,
|
|
@@ -44,32 +46,65 @@
|
|
|
WHERE wm.prod_date is not null
|
|
|
and wm.prod_date <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
|
|
|
and wm.prod_date <![CDATA[ <= ]]> to_date(#{endDay},'YYYY-MM-DD')
|
|
|
- and wm.well_id=#{wellId}
|
|
|
+ <if test="wellId!='' and wellId!=null">
|
|
|
+ and wm.well_id=#{wellId}
|
|
|
+ </if>
|
|
|
) t
|
|
|
GROUP BY t.well_id, t.prod_time_str
|
|
|
</select>
|
|
|
|
|
|
- <select id="getYearGroupList" resultType="com.bowintek.practice.vo.FactWell.FactWellGroupList">
|
|
|
+ <select id="getMonthGroupList" resultType="com.bowintek.practice.vo.FactWell.FactWellGroupList">
|
|
|
SELECT t.well_id,
|
|
|
t.prod_time_str time_str,
|
|
|
SUM(t.gas_prod_mon) gas,
|
|
|
SUM(t.oil_prod_mon) oil,
|
|
|
SUM(t.water_prod_mon) water,
|
|
|
SUM(t.fluid_prod_mon) fluid,
|
|
|
- 0 watercut
|
|
|
+ SUM(t.water_cut_ratio_m) watercut,
|
|
|
+ SUM(t.inj_vol_mon) vol
|
|
|
FROM ( SELECT wm.well_id,
|
|
|
- SUBSTRING(prod_date, 1, 4) prod_time_str,
|
|
|
+ to_char(to_date(CONCAT(wm.prod_date,'-01'), 'YYYY-MM-DD'), 'YYYY年MM月') prod_time_str,
|
|
|
COALESCE(wm.gas_prod_mon, 0) gas_prod_mon,
|
|
|
COALESCE(wm.oil_prod_mon, 0) oil_prod_mon,
|
|
|
COALESCE(wm.water_prod_mon, 0) water_prod_mon,
|
|
|
- COALESCE(wm.fluid_prod_mon, 0) fluid_prod_mon
|
|
|
+ COALESCE(wm.fluid_prod_mon, 0) fluid_prod_mon,
|
|
|
+ COALESCE(wm.water_cut_ratio_m, 0) water_cut_ratio_m,
|
|
|
+ COALESCE(wm.inj_vol_mon, 0) inj_vol_mon
|
|
|
FROM by_dwr.fact_dwr_pc_pro_well_vol_m wm
|
|
|
WHERE wm.prod_date is not null
|
|
|
- and to_date(CONCAT(wm.prod_date,'-01'), 'YYYY-MM-DD') <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
|
|
|
- and to_date(CONCAT(wm.prod_date,'-01'), 'YYYY-MM-DD') <![CDATA[ <= ]]> to_date(#{endDay},'YYYY-MM-DD')
|
|
|
- <if test="wellId!='' and wellId!=null">
|
|
|
- and wm.well_id=#{wellId}
|
|
|
- </if>
|
|
|
+ and to_date(CONCAT(wm.prod_date,'-01'), 'YYYY-MM-DD') <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
|
|
|
+ and to_date(CONCAT(wm.prod_date,'-01'), 'YYYY-MM-DD') <![CDATA[ <= ]]> to_date(#{endDay},'YYYY-MM-DD')
|
|
|
+ <if test="wellId!='' and wellId!=null">
|
|
|
+ and wm.well_id=#{wellId}
|
|
|
+ </if>
|
|
|
+ ) t
|
|
|
+ GROUP BY t.well_id, t.prod_time_str
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getYearGroupList" resultType="com.bowintek.practice.vo.FactWell.FactWellGroupList">
|
|
|
+ SELECT t.well_id,
|
|
|
+ t.prod_time_str time_str,
|
|
|
+ MAX(t.gas_prod_year) gas,
|
|
|
+ MAX(t.oil_prod_year) oil,
|
|
|
+ MAX(t.water_prod_year) water,
|
|
|
+ MAX(t.fluid_prod_year) fluid,
|
|
|
+ MAX(t.water_cut_ratio_y) watercut,
|
|
|
+ MAX(t.inj_vol_year) vol
|
|
|
+ FROM ( SELECT wm.well_id,
|
|
|
+ SUBSTRING(prod_date, 1, 4) prod_time_str,
|
|
|
+ COALESCE(wm.gas_prod_year, 0) gas_prod_year,
|
|
|
+ COALESCE(wm.oil_prod_year, 0) oil_prod_year,
|
|
|
+ COALESCE(wm.water_prod_year, 0) water_prod_year,
|
|
|
+ COALESCE(wm.liquid_prod_year, 0) fluid_prod_year,
|
|
|
+ COALESCE(wm.water_cut_ratio_y, 0) water_cut_ratio_y,
|
|
|
+ COALESCE(wm.inj_vol_year, 0) inj_vol_year
|
|
|
+ FROM by_dwr.fact_dwr_pc_pro_well_vol_m wm
|
|
|
+ WHERE wm.prod_date is not null
|
|
|
+ and to_date(CONCAT(wm.prod_date,'-01'), 'YYYY-MM-DD') <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
|
|
|
+ and to_date(CONCAT(wm.prod_date,'-01'), 'YYYY-MM-DD') <![CDATA[ <= ]]> to_date(#{endDay},'YYYY-MM-DD')
|
|
|
+ <if test="wellId!='' and wellId!=null">
|
|
|
+ and wm.well_id=#{wellId}
|
|
|
+ </if>
|
|
|
) t
|
|
|
GROUP BY t.well_id, t.prod_time_str
|
|
|
</select>
|