Browse Source

生产动态,多Grid型图表控件;单元格累产量控件数据库查询逻辑!

周壕 1 year ago
parent
commit
ddbcbef353

+ 31 - 0
src/main/java/com/bowintek/practice/controller/FactWellController.java

@@ -0,0 +1,31 @@
+package com.bowintek.practice.controller;
+
+import com.bowintek.practice.filter.exception.BaseResponse;
+import com.bowintek.practice.filter.exception.RespGenerstor;
+import com.bowintek.practice.services.service.AccountService;
+import com.bowintek.practice.services.service.FactWellService;
+import com.bowintek.practice.services.service.QueryLogService;
+import com.bowintek.practice.vo.EsQueryLogVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+
+@RestController
+@RequestMapping("/api/factwell")
+public class FactWellController {
+    @Autowired
+    private FactWellService factWellService;
+    @Autowired
+    private AccountService accountService;
+
+    @GetMapping("/getFactWellList")
+    public BaseResponse getFactWellList(String wellId, String timeType) {
+        return RespGenerstor.success(factWellService.getFactWellList(wellId, timeType));
+    }
+
+    @GetMapping("/getFactWellListByTime")
+    public BaseResponse getFactWellListByTime(String wellId, String timeType, Date startTime, Date endTime) {
+        return RespGenerstor.success(factWellService.getFactWellListByTime(wellId, timeType, startTime, endTime));
+    }
+}

+ 22 - 0
src/main/java/com/bowintek/practice/mapper/FactDwrPcProWellVolDMapper.java

@@ -0,0 +1,22 @@
+package com.bowintek.practice.mapper;
+
+import com.bowintek.practice.model.FactDwrPcProWellVolD;
+import com.bowintek.practice.model.FactDwrPcProWellVolDExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface FactDwrPcProWellVolDMapper {
+    long countByExample(FactDwrPcProWellVolDExample example);
+
+    int deleteByExample(FactDwrPcProWellVolDExample example);
+
+    int insert(FactDwrPcProWellVolD row);
+
+    int insertSelective(FactDwrPcProWellVolD row);
+
+    List<FactDwrPcProWellVolD> selectByExample(FactDwrPcProWellVolDExample example);
+
+    int updateByExampleSelective(@Param("row") FactDwrPcProWellVolD row, @Param("example") FactDwrPcProWellVolDExample example);
+
+    int updateByExample(@Param("row") FactDwrPcProWellVolD row, @Param("example") FactDwrPcProWellVolDExample example);
+}

+ 22 - 0
src/main/java/com/bowintek/practice/mapper/FactDwrPcProWellVolMMapper.java

@@ -0,0 +1,22 @@
+package com.bowintek.practice.mapper;
+
+import com.bowintek.practice.model.FactDwrPcProWellVolM;
+import com.bowintek.practice.model.FactDwrPcProWellVolMExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface FactDwrPcProWellVolMMapper {
+    long countByExample(FactDwrPcProWellVolMExample example);
+
+    int deleteByExample(FactDwrPcProWellVolMExample example);
+
+    int insert(FactDwrPcProWellVolM row);
+
+    int insertSelective(FactDwrPcProWellVolM row);
+
+    List<FactDwrPcProWellVolM> selectByExample(FactDwrPcProWellVolMExample example);
+
+    int updateByExampleSelective(@Param("row") FactDwrPcProWellVolM row, @Param("example") FactDwrPcProWellVolMExample example);
+
+    int updateByExample(@Param("row") FactDwrPcProWellVolM row, @Param("example") FactDwrPcProWellVolMExample example);
+}

+ 10 - 0
src/main/java/com/bowintek/practice/mapper/cquery/FactWellCQuery.java

@@ -0,0 +1,10 @@
+package com.bowintek.practice.mapper.cquery;
+
+import com.bowintek.practice.vo.FactWell.FactWellGroupList;
+import java.util.List;
+
+public interface FactWellCQuery {
+    List<FactWellGroupList> getDayGroupList(String wellId, String startDay, String endDay);
+    List<FactWellGroupList> getMonthGroupList(String wellId, String startDay, String endDay);
+    List<FactWellGroupList> getYearGroupList(String wellId, String startDay, String endDay);
+}

+ 216 - 0
src/main/java/com/bowintek/practice/model/FactDwrPcProWellVolD.java

@@ -0,0 +1,216 @@
+package com.bowintek.practice.model;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class FactDwrPcProWellVolD {
+    private String well_id;
+
+    private String well_common_name;
+
+    private Date prod_time;
+
+    private BigDecimal oil_prod_daily;
+
+    private BigDecimal water_prod_daily;
+
+    private BigDecimal gas_prod_daily;
+
+    private BigDecimal water_cut;
+
+    private BigDecimal sand_content_ratio;
+
+    private Date oil_prod_begin_date;
+
+    private Date oil_prod_recent_date;
+
+    private String well_type;
+
+    private Date spud_date;
+
+    private Date end_drilling_date;
+
+    private BigDecimal budgeted_md;
+
+    private Date completion_date;
+
+    private String current_state;
+
+    private BigDecimal oil_prod_latest_monthly;
+
+    private BigDecimal gas_prod_cum;
+
+    private BigDecimal water_prod_cum;
+
+    private BigDecimal oil_prod_cum;
+
+    private BigDecimal fluid_prod_daily;
+
+    public String getWell_id() {
+        return well_id;
+    }
+
+    public void setWell_id(String well_id) {
+        this.well_id = well_id == null ? null : well_id.trim();
+    }
+
+    public String getWell_common_name() {
+        return well_common_name;
+    }
+
+    public void setWell_common_name(String well_common_name) {
+        this.well_common_name = well_common_name == null ? null : well_common_name.trim();
+    }
+
+    public Date getProd_time() {
+        return prod_time;
+    }
+
+    public void setProd_time(Date prod_time) {
+        this.prod_time = prod_time;
+    }
+
+    public BigDecimal getOil_prod_daily() {
+        return oil_prod_daily;
+    }
+
+    public void setOil_prod_daily(BigDecimal oil_prod_daily) {
+        this.oil_prod_daily = oil_prod_daily;
+    }
+
+    public BigDecimal getWater_prod_daily() {
+        return water_prod_daily;
+    }
+
+    public void setWater_prod_daily(BigDecimal water_prod_daily) {
+        this.water_prod_daily = water_prod_daily;
+    }
+
+    public BigDecimal getGas_prod_daily() {
+        return gas_prod_daily;
+    }
+
+    public void setGas_prod_daily(BigDecimal gas_prod_daily) {
+        this.gas_prod_daily = gas_prod_daily;
+    }
+
+    public BigDecimal getWater_cut() {
+        return water_cut;
+    }
+
+    public void setWater_cut(BigDecimal water_cut) {
+        this.water_cut = water_cut;
+    }
+
+    public BigDecimal getSand_content_ratio() {
+        return sand_content_ratio;
+    }
+
+    public void setSand_content_ratio(BigDecimal sand_content_ratio) {
+        this.sand_content_ratio = sand_content_ratio;
+    }
+
+    public Date getOil_prod_begin_date() {
+        return oil_prod_begin_date;
+    }
+
+    public void setOil_prod_begin_date(Date oil_prod_begin_date) {
+        this.oil_prod_begin_date = oil_prod_begin_date;
+    }
+
+    public Date getOil_prod_recent_date() {
+        return oil_prod_recent_date;
+    }
+
+    public void setOil_prod_recent_date(Date oil_prod_recent_date) {
+        this.oil_prod_recent_date = oil_prod_recent_date;
+    }
+
+    public String getWell_type() {
+        return well_type;
+    }
+
+    public void setWell_type(String well_type) {
+        this.well_type = well_type == null ? null : well_type.trim();
+    }
+
+    public Date getSpud_date() {
+        return spud_date;
+    }
+
+    public void setSpud_date(Date spud_date) {
+        this.spud_date = spud_date;
+    }
+
+    public Date getEnd_drilling_date() {
+        return end_drilling_date;
+    }
+
+    public void setEnd_drilling_date(Date end_drilling_date) {
+        this.end_drilling_date = end_drilling_date;
+    }
+
+    public BigDecimal getBudgeted_md() {
+        return budgeted_md;
+    }
+
+    public void setBudgeted_md(BigDecimal budgeted_md) {
+        this.budgeted_md = budgeted_md;
+    }
+
+    public Date getCompletion_date() {
+        return completion_date;
+    }
+
+    public void setCompletion_date(Date completion_date) {
+        this.completion_date = completion_date;
+    }
+
+    public String getCurrent_state() {
+        return current_state;
+    }
+
+    public void setCurrent_state(String current_state) {
+        this.current_state = current_state == null ? null : current_state.trim();
+    }
+
+    public BigDecimal getOil_prod_latest_monthly() {
+        return oil_prod_latest_monthly;
+    }
+
+    public void setOil_prod_latest_monthly(BigDecimal oil_prod_latest_monthly) {
+        this.oil_prod_latest_monthly = oil_prod_latest_monthly;
+    }
+
+    public BigDecimal getGas_prod_cum() {
+        return gas_prod_cum;
+    }
+
+    public void setGas_prod_cum(BigDecimal gas_prod_cum) {
+        this.gas_prod_cum = gas_prod_cum;
+    }
+
+    public BigDecimal getWater_prod_cum() {
+        return water_prod_cum;
+    }
+
+    public void setWater_prod_cum(BigDecimal water_prod_cum) {
+        this.water_prod_cum = water_prod_cum;
+    }
+
+    public BigDecimal getOil_prod_cum() {
+        return oil_prod_cum;
+    }
+
+    public void setOil_prod_cum(BigDecimal oil_prod_cum) {
+        this.oil_prod_cum = oil_prod_cum;
+    }
+
+    public BigDecimal getFluid_prod_daily() {
+        return fluid_prod_daily;
+    }
+
+    public void setFluid_prod_daily(BigDecimal fluid_prod_daily) {
+        this.fluid_prod_daily = fluid_prod_daily;
+    }
+}

File diff suppressed because it is too large
+ 1528 - 0
src/main/java/com/bowintek/practice/model/FactDwrPcProWellVolDExample.java


+ 156 - 0
src/main/java/com/bowintek/practice/model/FactDwrPcProWellVolM.java

@@ -0,0 +1,156 @@
+package com.bowintek.practice.model;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class FactDwrPcProWellVolM {
+    private String well_id;
+
+    private String well_common_name;
+
+    private Date prod_time;
+
+    private BigDecimal fluid_prod_mon;
+
+    private BigDecimal oil_prod_mon;
+
+    private BigDecimal water_prod_mon;
+
+    private BigDecimal gas_prod_mon;
+
+    private String oil_prod_method;
+
+    private BigDecimal gas_oil_ratio;
+
+    private String stim_code;
+
+    private BigDecimal water_gas_ratio;
+
+    private BigDecimal gas_prod_year;
+
+    private BigDecimal water_prod_year;
+
+    private BigDecimal oil_prod_year;
+
+    private BigDecimal liquid_prod_year;
+
+    public String getWell_id() {
+        return well_id;
+    }
+
+    public void setWell_id(String well_id) {
+        this.well_id = well_id == null ? null : well_id.trim();
+    }
+
+    public String getWell_common_name() {
+        return well_common_name;
+    }
+
+    public void setWell_common_name(String well_common_name) {
+        this.well_common_name = well_common_name == null ? null : well_common_name.trim();
+    }
+
+    public Date getProd_time() {
+        return prod_time;
+    }
+
+    public void setProd_time(Date prod_time) {
+        this.prod_time = prod_time;
+    }
+
+    public BigDecimal getFluid_prod_mon() {
+        return fluid_prod_mon;
+    }
+
+    public void setFluid_prod_mon(BigDecimal fluid_prod_mon) {
+        this.fluid_prod_mon = fluid_prod_mon;
+    }
+
+    public BigDecimal getOil_prod_mon() {
+        return oil_prod_mon;
+    }
+
+    public void setOil_prod_mon(BigDecimal oil_prod_mon) {
+        this.oil_prod_mon = oil_prod_mon;
+    }
+
+    public BigDecimal getWater_prod_mon() {
+        return water_prod_mon;
+    }
+
+    public void setWater_prod_mon(BigDecimal water_prod_mon) {
+        this.water_prod_mon = water_prod_mon;
+    }
+
+    public BigDecimal getGas_prod_mon() {
+        return gas_prod_mon;
+    }
+
+    public void setGas_prod_mon(BigDecimal gas_prod_mon) {
+        this.gas_prod_mon = gas_prod_mon;
+    }
+
+    public String getOil_prod_method() {
+        return oil_prod_method;
+    }
+
+    public void setOil_prod_method(String oil_prod_method) {
+        this.oil_prod_method = oil_prod_method == null ? null : oil_prod_method.trim();
+    }
+
+    public BigDecimal getGas_oil_ratio() {
+        return gas_oil_ratio;
+    }
+
+    public void setGas_oil_ratio(BigDecimal gas_oil_ratio) {
+        this.gas_oil_ratio = gas_oil_ratio;
+    }
+
+    public String getStim_code() {
+        return stim_code;
+    }
+
+    public void setStim_code(String stim_code) {
+        this.stim_code = stim_code == null ? null : stim_code.trim();
+    }
+
+    public BigDecimal getWater_gas_ratio() {
+        return water_gas_ratio;
+    }
+
+    public void setWater_gas_ratio(BigDecimal water_gas_ratio) {
+        this.water_gas_ratio = water_gas_ratio;
+    }
+
+    public BigDecimal getGas_prod_year() {
+        return gas_prod_year;
+    }
+
+    public void setGas_prod_year(BigDecimal gas_prod_year) {
+        this.gas_prod_year = gas_prod_year;
+    }
+
+    public BigDecimal getWater_prod_year() {
+        return water_prod_year;
+    }
+
+    public void setWater_prod_year(BigDecimal water_prod_year) {
+        this.water_prod_year = water_prod_year;
+    }
+
+    public BigDecimal getOil_prod_year() {
+        return oil_prod_year;
+    }
+
+    public void setOil_prod_year(BigDecimal oil_prod_year) {
+        this.oil_prod_year = oil_prod_year;
+    }
+
+    public BigDecimal getLiquid_prod_year() {
+        return liquid_prod_year;
+    }
+
+    public void setLiquid_prod_year(BigDecimal liquid_prod_year) {
+        this.liquid_prod_year = liquid_prod_year;
+    }
+}

File diff suppressed because it is too large
+ 1168 - 0
src/main/java/com/bowintek/practice/model/FactDwrPcProWellVolMExample.java


+ 190 - 0
src/main/java/com/bowintek/practice/services/impl/FactWellServiceImpl.java

@@ -0,0 +1,190 @@
+package com.bowintek.practice.services.impl;
+
+import com.bowintek.practice.mapper.cquery.FactWellCQuery;
+import com.bowintek.practice.model.EsQueryLog;
+import com.bowintek.practice.services.service.FactWellService;
+import com.bowintek.practice.util.multipdb.DBTypeEnum;
+import com.bowintek.practice.util.multipdb.SwitchDataSource;
+import com.bowintek.practice.vo.EsQueryLogVo;
+import com.bowintek.practice.vo.FactWell.FactWellGroupList;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.Collator;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Component
+public class FactWellServiceImpl implements FactWellService {
+    @Autowired
+    private FactWellCQuery factWellCQuery;
+
+    @Override
+    @SwitchDataSource(DBTypeEnum.POSTGRE)
+    public List<FactWellGroupList> getFactWellList(String wellId, String timeType){
+        if(timeType.equals("day")) return getDayGroupList(wellId);
+        if(timeType.equals("month")) return getMonthGroupList(wellId);
+        else return getYearGroupList(wellId);
+    }
+
+    @Override
+    @SwitchDataSource(DBTypeEnum.POSTGRE)
+    public List<FactWellGroupList> getFactWellListByTime(String wellId, String timeType, Date startTime, Date endTime){
+        if(timeType.equals("day")) return getDayGroupList(wellId, startTime, endTime);
+        if(timeType.equals("month")) return getMonthGroupList(wellId, startTime, endTime);
+        else return getYearGroupList(wellId, startTime, endTime);
+    }
+
+    public List<FactWellGroupList> getDayGroupList(String wellId){
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(getToDay()); // 设置当前天日期
+        Date endTime = calendar.getTime();
+
+        calendar.add(Calendar.DAY_OF_MONTH, -29);
+        Date startTime = calendar.getTime();
+        return getDayGroupList(wellId, startTime, endTime);
+    }
+
+    public List<FactWellGroupList> getDayGroupList(String wellId, Date startTime, Date endTime){
+        //重新计算当前30天日期
+        if(startTime==null || endTime==null) return getDayGroupList(wellId);
+
+        List<FactWellGroupList> rtnList = factWellCQuery
+                .getDayGroupList(wellId, dateToDayString(startTime), dateToDayString(endTime));
+
+        //补充列表数据
+        List<String> dayList = new ArrayList<>();
+        for(Date time = startTime;time.getTime()<=endTime.getTime();){
+            Calendar calendarTime = Calendar.getInstance();
+            calendarTime.setTime(time);
+            dayList.add(dateToDayString(calendarTime.getTime()));
+            //下一天
+            calendarTime.add(Calendar.DAY_OF_MONTH, 1);
+            time = calendarTime.getTime();
+        }
+        rtnList = supplementList(wellId, dayList, rtnList);
+        return rtnList;
+    }
+
+    public Date getToDay(){
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+        return calendar.getTime();
+    }
+
+    public List<FactWellGroupList> getMonthGroupList(String wellId){
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(getToDay());
+        calendar.set(Calendar.DAY_OF_MONTH, 1);
+        //当月1号
+        Date endTime = calendar.getTime();
+        //11月前的1号
+        calendar.add(Calendar.MONTH, -11);
+        Date startTime = calendar.getTime();
+
+        return getMonthGroupList(wellId, startTime, endTime);
+    }
+    public List<FactWellGroupList> getMonthGroupList(String wellId, Date startTime, Date endTime){
+        //重新计算当前12月
+        if(startTime==null || endTime==null) return getMonthGroupList(wellId);
+
+        System.out.println("getMonthGroupList "+dateToDayString(startTime)+" "+dateToDayString(endTime));
+
+        List<FactWellGroupList> rtnList = factWellCQuery
+                .getMonthGroupList(wellId, dateToDayString(startTime), dateToDayString(endTime));
+
+        //补充列表数据
+        List<String> monthList = new ArrayList<>();
+        for(Date time = startTime;time.getTime()<=endTime.getTime();){
+            Calendar calendarTime = Calendar.getInstance();
+            calendarTime.setTime(time);
+            monthList.add(dateToMonthString(calendarTime.getTime()));
+            //下一月
+            calendarTime.add(Calendar.MONTH, 1);
+            time = calendarTime.getTime();
+        }
+
+        rtnList = supplementList(wellId, monthList, rtnList);
+        return rtnList;
+    }
+
+    public List<FactWellGroupList> getYearGroupList(String wellId){
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(getToDay());
+        calendar.set(Calendar.MONTH, 12);
+        calendar.set(Calendar.DAY_OF_MONTH, 1);
+        calendar.add(Calendar.MONTH, 1);
+        calendar.add(Calendar.DAY_OF_MONTH, -1);
+        //当年12月30日
+        Date endTime = calendar.getTime();
+        //5年前1月1日
+        calendar.add(Calendar.YEAR, -4);
+        calendar.set(Calendar.MONTH, 1);
+        calendar.set(Calendar.DAY_OF_MONTH, 1);
+        Date startTime = calendar.getTime();
+
+        return getYearGroupList(wellId, startTime, endTime);
+    }
+
+    public List<FactWellGroupList> getYearGroupList(String wellId, Date startTime, Date endTime){
+        //重新计算5年时间
+        if(startTime==null || endTime==null) return getYearGroupList(wellId);
+
+        System.out.println("getYearGroupList "+dateToDayString(startTime)+" "+dateToDayString(endTime));
+
+        List<FactWellGroupList> rtnList = factWellCQuery
+                .getYearGroupList(wellId, dateToDayString(startTime), dateToDayString(endTime));
+
+        //补充列表数据
+        List<String> monthList = new ArrayList<>();
+        for(Date time = startTime;time.getTime()<=endTime.getTime();){
+            Calendar calendarTime = Calendar.getInstance();
+            calendarTime.setTime(time);
+            monthList.add(dateToYearString(calendarTime.getTime()));
+            //下一年
+            calendarTime.add(Calendar.YEAR, 1);
+            time = calendarTime.getTime();
+        }
+
+        rtnList = supplementList(wellId, monthList, rtnList);
+        return rtnList;
+    }
+
+    public List<FactWellGroupList> supplementList(String wellId, List<String> timeList, List<FactWellGroupList> source){
+        //if(source.stream().filter(r->r.getTime_str().equals()))
+        for(int i=0;i<timeList.size();i++){
+            final String timeStr = timeList.get(i);
+            if(source.stream().filter(r->r.getTime_str().equals(timeStr))
+                    .collect(Collectors.toList()).size()==0){
+                source.add(FactWellGroupList.gen(wellId, timeStr));
+            }
+        }
+
+        Collections.sort(source, new Comparator<FactWellGroupList>() {
+            public int compare(FactWellGroupList o1, FactWellGroupList o2) {
+                Collator instance = Collator.getInstance(Locale.CHINA);
+                return instance.compare(o1.getTime_str(), o2.getTime_str());
+            }
+        });
+        return source;
+    }
+
+    public String dateToDayString(Date time){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        return sdf.format(time);
+    }
+    public String dateToMonthString(Date time){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月");
+        return sdf.format(time);
+    }
+    public String dateToYearString(Date time){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
+        return sdf.format(time);
+    }
+}

+ 11 - 0
src/main/java/com/bowintek/practice/services/service/FactWellService.java

@@ -0,0 +1,11 @@
+package com.bowintek.practice.services.service;
+
+import com.bowintek.practice.vo.FactWell.FactWellGroupList;
+
+import java.util.Date;
+import java.util.List;
+
+public interface FactWellService {
+    List<FactWellGroupList> getFactWellList(String wellId, String timeType);
+    List<FactWellGroupList> getFactWellListByTime(String wellId, String timeType, Date startTime, Date endTime);
+}

+ 26 - 0
src/main/java/com/bowintek/practice/vo/FactWell/FactWellGroupList.java

@@ -0,0 +1,26 @@
+package com.bowintek.practice.vo.FactWell;
+
+import lombok.Data;
+
+@Data
+public class FactWellGroupList {
+    private String well_id;
+    private String time_str;
+    private double gas;
+    private double oil;
+    private double water;
+    private double fluid;
+    private double watercut;
+
+    public static FactWellGroupList gen(String wellId, String timeStr){
+        FactWellGroupList obj = new FactWellGroupList();
+        obj.setWell_id(wellId);
+        obj.setTime_str(timeStr);
+        obj.setGas(0);
+        obj.setOil(0);
+        obj.setFluid(0);
+        obj.setWater(0);
+        obj.setWatercut(0);
+        return obj;
+    }
+}

+ 366 - 0
src/main/resources/mapping/FactDwrPcProWellVolDMapper.xml

@@ -0,0 +1,366 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.bowintek.practice.mapper.FactDwrPcProWellVolDMapper">
+  <resultMap id="BaseResultMap" type="com.bowintek.practice.model.FactDwrPcProWellVolD">
+    <result column="well_id" jdbcType="VARCHAR" property="well_id" />
+    <result column="well_common_name" jdbcType="VARCHAR" property="well_common_name" />
+    <result column="prod_time" jdbcType="DATE" property="prod_time" />
+    <result column="oil_prod_daily" jdbcType="NUMERIC" property="oil_prod_daily" />
+    <result column="water_prod_daily" jdbcType="NUMERIC" property="water_prod_daily" />
+    <result column="gas_prod_daily" jdbcType="NUMERIC" property="gas_prod_daily" />
+    <result column="water_cut" jdbcType="NUMERIC" property="water_cut" />
+    <result column="sand_content_ratio" jdbcType="NUMERIC" property="sand_content_ratio" />
+    <result column="oil_prod_begin_date" jdbcType="DATE" property="oil_prod_begin_date" />
+    <result column="oil_prod_recent_date" jdbcType="DATE" property="oil_prod_recent_date" />
+    <result column="well_type" jdbcType="VARCHAR" property="well_type" />
+    <result column="spud_date" jdbcType="DATE" property="spud_date" />
+    <result column="end_drilling_date" jdbcType="DATE" property="end_drilling_date" />
+    <result column="budgeted_md" jdbcType="NUMERIC" property="budgeted_md" />
+    <result column="completion_date" jdbcType="DATE" property="completion_date" />
+    <result column="current_state" jdbcType="VARCHAR" property="current_state" />
+    <result column="oil_prod_latest_monthly" jdbcType="NUMERIC" property="oil_prod_latest_monthly" />
+    <result column="gas_prod_cum" jdbcType="NUMERIC" property="gas_prod_cum" />
+    <result column="water_prod_cum" jdbcType="NUMERIC" property="water_prod_cum" />
+    <result column="oil_prod_cum" jdbcType="NUMERIC" property="oil_prod_cum" />
+    <result column="fluid_prod_daily" jdbcType="NUMERIC" property="fluid_prod_daily" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    well_id, well_common_name, prod_time, oil_prod_daily, water_prod_daily, gas_prod_daily, 
+    water_cut, sand_content_ratio, oil_prod_begin_date, oil_prod_recent_date, well_type, 
+    spud_date, end_drilling_date, budgeted_md, completion_date, current_state, oil_prod_latest_monthly, 
+    gas_prod_cum, water_prod_cum, oil_prod_cum, fluid_prod_daily
+  </sql>
+  <select id="selectByExample" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolDExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from fact_dwr_pc_pro_well_vol_d
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <delete id="deleteByExample" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolDExample">
+    delete from fact_dwr_pc_pro_well_vol_d
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolD">
+    insert into fact_dwr_pc_pro_well_vol_d (well_id, well_common_name, prod_time, 
+      oil_prod_daily, water_prod_daily, gas_prod_daily, 
+      water_cut, sand_content_ratio, oil_prod_begin_date, 
+      oil_prod_recent_date, well_type, spud_date, 
+      end_drilling_date, budgeted_md, completion_date, 
+      current_state, oil_prod_latest_monthly, 
+      gas_prod_cum, water_prod_cum, oil_prod_cum, 
+      fluid_prod_daily)
+    values (#{well_id,jdbcType=VARCHAR}, #{well_common_name,jdbcType=VARCHAR}, #{prod_time,jdbcType=DATE}, 
+      #{oil_prod_daily,jdbcType=NUMERIC}, #{water_prod_daily,jdbcType=NUMERIC}, #{gas_prod_daily,jdbcType=NUMERIC}, 
+      #{water_cut,jdbcType=NUMERIC}, #{sand_content_ratio,jdbcType=NUMERIC}, #{oil_prod_begin_date,jdbcType=DATE}, 
+      #{oil_prod_recent_date,jdbcType=DATE}, #{well_type,jdbcType=VARCHAR}, #{spud_date,jdbcType=DATE}, 
+      #{end_drilling_date,jdbcType=DATE}, #{budgeted_md,jdbcType=NUMERIC}, #{completion_date,jdbcType=DATE}, 
+      #{current_state,jdbcType=VARCHAR}, #{oil_prod_latest_monthly,jdbcType=NUMERIC}, 
+      #{gas_prod_cum,jdbcType=NUMERIC}, #{water_prod_cum,jdbcType=NUMERIC}, #{oil_prod_cum,jdbcType=NUMERIC}, 
+      #{fluid_prod_daily,jdbcType=NUMERIC})
+  </insert>
+  <insert id="insertSelective" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolD">
+    insert into fact_dwr_pc_pro_well_vol_d
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="well_id != null">
+        well_id,
+      </if>
+      <if test="well_common_name != null">
+        well_common_name,
+      </if>
+      <if test="prod_time != null">
+        prod_time,
+      </if>
+      <if test="oil_prod_daily != null">
+        oil_prod_daily,
+      </if>
+      <if test="water_prod_daily != null">
+        water_prod_daily,
+      </if>
+      <if test="gas_prod_daily != null">
+        gas_prod_daily,
+      </if>
+      <if test="water_cut != null">
+        water_cut,
+      </if>
+      <if test="sand_content_ratio != null">
+        sand_content_ratio,
+      </if>
+      <if test="oil_prod_begin_date != null">
+        oil_prod_begin_date,
+      </if>
+      <if test="oil_prod_recent_date != null">
+        oil_prod_recent_date,
+      </if>
+      <if test="well_type != null">
+        well_type,
+      </if>
+      <if test="spud_date != null">
+        spud_date,
+      </if>
+      <if test="end_drilling_date != null">
+        end_drilling_date,
+      </if>
+      <if test="budgeted_md != null">
+        budgeted_md,
+      </if>
+      <if test="completion_date != null">
+        completion_date,
+      </if>
+      <if test="current_state != null">
+        current_state,
+      </if>
+      <if test="oil_prod_latest_monthly != null">
+        oil_prod_latest_monthly,
+      </if>
+      <if test="gas_prod_cum != null">
+        gas_prod_cum,
+      </if>
+      <if test="water_prod_cum != null">
+        water_prod_cum,
+      </if>
+      <if test="oil_prod_cum != null">
+        oil_prod_cum,
+      </if>
+      <if test="fluid_prod_daily != null">
+        fluid_prod_daily,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="well_id != null">
+        #{well_id,jdbcType=VARCHAR},
+      </if>
+      <if test="well_common_name != null">
+        #{well_common_name,jdbcType=VARCHAR},
+      </if>
+      <if test="prod_time != null">
+        #{prod_time,jdbcType=DATE},
+      </if>
+      <if test="oil_prod_daily != null">
+        #{oil_prod_daily,jdbcType=NUMERIC},
+      </if>
+      <if test="water_prod_daily != null">
+        #{water_prod_daily,jdbcType=NUMERIC},
+      </if>
+      <if test="gas_prod_daily != null">
+        #{gas_prod_daily,jdbcType=NUMERIC},
+      </if>
+      <if test="water_cut != null">
+        #{water_cut,jdbcType=NUMERIC},
+      </if>
+      <if test="sand_content_ratio != null">
+        #{sand_content_ratio,jdbcType=NUMERIC},
+      </if>
+      <if test="oil_prod_begin_date != null">
+        #{oil_prod_begin_date,jdbcType=DATE},
+      </if>
+      <if test="oil_prod_recent_date != null">
+        #{oil_prod_recent_date,jdbcType=DATE},
+      </if>
+      <if test="well_type != null">
+        #{well_type,jdbcType=VARCHAR},
+      </if>
+      <if test="spud_date != null">
+        #{spud_date,jdbcType=DATE},
+      </if>
+      <if test="end_drilling_date != null">
+        #{end_drilling_date,jdbcType=DATE},
+      </if>
+      <if test="budgeted_md != null">
+        #{budgeted_md,jdbcType=NUMERIC},
+      </if>
+      <if test="completion_date != null">
+        #{completion_date,jdbcType=DATE},
+      </if>
+      <if test="current_state != null">
+        #{current_state,jdbcType=VARCHAR},
+      </if>
+      <if test="oil_prod_latest_monthly != null">
+        #{oil_prod_latest_monthly,jdbcType=NUMERIC},
+      </if>
+      <if test="gas_prod_cum != null">
+        #{gas_prod_cum,jdbcType=NUMERIC},
+      </if>
+      <if test="water_prod_cum != null">
+        #{water_prod_cum,jdbcType=NUMERIC},
+      </if>
+      <if test="oil_prod_cum != null">
+        #{oil_prod_cum,jdbcType=NUMERIC},
+      </if>
+      <if test="fluid_prod_daily != null">
+        #{fluid_prod_daily,jdbcType=NUMERIC},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolDExample" resultType="java.lang.Long">
+    select count(*) from fact_dwr_pc_pro_well_vol_d
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update fact_dwr_pc_pro_well_vol_d
+    <set>
+      <if test="row.well_id != null">
+        well_id = #{row.well_id,jdbcType=VARCHAR},
+      </if>
+      <if test="row.well_common_name != null">
+        well_common_name = #{row.well_common_name,jdbcType=VARCHAR},
+      </if>
+      <if test="row.prod_time != null">
+        prod_time = #{row.prod_time,jdbcType=DATE},
+      </if>
+      <if test="row.oil_prod_daily != null">
+        oil_prod_daily = #{row.oil_prod_daily,jdbcType=NUMERIC},
+      </if>
+      <if test="row.water_prod_daily != null">
+        water_prod_daily = #{row.water_prod_daily,jdbcType=NUMERIC},
+      </if>
+      <if test="row.gas_prod_daily != null">
+        gas_prod_daily = #{row.gas_prod_daily,jdbcType=NUMERIC},
+      </if>
+      <if test="row.water_cut != null">
+        water_cut = #{row.water_cut,jdbcType=NUMERIC},
+      </if>
+      <if test="row.sand_content_ratio != null">
+        sand_content_ratio = #{row.sand_content_ratio,jdbcType=NUMERIC},
+      </if>
+      <if test="row.oil_prod_begin_date != null">
+        oil_prod_begin_date = #{row.oil_prod_begin_date,jdbcType=DATE},
+      </if>
+      <if test="row.oil_prod_recent_date != null">
+        oil_prod_recent_date = #{row.oil_prod_recent_date,jdbcType=DATE},
+      </if>
+      <if test="row.well_type != null">
+        well_type = #{row.well_type,jdbcType=VARCHAR},
+      </if>
+      <if test="row.spud_date != null">
+        spud_date = #{row.spud_date,jdbcType=DATE},
+      </if>
+      <if test="row.end_drilling_date != null">
+        end_drilling_date = #{row.end_drilling_date,jdbcType=DATE},
+      </if>
+      <if test="row.budgeted_md != null">
+        budgeted_md = #{row.budgeted_md,jdbcType=NUMERIC},
+      </if>
+      <if test="row.completion_date != null">
+        completion_date = #{row.completion_date,jdbcType=DATE},
+      </if>
+      <if test="row.current_state != null">
+        current_state = #{row.current_state,jdbcType=VARCHAR},
+      </if>
+      <if test="row.oil_prod_latest_monthly != null">
+        oil_prod_latest_monthly = #{row.oil_prod_latest_monthly,jdbcType=NUMERIC},
+      </if>
+      <if test="row.gas_prod_cum != null">
+        gas_prod_cum = #{row.gas_prod_cum,jdbcType=NUMERIC},
+      </if>
+      <if test="row.water_prod_cum != null">
+        water_prod_cum = #{row.water_prod_cum,jdbcType=NUMERIC},
+      </if>
+      <if test="row.oil_prod_cum != null">
+        oil_prod_cum = #{row.oil_prod_cum,jdbcType=NUMERIC},
+      </if>
+      <if test="row.fluid_prod_daily != null">
+        fluid_prod_daily = #{row.fluid_prod_daily,jdbcType=NUMERIC},
+      </if>
+    </set>
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update fact_dwr_pc_pro_well_vol_d
+    set well_id = #{row.well_id,jdbcType=VARCHAR},
+      well_common_name = #{row.well_common_name,jdbcType=VARCHAR},
+      prod_time = #{row.prod_time,jdbcType=DATE},
+      oil_prod_daily = #{row.oil_prod_daily,jdbcType=NUMERIC},
+      water_prod_daily = #{row.water_prod_daily,jdbcType=NUMERIC},
+      gas_prod_daily = #{row.gas_prod_daily,jdbcType=NUMERIC},
+      water_cut = #{row.water_cut,jdbcType=NUMERIC},
+      sand_content_ratio = #{row.sand_content_ratio,jdbcType=NUMERIC},
+      oil_prod_begin_date = #{row.oil_prod_begin_date,jdbcType=DATE},
+      oil_prod_recent_date = #{row.oil_prod_recent_date,jdbcType=DATE},
+      well_type = #{row.well_type,jdbcType=VARCHAR},
+      spud_date = #{row.spud_date,jdbcType=DATE},
+      end_drilling_date = #{row.end_drilling_date,jdbcType=DATE},
+      budgeted_md = #{row.budgeted_md,jdbcType=NUMERIC},
+      completion_date = #{row.completion_date,jdbcType=DATE},
+      current_state = #{row.current_state,jdbcType=VARCHAR},
+      oil_prod_latest_monthly = #{row.oil_prod_latest_monthly,jdbcType=NUMERIC},
+      gas_prod_cum = #{row.gas_prod_cum,jdbcType=NUMERIC},
+      water_prod_cum = #{row.water_prod_cum,jdbcType=NUMERIC},
+      oil_prod_cum = #{row.oil_prod_cum,jdbcType=NUMERIC},
+      fluid_prod_daily = #{row.fluid_prod_daily,jdbcType=NUMERIC}
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+</mapper>

+ 295 - 0
src/main/resources/mapping/FactDwrPcProWellVolMMapper.xml

@@ -0,0 +1,295 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.bowintek.practice.mapper.FactDwrPcProWellVolMMapper">
+  <resultMap id="BaseResultMap" type="com.bowintek.practice.model.FactDwrPcProWellVolM">
+    <result column="well_id" jdbcType="VARCHAR" property="well_id" />
+    <result column="well_common_name" jdbcType="VARCHAR" property="well_common_name" />
+    <result column="prod_time" jdbcType="DATE" property="prod_time" />
+    <result column="fluid_prod_mon" jdbcType="NUMERIC" property="fluid_prod_mon" />
+    <result column="oil_prod_mon" jdbcType="NUMERIC" property="oil_prod_mon" />
+    <result column="water_prod_mon" jdbcType="NUMERIC" property="water_prod_mon" />
+    <result column="gas_prod_mon" jdbcType="NUMERIC" property="gas_prod_mon" />
+    <result column="oil_prod_method" jdbcType="VARCHAR" property="oil_prod_method" />
+    <result column="gas_oil_ratio" jdbcType="NUMERIC" property="gas_oil_ratio" />
+    <result column="stim_code" jdbcType="VARCHAR" property="stim_code" />
+    <result column="water_gas_ratio" jdbcType="NUMERIC" property="water_gas_ratio" />
+    <result column="gas_prod_year" jdbcType="NUMERIC" property="gas_prod_year" />
+    <result column="water_prod_year" jdbcType="NUMERIC" property="water_prod_year" />
+    <result column="oil_prod_year" jdbcType="NUMERIC" property="oil_prod_year" />
+    <result column="liquid_prod_year" jdbcType="NUMERIC" property="liquid_prod_year" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    well_id, well_common_name, prod_time, fluid_prod_mon, oil_prod_mon, water_prod_mon, 
+    gas_prod_mon, oil_prod_method, gas_oil_ratio, stim_code, water_gas_ratio, gas_prod_year, 
+    water_prod_year, oil_prod_year, liquid_prod_year
+  </sql>
+  <select id="selectByExample" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolMExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from fact_dwr_pc_pro_well_vol_m
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <delete id="deleteByExample" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolMExample">
+    delete from fact_dwr_pc_pro_well_vol_m
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolM">
+    insert into fact_dwr_pc_pro_well_vol_m (well_id, well_common_name, prod_time, 
+      fluid_prod_mon, oil_prod_mon, water_prod_mon, 
+      gas_prod_mon, oil_prod_method, gas_oil_ratio, 
+      stim_code, water_gas_ratio, gas_prod_year, 
+      water_prod_year, oil_prod_year, liquid_prod_year
+      )
+    values (#{well_id,jdbcType=VARCHAR}, #{well_common_name,jdbcType=VARCHAR}, #{prod_time,jdbcType=DATE}, 
+      #{fluid_prod_mon,jdbcType=NUMERIC}, #{oil_prod_mon,jdbcType=NUMERIC}, #{water_prod_mon,jdbcType=NUMERIC}, 
+      #{gas_prod_mon,jdbcType=NUMERIC}, #{oil_prod_method,jdbcType=VARCHAR}, #{gas_oil_ratio,jdbcType=NUMERIC}, 
+      #{stim_code,jdbcType=VARCHAR}, #{water_gas_ratio,jdbcType=NUMERIC}, #{gas_prod_year,jdbcType=NUMERIC}, 
+      #{water_prod_year,jdbcType=NUMERIC}, #{oil_prod_year,jdbcType=NUMERIC}, #{liquid_prod_year,jdbcType=NUMERIC}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolM">
+    insert into fact_dwr_pc_pro_well_vol_m
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="well_id != null">
+        well_id,
+      </if>
+      <if test="well_common_name != null">
+        well_common_name,
+      </if>
+      <if test="prod_time != null">
+        prod_time,
+      </if>
+      <if test="fluid_prod_mon != null">
+        fluid_prod_mon,
+      </if>
+      <if test="oil_prod_mon != null">
+        oil_prod_mon,
+      </if>
+      <if test="water_prod_mon != null">
+        water_prod_mon,
+      </if>
+      <if test="gas_prod_mon != null">
+        gas_prod_mon,
+      </if>
+      <if test="oil_prod_method != null">
+        oil_prod_method,
+      </if>
+      <if test="gas_oil_ratio != null">
+        gas_oil_ratio,
+      </if>
+      <if test="stim_code != null">
+        stim_code,
+      </if>
+      <if test="water_gas_ratio != null">
+        water_gas_ratio,
+      </if>
+      <if test="gas_prod_year != null">
+        gas_prod_year,
+      </if>
+      <if test="water_prod_year != null">
+        water_prod_year,
+      </if>
+      <if test="oil_prod_year != null">
+        oil_prod_year,
+      </if>
+      <if test="liquid_prod_year != null">
+        liquid_prod_year,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="well_id != null">
+        #{well_id,jdbcType=VARCHAR},
+      </if>
+      <if test="well_common_name != null">
+        #{well_common_name,jdbcType=VARCHAR},
+      </if>
+      <if test="prod_time != null">
+        #{prod_time,jdbcType=DATE},
+      </if>
+      <if test="fluid_prod_mon != null">
+        #{fluid_prod_mon,jdbcType=NUMERIC},
+      </if>
+      <if test="oil_prod_mon != null">
+        #{oil_prod_mon,jdbcType=NUMERIC},
+      </if>
+      <if test="water_prod_mon != null">
+        #{water_prod_mon,jdbcType=NUMERIC},
+      </if>
+      <if test="gas_prod_mon != null">
+        #{gas_prod_mon,jdbcType=NUMERIC},
+      </if>
+      <if test="oil_prod_method != null">
+        #{oil_prod_method,jdbcType=VARCHAR},
+      </if>
+      <if test="gas_oil_ratio != null">
+        #{gas_oil_ratio,jdbcType=NUMERIC},
+      </if>
+      <if test="stim_code != null">
+        #{stim_code,jdbcType=VARCHAR},
+      </if>
+      <if test="water_gas_ratio != null">
+        #{water_gas_ratio,jdbcType=NUMERIC},
+      </if>
+      <if test="gas_prod_year != null">
+        #{gas_prod_year,jdbcType=NUMERIC},
+      </if>
+      <if test="water_prod_year != null">
+        #{water_prod_year,jdbcType=NUMERIC},
+      </if>
+      <if test="oil_prod_year != null">
+        #{oil_prod_year,jdbcType=NUMERIC},
+      </if>
+      <if test="liquid_prod_year != null">
+        #{liquid_prod_year,jdbcType=NUMERIC},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolMExample" resultType="java.lang.Long">
+    select count(*) from fact_dwr_pc_pro_well_vol_m
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update fact_dwr_pc_pro_well_vol_m
+    <set>
+      <if test="row.well_id != null">
+        well_id = #{row.well_id,jdbcType=VARCHAR},
+      </if>
+      <if test="row.well_common_name != null">
+        well_common_name = #{row.well_common_name,jdbcType=VARCHAR},
+      </if>
+      <if test="row.prod_time != null">
+        prod_time = #{row.prod_time,jdbcType=DATE},
+      </if>
+      <if test="row.fluid_prod_mon != null">
+        fluid_prod_mon = #{row.fluid_prod_mon,jdbcType=NUMERIC},
+      </if>
+      <if test="row.oil_prod_mon != null">
+        oil_prod_mon = #{row.oil_prod_mon,jdbcType=NUMERIC},
+      </if>
+      <if test="row.water_prod_mon != null">
+        water_prod_mon = #{row.water_prod_mon,jdbcType=NUMERIC},
+      </if>
+      <if test="row.gas_prod_mon != null">
+        gas_prod_mon = #{row.gas_prod_mon,jdbcType=NUMERIC},
+      </if>
+      <if test="row.oil_prod_method != null">
+        oil_prod_method = #{row.oil_prod_method,jdbcType=VARCHAR},
+      </if>
+      <if test="row.gas_oil_ratio != null">
+        gas_oil_ratio = #{row.gas_oil_ratio,jdbcType=NUMERIC},
+      </if>
+      <if test="row.stim_code != null">
+        stim_code = #{row.stim_code,jdbcType=VARCHAR},
+      </if>
+      <if test="row.water_gas_ratio != null">
+        water_gas_ratio = #{row.water_gas_ratio,jdbcType=NUMERIC},
+      </if>
+      <if test="row.gas_prod_year != null">
+        gas_prod_year = #{row.gas_prod_year,jdbcType=NUMERIC},
+      </if>
+      <if test="row.water_prod_year != null">
+        water_prod_year = #{row.water_prod_year,jdbcType=NUMERIC},
+      </if>
+      <if test="row.oil_prod_year != null">
+        oil_prod_year = #{row.oil_prod_year,jdbcType=NUMERIC},
+      </if>
+      <if test="row.liquid_prod_year != null">
+        liquid_prod_year = #{row.liquid_prod_year,jdbcType=NUMERIC},
+      </if>
+    </set>
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update fact_dwr_pc_pro_well_vol_m
+    set well_id = #{row.well_id,jdbcType=VARCHAR},
+      well_common_name = #{row.well_common_name,jdbcType=VARCHAR},
+      prod_time = #{row.prod_time,jdbcType=DATE},
+      fluid_prod_mon = #{row.fluid_prod_mon,jdbcType=NUMERIC},
+      oil_prod_mon = #{row.oil_prod_mon,jdbcType=NUMERIC},
+      water_prod_mon = #{row.water_prod_mon,jdbcType=NUMERIC},
+      gas_prod_mon = #{row.gas_prod_mon,jdbcType=NUMERIC},
+      oil_prod_method = #{row.oil_prod_method,jdbcType=VARCHAR},
+      gas_oil_ratio = #{row.gas_oil_ratio,jdbcType=NUMERIC},
+      stim_code = #{row.stim_code,jdbcType=VARCHAR},
+      water_gas_ratio = #{row.water_gas_ratio,jdbcType=NUMERIC},
+      gas_prod_year = #{row.gas_prod_year,jdbcType=NUMERIC},
+      water_prod_year = #{row.water_prod_year,jdbcType=NUMERIC},
+      oil_prod_year = #{row.oil_prod_year,jdbcType=NUMERIC},
+      liquid_prod_year = #{row.liquid_prod_year,jdbcType=NUMERIC}
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+</mapper>

+ 76 - 0
src/main/resources/mapping/cquery/FactWellCQuery.xml

@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.bowintek.practice.mapper.cquery.FactWellCQuery">
+    <select id="getDayGroupList" resultType="com.bowintek.practice.vo.FactWell.FactWellGroupList">
+        SELECT  t.well_id,
+                t.prod_time_str time_str,
+                SUM(t.gas_prod_daily) gas,
+                SUM(t.oil_prod_daily) oil,
+                SUM(t.fluid_prod_daily) fluid,
+                SUM(t.water_prod_daily) water,
+                SUM(t.water_cut) watercut
+        FROM (  SELECT  wd.well_id,
+                        to_char(wd.prod_time, '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
+                FROM fact_dwr_pc_pro_well_vol_d wd
+                WHERE wd.prod_time <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
+                    and wd.prod_time <![CDATA[ <= ]]> to_date(#{endDay},'YYYY-MM-DD')
+        <if test="wellId!='' and wellId!=null">
+            and wd.well_id=#{wellId}
+        </if>
+            ) t
+        GROUP BY t.well_id, t.prod_time_str
+    </select>
+
+    <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
+        FROM (  SELECT wm.well_id,
+                    to_char(wm.prod_time, '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
+                FROM fact_dwr_pc_pro_well_vol_m wm
+                WHERE wm.prod_time <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
+                    and wm.prod_time <![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,
+            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
+        FROM (  SELECT wm.well_id,
+                    to_char(wm.prod_time, 'YYYY') 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
+                FROM fact_dwr_pc_pro_well_vol_m wm
+                WHERE wm.prod_time <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
+                and wm.prod_time <![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>
+</mapper>

+ 38 - 17
vue/src/components/basic/chart/chart-cell.vue

@@ -12,10 +12,13 @@
 <script lang="ts">
   import {defineComponent, computed, markRaw} from 'vue';
   import * as echarts from "echarts";
+  import {get} from '@/api/common';
 
   export  default defineComponent ({
     props:{
-      datas : [] as any
+      wellId: null as any,
+      timeType : null as any, //日 day 月 month 年 year
+      dataType : null as any//gas产气量 oil产油量
     },
     name : 'ChartCell',
     data() {
@@ -27,18 +30,27 @@
         chart : null as any,
         serieType : 'line',
         id : Date.now(),
-        hovered : false
+        hovered : false,
+        datas : null
       }
     },
     setup(props, context){
       console.log("ChartCell setup" , props, context);
 
-      const datas = computed(() => {
-        return props.datas ? props.datas : []
+      const timeType = computed(() => {
+        return props.timeType ? props.timeType : 'day'
+      });
+      const dataType = computed(() => {
+        return props.dataType ? props.dataType : 'oil'
+      });
+      const wellId = computed(() => {
+        return props.wellId ? props.wellId : null
       });
 
       return{
-        datas
+        timeType,
+        dataType,
+        wellId
       }
     },
     mounted(){
@@ -47,30 +59,39 @@
       //this.readerChart();
     },
     methods:{
-      getxAxis:function (show){
+      getDatas:async function(){
+        //数据查询逻辑,如果不查询,改此方法返回数据即可
+        if(this.datas==null){
+          const result = await get('/factwell/getFactWellList',
+            { wellId: this.wellId, timeType: this.timeType });
+          this.datas = result;
+        }
+        return this.datas;
+      },
+      getxAxis:async function (show){
+        let dataArys = await this.getDatas();
         let xAxis = {type : 'category', data : [] as any, show : show, axisLabel:{rotate:50}};
         //数据组装,这里根据业务组装x轴数据
-        xAxis.data = ['2023年1月', '2023年2月', '2023年3月', '2023年4月', '2023年5月', '2023年6月',
-          '2023年7月', '2023年8月', '2023年9月', '2023年10月', '2023年11月', '2023年12月'];
+        (dataArys! as any).forEach(row=>{ xAxis.data.push(row.time_str) });
         return xAxis;
       },
       getyAxis:function (){
         return {type: 'value', min:'dataMin', max:'dataMax', show:false };
       },
-      getSeries:function (showSymbol){
+      getSeries:async function (showSymbol){
+        let dataArys = await this.getDatas();
         let series = [{type: this.serieType, data:[] as any, showSymbol:showSymbol}];
         //数据组装,这里根据业务组装y轴数据
-        series[0].data = [820, 932, 901, 934, 1290, 1330,
-        2000, 3000, 4000, 5000, 5000, 6000];
+        (dataArys! as any).forEach(row=>{ series[0].data.push(row[this.dataType]) });
         console.log("getSeries", series);
         return series;
       },
-      readerCell: function () {
+      readerCell: async function () {
         const option = {
           grid: { top: 0, left: 0, right: 0, bottom: 0, containLabel: false },
-          xAxis: this.getxAxis(false),
+          xAxis: await this.getxAxis(false),
           yAxis: this.getyAxis(),
-          series: this.getSeries(false)
+          series: await this.getSeries(false)
         };
         console.log("readerCell-"+this.serieType,option);
 
@@ -81,8 +102,8 @@
           this.cell.resize();
         }
       },
-      readerChart: function () {
-        let xAxis = this.getxAxis(true);
+      readerChart: async function () {
+        let xAxis = await this.getxAxis(true);
         xAxis['nameRotate'] = 0;
         const option = {
           title: { left: 'center', text: '累产量趋势图' },
@@ -90,7 +111,7 @@
           grid: { top:'15%', left: '8%', right: '3%', bottom: '6%', containLabel: true },
           xAxis: xAxis,
           yAxis: { name:'累产量', nameGap: 50, nameLocation:'center', type: 'value'},
-          series: this.getSeries(true)
+          series: await this.getSeries(true)
         };
         console.log("readerChart-"+this.serieType,option);
 

+ 46 - 31
vue/src/components/basic/chart/chart-prod-dynamics.vue

@@ -12,7 +12,9 @@
           <a-form-item
             label="统计起止日期"
             :label-col="{span:8}">
-            <a-range-picker format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']" @change="onRangeChange"/>
+            <a-range-picker format="YYYY-MM-DD"
+                            v-model:value="formState.days"
+                            :placeholder="['开始日期', '结束日期']" @change="onRangeChange"/>
           </a-form-item>
         </a-col>
 
@@ -22,7 +24,7 @@
             label="统计维度"
             :label-col="{span:12}">
             <a-select
-              v-model:value="formState.selectType"
+              v-model:value="formState.timeType"
               :options="getOptions()"
             ></a-select>
           </a-form-item>
@@ -54,12 +56,12 @@
 <script lang="ts">
   import {defineComponent, computed, markRaw, ref, reactive} from 'vue';
   import * as echarts from "echarts";
-  import dayjs from 'dayjs';
   import type {FormInstance} from 'ant-design-vue';
+  import {get} from '@/api/common';
 
   export  default defineComponent ({
     props:{
-      datas : [] as any
+      wellId: null as any
     },
     name : 'ChartProdDynmics',
     data() {
@@ -70,24 +72,27 @@
         serieType : 'line',
         id : Date.now(),
         hovered : false,
-        height : 130
+        height : 130,
+        datas : []
       }
     },
     setup(props, context){
       console.log("ChartCell setup" , props, context);
 
-      const datas = computed(() => {
-        return props.datas ? props.datas : []
+      const wellId = computed(() => {
+        return props.wellId ? props.wellId : null
       });
 
       const formRef = ref<FormInstance>();
       const formState = reactive({
-        selectType: "日",  beiginDate: '', endDate: '',
-        dataTypes : ['0', '1', '2', '5']
+        days:[null, null],
+        timeType: "day",  startTime: '', endTime: '',
+        dataTypes : ['oil', 'water', 'gas'],
+        wellId : wellId
       });
 
       return{
-        datas,
+        wellId,
         formRef,
         formState
       }
@@ -97,24 +102,38 @@
       this.readerChart();
     },
     methods:{
-      onFinish:function (){
+      onFinish: async function (){
+        let formatString = "YYYY-MM-DD";
+        if(this.formState.days[0]!=null)
+          this.formState.startTime = (this.formState.days[0] as any).format(formatString);
+        if(this.formState.days[1]!=null)
+          this.formState.endTime = (this.formState.days[1] as any).format(formatString);
+
+        this.datas = await get('/factwell/getFactWellListByTime', {
+          wellId : this.wellId,
+          timeType : this.formState.timeType,
+          startTime : this.formState.startTime,
+          endTime : this.formState.endTime
+        });
+        console.log("onFinish",this.datas);
         this.readerChart();
       },
       getChartStyle:function (){
         return { width: "100%", height: (this.height) * this.getTypes().length + 160 + "px" };
       },
       getOptions:function (){
-        return [{label:'日', value:'0'},
-          {label:'月', value:'1'},
-          {label:'年', value:'2'}];
+        return [{label:'日', value:'day'},
+          {label:'月', value:'month'},
+          {label:'年', value:'year'}];
       },
       getTypeOptions:function (){
-        return [{label:'产油量', value:'0'},
-          {label:'产水量', value:'1'},
-          {label:'产液量', value:'2'},
-          {label:'产气量', value:'3'},
-          {label:'含水率', value:'4'},
-          {label:'油井开井数', value:'5'}];
+        return [{label:'产油量', value:'oil'},
+          {label:'产水量', value:'water'},
+          {label:'产液量', value:'fluid'},
+          {label:'产气量', value:'gas'},
+          {label:'含水率', value:'watercut'},
+          //{label:'油井开井数', value:'5'}
+        ];
       },
       getTypes:function (){
         return this.getTypeOptions().filter((item) => {
@@ -123,24 +142,20 @@
       },
       getxDatas:function (){
         //根据后台数据生成需要显示的数据集
-        let day = dayjs();
-        let arys = [] as any;
-        for(let i=0;i<12;i++){
-          day = day.add(1, 'day');
-          arys.push(day.format('YYYY-MM-DD'));
-        }
+        let arys = (this.datas as any).map((item) => {
+          return item.time_str
+        });
         console.log("getxDatas",arys);
         return arys;
       },
       getyDatas:function (){
         //根据后台数据生成需要显示的数据集
         let datas = [] as any;
-        let xLength = this.getxDatas().length;
+        //let xLength = this.getxDatas().length;
         for(let i=0;i< this.getTypes().length;i++){
-          let arys = [] as any;
-          for(let n=0;n<xLength;n++){
-            arys.push(parseInt(Math.random() * (10000 - 1000 + 1) + 1000));
-          }
+          let arys = (this.datas as any).map((item) => {
+            return item[this.getTypes()[i].value];
+          });
           datas.push(arys);
         }
         console.log("getyDatas",datas);

+ 4 - 2
vue/src/views/position/test.vue

@@ -33,7 +33,9 @@
           <template v-if="column.dataIndex === 'chart'">
             <div style="height:40px">
               <!--列表单元格中显示曲线图,数据需要根据业务库整理-->
-              <ChartCell></ChartCell>
+              <!--timeType day month year-->
+              <!--dataType gas oil-->
+              <ChartCell :timeType="('month')" :dataType="('oil')" :wellId="('吉45-144(A2)')"></ChartCell>
             </div>
           </template>
         </template>
@@ -42,7 +44,7 @@
 
     <a-divider orientation="left">Grid类型的图表</a-divider>
     <div style="width:1200px;">
-      <ChartProdDynmics></ChartProdDynmics>
+      <ChartProdDynmics :wellId="('吉45-144(A2)')"></ChartProdDynmics>
     </div>
   </div>
 </template>