tao 2 éve
szülő
commit
85f9437690

+ 46 - 0
vseaf4.4-cyyzs/src/main/java/cn/com/victorysoft/business/cyyzs/controller/TubularStructureController.java

@@ -0,0 +1,46 @@
+package cn.com.victorysoft.business.cyyzs.controller;
+
+import cn.com.victorysoft.business.cyyzs.entity.ProductionData;
+import cn.com.victorysoft.business.cyyzs.entity.TubularStructure;
+import cn.com.victorysoft.business.cyyzs.entity.TubularStructureHome;
+import cn.com.victorysoft.business.cyyzs.service.TubularStructureService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author TY
+ * @Date: 2022/10/8 9:46
+ */
+@Api(tags = "管柱结构")
+@RestController
+@RequestMapping("cyyzs/tubular-structure")
+public class TubularStructureController {
+
+    @Autowired
+    private TubularStructureService tubularStructureService;
+
+    @GetMapping()
+    @ApiOperation("管柱结构首页")
+    public List<TubularStructureHome> selectList(String yclx, String cslb, String dwdm, String dydm) {
+        return tubularStructureService.selectList(yclx, cslb, dwdm, dydm);
+    }
+
+    @GetMapping("getBarData")
+    @ApiOperation("管柱结构首页柱状图数据")
+    public Map<String, Object> getBarData(String yclx, String cslb, String dwdm, String dydm) {
+        return tubularStructureService.getBarData(yclx, cslb, dwdm, dydm);
+    }
+
+    @GetMapping("details")
+    @ApiOperation("管柱结构")
+    public List<TubularStructure> selectDetails(String yclx, String dwdm, String dydm, String jh, String gylx, String fgq, String cdPsq, String xjf) {
+        return tubularStructureService.selectDetails(yclx, dwdm, dydm, jh, gylx, fgq, cdPsq, xjf);
+    }
+}

+ 55 - 0
vseaf4.4-cyyzs/src/main/java/cn/com/victorysoft/business/cyyzs/dao/TubularStructureDao.java

@@ -0,0 +1,55 @@
+package cn.com.victorysoft.business.cyyzs.dao;
+
+import cn.com.victorysoft.business.cyyzs.entity.TubularStructure;
+import cn.com.victorysoft.business.cyyzs.entity.TubularStructureHome;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author TY
+ * @Date: 2022/10/8 9:48
+ */
+@Mapper
+@Repository
+public interface TubularStructureDao {
+
+    /**
+     *
+     * @param yclx
+     * @param cslb
+     * @param dwdm
+     * @param dydm
+     * @return
+     */
+    List<TubularStructureHome> selectList(@Param("yclx") String yclx, @Param("cslb") String cslb, @Param("dwdm") String dwdm, @Param("dydm") String dydm);
+
+    /**
+     *
+     * @param yclx
+     * @param dwdm
+     * @param dydm
+     * @param jh
+     * @param gylx
+     * @param fgq
+     * @param cdPsq
+     * @param xjf
+     * @return
+     */
+    List<TubularStructure> selectDetails(@Param("yclx")String yclx   ,@Param("dwdm") String dwdm,@Param("dydm") String dydm,
+                                         @Param("jh") String jh      ,@Param("gylx") String gylx,@Param("fgq") String fgq,
+                                         @Param("cdPsq") String cdPsq,@Param("xjf") String xjf);
+
+    /**
+     *
+     * @param yclx
+     * @param cslb
+     * @param dwdm
+     * @param dydm
+     * @return
+     */
+//    List<TubularStructureHome> getBarData(@Param("yclx") String yclx,@Param("cslb") String cslb,@Param("dwdm") String dwdm,@Param("dydm") String dydm);
+}

+ 100 - 0
vseaf4.4-cyyzs/src/main/java/cn/com/victorysoft/business/cyyzs/entity/TubularStructure.java

@@ -0,0 +1,100 @@
+package cn.com.victorysoft.business.cyyzs.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Author TY
+ * @Date: 2022/10/8 9:49
+ */
+@Data
+public class TubularStructure implements Serializable {
+
+    /**
+     * 单位代码
+     */
+    private String dwdm;
+
+    /**
+     * 单元代码
+     */
+    private String dydm;
+
+    /**
+     * 井号
+     */
+    private String jh;
+
+    /**
+     * 完井日期
+     */
+    private Date wjrq;
+
+    /**
+     * 下一次作业日期
+     */
+    private Date nextZyrq;
+
+    /**
+     * 措施类别
+     */
+    private String cslb;
+
+    /**
+     * 在井时间
+     */
+    private BigDecimal zjsj;
+
+    /**
+     * 管柱有效期
+     */
+    private BigDecimal gzYxq;
+
+    /**
+     * 工艺类型
+     */
+    private String gylx;
+
+    /**
+     * 油管类型
+     */
+    private String yglx;
+
+    /**
+     * 分注级数
+     */
+    private String fzjs;
+
+    /**
+     * 分注段数
+     */
+    private String fzds;
+
+    /**
+     * 封隔器
+     */
+    private String fgq;
+
+    /**
+     * 测调配水器
+     */
+    private String cdPsq;
+
+    /**
+     * 锚定工具
+     */
+    private String mdgj;
+
+    /**
+     * 补偿工具
+     */
+    private String bcgj;
+
+    /**
+     * 洗井阀
+     */
+    private String xjf;
+}

+ 27 - 0
vseaf4.4-cyyzs/src/main/java/cn/com/victorysoft/business/cyyzs/entity/TubularStructureHome.java

@@ -0,0 +1,27 @@
+package cn.com.victorysoft.business.cyyzs.entity;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @Author TY
+ * @Date: 2022/10/10 13:43
+ */
+@Data
+public class TubularStructureHome {
+
+    private String gylx;
+
+    private BigDecimal zjsjxyyn;
+
+    private BigDecimal zjsjyen;
+
+    private BigDecimal zjsjesn;
+
+    private BigDecimal zjsjssn;
+
+    private BigDecimal zjsjswn;
+
+    private BigDecimal zjsjwnys;
+}

+ 65 - 0
vseaf4.4-cyyzs/src/main/java/cn/com/victorysoft/business/cyyzs/service/TubularStructureService.java

@@ -0,0 +1,65 @@
+package cn.com.victorysoft.business.cyyzs.service;
+
+import cn.com.victorysoft.business.cyyzs.dao.TubularStructureDao;
+import cn.com.victorysoft.business.cyyzs.entity.TubularStructure;
+import cn.com.victorysoft.business.cyyzs.entity.TubularStructureHome;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+/**
+ * @Author TY
+ * @Date: 2022/10/8 9:48
+ */
+@Slf4j
+@Service
+public class TubularStructureService {
+
+    @Autowired
+    private TubularStructureDao tubularStructureDao;
+
+
+    public List<TubularStructureHome> selectList(String yclx, String cslb, String dwdm, String dydm) {
+        return tubularStructureDao.selectList(yclx, cslb, dwdm, dydm);
+    }
+
+    public List<TubularStructure> selectDetails(String yclx, String dwdm, String dydm, String jh, String gylx, String fgq, String cdPsq, String xjf) {
+        return tubularStructureDao.selectDetails(yclx, dwdm, dydm, jh, gylx, fgq, cdPsq, xjf);
+    }
+
+    public Map<String, Object> getBarData(String yclx, String cslb, String dwdm, String dydm) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<Object> gylx = new LinkedList<>();
+        List<Object> zjsjxyyn = new LinkedList<>();
+        List<Object> zjsjyen  = new LinkedList<>();
+        List<Object> zjsjesn  = new LinkedList<>();
+        List<Object> zjsjssn  = new LinkedList<>();
+        List<Object> zjsjswn  = new LinkedList<>();
+        List<Object> zjsjwnys = new LinkedList<>();
+
+        List<TubularStructureHome> barDataList = tubularStructureDao.selectList(yclx, cslb, dwdm, dydm);
+
+        for (TubularStructureHome tubularStructureHome : barDataList) {
+            gylx.add(tubularStructureHome.getGylx());
+            zjsjxyyn.add(tubularStructureHome.getZjsjxyyn());
+            zjsjyen.add(tubularStructureHome.getZjsjyen());
+            zjsjesn.add(tubularStructureHome.getZjsjesn());
+            zjsjssn.add(tubularStructureHome.getZjsjssn());
+            zjsjswn.add(tubularStructureHome.getZjsjswn());
+            zjsjwnys.add(tubularStructureHome.getZjsjwnys());
+        }
+
+        result.put("gylx", gylx);
+        result.put("zjsjxyyn", zjsjxyyn);
+        result.put("zjsjyen", zjsjyen);
+        result.put("zjsjesn", zjsjesn);
+        result.put("zjsjssn", zjsjssn);
+        result.put("zjsjswn", zjsjswn);
+        result.put("zjsjwnys", zjsjwnys);
+
+        return result;
+    }
+}

+ 71 - 0
vseaf4.4-cyyzs/src/main/resources/mapper/TubularStructureDao.xml

@@ -0,0 +1,71 @@
+<?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="cn.com.victorysoft.business.cyyzs.dao.TubularStructureDao">
+
+    <select id="selectList" resultType="cn.com.victorysoft.business.cyyzs.entity.TubularStructureHome">
+        select
+            gylx,
+            sum(case when zjsj <![CDATA[ < ]]> 1 then 1 else 0 end) zjsjxyyn,
+            sum(case when zjsj >= 1 and zjsj <![CDATA[ < ]]> 2 then 1 else 0 end) zjsjyen,
+            sum(case when zjsj >= 2 and zjsj <![CDATA[ < ]]> 3 then 1 else 0 end) zjsjesn,
+            sum(case when zjsj >= 3 and zjsj <![CDATA[ < ]]> 4 then 1 else 0 end) zjsjssn,
+            sum(case when zjsj >= 4 and zjsj <![CDATA[ < ]]> 5 then 1 else 0 end) zjsjswn,
+            sum(case when zjsj >= 5 then 1 else 0 end) zjsjwnys
+        from
+            water_tubular_structure
+        where
+            1 = 1
+        <if test="yclx != null and yclx != ''"> </if>
+        <if test="dydm != null and dydm != ''"> and dydm = #{dydm}</if>
+        <if test="dwdm != null and dwdm != ''"> and dwdm = #{dwdm}</if>
+        <if test="cslb != null and cslb != ''"> and cslb = #{cslb}</if>
+        group by gylx
+    </select>
+    <select id="selectDetails" resultType="cn.com.victorysoft.business.cyyzs.entity.TubularStructure">
+        select
+            *
+        from
+            water_tubular_structure
+        where
+            1 = 1
+        <if test="yclx != null and yclx != ''"> </if>
+        <if test="dwdm != null and dwdm != ''"> and dwdm = #{dwdm}</if>
+        <if test="dydm != null and dydm != ''"> and dydm = #{dydm}</if>
+        <if test="jh != null and jh != ''"> and jh = #{jh}</if>
+        <if test="gylx != null and gylx != ''"> and gylx = #{gylx}</if>
+        <if test="fgq != null and fgq != ''"> and fgq = #{fgq}</if>
+        <if test="cdPsq != null and cdPsq != ''"> and cd_psq = #{cdPsq}</if>
+        <if test="xjf != null and xjf != ''"> and xjf = #{xjf}</if>
+    </select>
+
+
+<!--    <select id="getBarData" resultType="cn.com.victorysoft.business.cyyzs.entity.TubularStructureHome">-->
+<!--        select-->
+<!--            *-->
+<!--        from-->
+<!--        (-->
+<!--            select-->
+<!--                a.flag_code gylx,-->
+<!--                nvl(b.zjsjxyyn, 0) zjsjxyyn, nvl(b.zjsjyen, 0) zjsjyen, nvl(b.zjsjesn, 0) zjsjesn, nvl(b.zjsjssn, 0) zjsjssn, nvl(b.zjsjswn, 0) zjsjswn, nvl(b.zjsjwnys, 0) zjsjwnys-->
+<!--            from-->
+<!--                (select * from sys_flag where category_code = 'GYLX') a-->
+<!--            left join (-->
+<!--                select-->
+<!--                    gylx,-->
+<!--                    sum(case when zjsj <![CDATA[ < ]]> 1 then 1 else 0 end) zjsjxyyn,-->
+<!--                    sum(case when zjsj >= 1 and zjsj <![CDATA[ < ]]> 2 then 1 else 0 end) zjsjyen,-->
+<!--                    sum(case when zjsj >= 2 and zjsj <![CDATA[ < ]]> 3 then 1 else 0 end) zjsjesn,-->
+<!--                    sum(case when zjsj >= 3 and zjsj <![CDATA[ < ]]> 4 then 1 else 0 end) zjsjssn,-->
+<!--                    sum(case when zjsj >= 4 and zjsj <![CDATA[ < ]]> 5 then 1 else 0 end) zjsjswn,-->
+<!--                    sum(case when zjsj >= 5 then 1 else 0 end) zjsjwnys-->
+<!--                from-->
+<!--                    water_tubular_structure-->
+<!--                <if test="yclx != null and yclx != ''"> </if>-->
+<!--                <if test="dydm != null and dydm != ''"> and dydm = #{dydm}</if>-->
+<!--                <if test="dwdm != null and dwdm != ''"> and dwdm = #{dwdm}</if>-->
+<!--                <if test="cslb != null and cslb != ''"> and cslb = #{cslb}</if>-->
+<!--                group by gylx-->
+<!--            ) b on a.flag_code  = b.gylx-->
+<!--        ) a-->
+<!--    </select>-->
+</mapper>