Jelajahi Sumber

井筒-优化

xiaoqiao 10 bulan lalu
induk
melakukan
3270b886be

+ 5 - 0
src/main/java/com/bowintek/practice/controller/WellInfoController.java

@@ -159,6 +159,11 @@ public class WellInfoController {
         return RespGenerstor.success(wellInfoService.getWellTypeTree());
     }
 
+    @PostMapping("/getOrgProjectList")
+    public BaseResponse getOrgProjectList(List<String> orgList,List<String> unitList) {
+        return RespGenerstor.success(wellInfoService.selectOrgProjectList(orgList, unitList));
+    }
+
     @GetMapping("/downFile")
     public void downFile(HttpServletResponse response, Integer isShow, String filePath, String fileName) throws IOException {
         Map<String, String> getParams = new HashMap<>();

+ 6 - 0
src/main/java/com/bowintek/practice/mapper/cquery/WellInfoCQuery.java

@@ -130,4 +130,10 @@ public interface WellInfoCQuery {
      * @return
      */
     List<HashMap<String,Object>> selectWellTypeList();
+
+    /**
+     * 获取组织机构和地质单元关联列表
+     * @return
+     */
+    List<HashMap<String,Object>> selectOrgProjectList(List<String> orgList,List<String> unitList);
 }

+ 6 - 0
src/main/java/com/bowintek/practice/services/impl/WellInfoServiceImpl.java

@@ -235,4 +235,10 @@ public class WellInfoServiceImpl implements WellInfoService {
         });
         return wellTypeTree;
     }
+
+    @Override
+    @SwitchDataSource(DBTypeEnum.POSTGRE)
+    public List<HashMap<String,Object>> selectOrgProjectList( List<String> orgList,List<String> unitList){
+       return wellInfoCQuery.selectOrgProjectList(orgList,unitList);
+    }
 }

+ 1 - 0
src/main/java/com/bowintek/practice/services/service/WellInfoService.java

@@ -27,4 +27,5 @@ public interface WellInfoService {
     List<HashMap<String, Object>> getConstructUnitTree();
     List<HashMap<String, Object>> getWellPurposeTree();
     List<HashMap<String, Object>> getWellTypeTree();
+    List<HashMap<String,Object>> selectOrgProjectList( List<String> orgList,List<String> unitList);
 }

+ 17 - 17
src/main/resources/mapping/cquery/FactWellCQuery.xml

@@ -13,11 +13,11 @@
         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.oil_prod_daily, 0)/10000      oil_prod_daily,
+                        COALESCE(wd.fluid_prod_daily, 0)/10000      fluid_prod_daily,
+                        COALESCE(wd.water_prod_daily, 0)/10000      water_prod_daily,
                         COALESCE(wd.water_cut, 0)      water_cut,
-                        COALESCE(wd.inj_vol_daily)  inj_vol_daily
+                        COALESCE(wd.inj_vol_daily)/10000  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')
@@ -57,12 +57,12 @@
             MAX(t.inj_vol_cum) vol
         FROM (  SELECT wm.well_id,
                     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,
-                    COALESCE(wm.liquid_prod_cum, 0) fluid_prod_mon,
+                    COALESCE(wm.gas_prod_cum, 0)/100000000 gas_prod_mon,
+                    COALESCE(wm.oil_prod_cum, 0)/10000 oil_prod_mon,
+                    COALESCE(wm.water_prod_cum, 0)/10000 water_prod_mon,
+                    COALESCE(wm.liquid_prod_cum, 0)/10000 fluid_prod_mon,
                     COALESCE(wm.water_cut, 0) water_cut,
-                    COALESCE(wm.inj_vol_cum, 0) inj_vol_cum
+                    COALESCE(wm.inj_vol_cum, 0)/10000 inj_vol_cum
                 FROM by_dwr.fact_dwr_pc_pro_well_vol_d wm
                 WHERE wm.prod_date is not null
                     and wm.prod_date <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
@@ -84,11 +84,11 @@
         FROM (  SELECT wm.well_id,
                     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.oil_prod_mon, 0)/10000 oil_prod_mon,
+                    COALESCE(wm.water_prod_mon, 0)/10000 water_prod_mon,
+                    COALESCE(wm.fluid_prod_mon, 0)/10000 fluid_prod_mon,
                     COALESCE(wm.water_cut_ratio_m, 0) water_cut_ratio_m,
-                    COALESCE(wm.inj_vol_mon, 0) inj_vol_mon
+                    COALESCE(wm.inj_vol_mon, 0)/10000 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')
@@ -112,11 +112,11 @@
         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.oil_prod_year, 0)/10000 oil_prod_year,
+                    COALESCE(wm.water_prod_year, 0)/10000 water_prod_year,
+                    COALESCE(wm.liquid_prod_year, 0)/10000 fluid_prod_year,
                     COALESCE(wm.water_cut_ratio_y, 0) water_cut_ratio_y,
-                    COALESCE(wm.inj_vol_year, 0) inj_vol_year
+                    COALESCE(wm.inj_vol_year, 0)/10000 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')

+ 20 - 4
src/main/resources/mapping/cquery/WellInfoCQuery.xml

@@ -60,10 +60,10 @@
         station.name  org_name_a1,
         TO_CHAR(fact_daily.oil_prod_begin_date , 'YYYY-MM-dd') oil_prod_begin_date,
         TO_CHAR(fact_daily.oil_prod_recent_date , 'YYYY-MM-dd') oil_prod_recent_date,
-        fact_daily.current_state,fact_daily.water_cut,fact_daily.oil_prod_cum oil_prod_year,
-        fact_daily.gas_prod_cum gas_prod_year,
-        fact_daily.inj_vol_cum water_prod_year,
-        fact_mon.oil_prod_mon,fact_mon.gas_prod_mon,fact_mon.inj_vol_mon water_prod_mon,
+        fact_daily.current_state,fact_daily.water_cut,fact_daily.oil_prod_cum/10000 oil_prod_year,
+        fact_daily.gas_prod_cum/100000000 gas_prod_year,
+        fact_daily.inj_vol_cum/10000 water_prod_year,
+        fact_mon.oil_prod_mon,fact_mon.gas_prod_mon/10000 gas_prod_mon,fact_mon.inj_vol_mon water_prod_mon,
         well_stt.well_coordinates_x x,
         well_stt.well_coordinates_y y,
         intr.well_state
@@ -370,4 +370,20 @@
                  left join BY_DIM.dim_well_type_desc desc4 on lv.well_type4_id = desc4.id
         where lv.is_effect = 1
     </select>
+    <select id="selectOrgProjectList" resultType="java.util.HashMap">
+        select *from by_dim.dim_org_project dop where 1=1
+
+        <if test="projectList!=null and projectList.size>0">
+            and dop.project_id in
+            <foreach collection="projectList" item="id" index="index" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+        </if>
+        <if test="orgList!=null and orgList.size>0">
+            and dop.org_id in
+            <foreach collection="orgList" item="id" index="index" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+        </if>
+    </select>
 </mapper>

+ 5 - 2
vue/src/views/wellinfo/index.vue

@@ -115,7 +115,7 @@
                   allow-clear
                   multiple
                   tree-line
-                  :tree-data="subjectTrees.constructUnitTree"
+                  :tree-data="filterUnitTree(subjectTrees.constructUnitTree)"
                   tree-node-filter-prop="label">
                 </a-tree-select>
               </a-form-item>
@@ -645,6 +645,9 @@ export default defineComponent({
         loadData();
       }
     }
+    function filterUnitTree(treeData){
+      return treeData;
+    }
     const showDoc = (id) => {
       get('wellInfo/getWellDocumentList', {wellId: id}).then(data => {
         docList.value = data;
@@ -659,7 +662,7 @@ export default defineComponent({
       route, selectedRowKeys, loading, activeTab, showTree, onSelectChange, data,
       expand, onQuery, loadData, onRangeChange, showQuery, wellTypeList, wellPurposeList, replaceFields,
       formRef, viewModel, handleTableChange, detail,
-      formState, isShowDoc, showDoc, docKey, docList, resetFields, showColumnType, filterColumns,
+      formState, isShowDoc, showDoc, docKey, docList, resetFields, showColumnType, filterColumns,filterUnitTree,
       labelCol, getTdColor, downFile,
       tabChange, onCheckboxChange, treeRef, colspan,
       treeOnExpand,