tao пре 2 година
родитељ
комит
eaab3774f5

+ 3 - 2
vseaf4.4-cyyzs/src/main/java/cn/com/victorysoft/business/cyyzs/controller/FailureReasonController.java

@@ -5,6 +5,7 @@ import cn.com.victorysoft.business.cyyzs.entity.FailureReasonDetails;
 import cn.com.victorysoft.business.cyyzs.entity.TubularStructure;
 import cn.com.victorysoft.business.cyyzs.entity.TubularStructureHome;
 import cn.com.victorysoft.business.cyyzs.service.FailureReasonService;
+import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,8 +34,8 @@ public class FailureReasonController {
     }
 
     @GetMapping("details")
-    public List<FailureReasonDetails> selectDetails(String yclx, String dwdm, String dydm, String jh, String gylx) {
-        return failureReasonService.selectDetails(yclx, dwdm, dydm, jh, gylx);
+    public PageInfo<FailureReasonDetails> selectDetails(String yclx, String dwdm, String dydm, String jh, String gylx, Integer pageNum, Integer pageSize) {
+        return failureReasonService.selectDetails(yclx, dwdm, dydm, jh, gylx, pageNum, pageSize);
     }
 
     @GetMapping("bar-data")

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

@@ -4,8 +4,10 @@ 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 com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -40,7 +42,7 @@ public class TubularStructureController {
 
     @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);
+    public PageInfo<TubularStructure> selectDetails(String yclx, String dwdm, String dydm, String jh, String gylx, String fgq, String cdPsq, String xjf, Integer pageNum, Integer pageSize) {
+        return tubularStructureService.selectDetails(yclx, dwdm, dydm, jh, gylx, fgq, cdPsq, xjf, pageNum, pageSize);
     }
 }

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

@@ -13,6 +13,8 @@ public class TubularStructureHome {
 
     private String gylx;
 
+    private String gymc;
+
     private BigDecimal zjsjxyyn;
 
     private BigDecimal zjsjyen;

+ 13 - 7
vseaf4.4-cyyzs/src/main/java/cn/com/victorysoft/business/cyyzs/service/FailureReasonService.java

@@ -3,6 +3,8 @@ package cn.com.victorysoft.business.cyyzs.service;
 import cn.com.victorysoft.business.cyyzs.dao.FailureReasonDao;
 import cn.com.victorysoft.business.cyyzs.entity.FailureReason;
 import cn.com.victorysoft.business.cyyzs.entity.FailureReasonDetails;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -36,8 +38,9 @@ public class FailureReasonService {
         return failureReasonDetails;
     }
 
-    public List<FailureReasonDetails> selectDetails(String yclx, String dwdm, String dydm, String jh, String gylx) {
-        return failureReasonDao.selectDetails(yclx, dwdm, dydm, jh, gylx);
+    public PageInfo<FailureReasonDetails> selectDetails(String yclx, String dwdm, String dydm, String jh, String gylx, Integer pageNum, Integer pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        return new PageInfo<>(failureReasonDao.selectDetails(yclx, dwdm, dydm, jh, gylx));
     }
 
 
@@ -64,12 +67,15 @@ public class FailureReasonService {
         List<Map<String, Object>> list = new ArrayList<>();
         Map<String, Object> pieData = failureReasonDao.getPieData(yclx, dwdm, dydm, gylx);
 
-        for (String key : pieData.keySet()) {
-            Map<String, Object> map = new HashMap<>();
-            map.put("name", key);
-            map.put("value",  pieData.get(key));
-            list.add(map);
+        if (pieData != null) {
+            for (String key : pieData.keySet()) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("name", key);
+                map.put("value",  pieData.get(key));
+                list.add(map);
+            }
         }
+
         return list;
     }
 }

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

@@ -3,6 +3,8 @@ 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 com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -25,8 +27,9 @@ public class TubularStructureService {
         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 PageInfo<TubularStructure> selectDetails(String yclx, String dwdm, String dydm, String jh, String gylx, String fgq, String cdPsq, String xjf, Integer pageNum, Integer pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        return new PageInfo<>(tubularStructureDao.selectDetails(yclx, dwdm, dydm, jh, gylx, fgq, cdPsq, xjf));
     }
 
     public Map<String, Object> getBarData(String yclx, String cslb, String dwdm, String dydm) {
@@ -43,7 +46,7 @@ public class TubularStructureService {
         List<TubularStructureHome> barDataList = tubularStructureDao.selectList(yclx, cslb, dwdm, dydm);
 
         for (TubularStructureHome tubularStructureHome : barDataList) {
-            gylx.add(tubularStructureHome.getGylx());
+            gylx.add(tubularStructureHome.getGymc());
             zjsjxyyn.add(tubularStructureHome.getZjsjxyyn());
             zjsjyen.add(tubularStructureHome.getZjsjyen());
             zjsjesn.add(tubularStructureHome.getZjsjesn());

+ 5 - 5
vseaf4.4-cyyzs/src/main/resources/mapper/FailureReasonDao.xml

@@ -25,10 +25,10 @@
         where
             1 = 1
         <if test="jh != null and jh != ''"> and a.jh = #{jh}</if>
-        <if test="dwdm != null and dwdm != ''"> and a.dwdm = #{dwdm}</if>
         <if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
         <if test="yclx != null and yclx != ''"> and e.yclx = #{yclx}</if>
         <if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
+        <if test="dwdm != null and dwdm != ''"> and a.dwdm in (select unitcode from sys_unitinfo start with unitcode = #{dwdm} connect by p_unitcode = prior unitcode) </if>
     </select>
 
     <select id="selectListGroupGylx" resultType="cn.com.victorysoft.business.cyyzs.entity.FailureReason">
@@ -50,7 +50,7 @@
         <if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
         <if test="yclx != null and yclx != ''"> and b.yclx = #{yclx}</if>
         <if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
-        <if test="dwdm != null and dwdm != ''"> and a.dwdm = #{dwdm}</if>
+        <if test="dwdm != null and dwdm != ''"> and a.dwdm in (select unitcode from sys_unitinfo start with unitcode = #{dwdm} connect by p_unitcode = prior unitcode) </if>
         group by
             a.gylx
     </select>
@@ -74,7 +74,7 @@
         <if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
         <if test="yclx != null and yclx != ''"> and b.yclx = #{yclx}</if>
         <if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
-        <if test="dwdm != null and dwdm != ''"> and a.dwdm = #{dwdm}</if>
+        <if test="dwdm != null and dwdm != ''"> and a.dwdm in (select unitcode from sys_unitinfo start with unitcode = #{dwdm} connect by p_unitcode = prior unitcode) </if>
         group by
             b.yclx
     </select>
@@ -92,7 +92,7 @@
         <if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
         <if test="yclx != null and yclx != ''"> and b.yclx = #{yclx}</if>
         <if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
-        <if test="dwdm != null and dwdm != ''"> and a.dwdm = #{dwdm}</if>
+        <if test="dwdm != null and dwdm != ''"> and a.dwdm in (select unitcode from sys_unitinfo start with unitcode = #{dwdm} connect by p_unitcode = prior unitcode) </if>
         group by
             a.gylx
     </select>
@@ -114,6 +114,6 @@
         <if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
         <if test="yclx != null and yclx != ''"> and b.yclx = #{yclx}</if>
         <if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
-        <if test="dwdm != null and dwdm != ''"> and a.dwdm = #{dwdm}</if>
+        <if test="dwdm != null and dwdm != ''"> and a.dwdm in (select unitcode from sys_unitinfo start with unitcode = #{dwdm} connect by p_unitcode = prior unitcode) </if>
     </select>
 </mapper>

+ 1 - 1
vseaf4.4-cyyzs/src/main/resources/mapper/ProductionDataDao.xml

@@ -12,7 +12,7 @@
             SUM(ZCS) ZCS, SUM(KCS) KCS,
             SUM(CASE WHEN IS_JCJ >= 1 THEN 1 ELSE 0 END) JCJS,
             SUM(JCCS) JCCS, SUM(HGC) HGC, SUM(CZC) CZC, SUM(QZC) QZC, SUM(BQC) BQC,
-            CASE WHEN SUM(JCCS) = 0 THEN 0 ELSE ROUND((SUM(HGC) / SUM(JCCS)), 2) END HGL
+            ROUND(CASE WHEN SUM(JCCS) = 0 THEN 0 ELSE ROUND((SUM(HGC) / SUM(JCCS)), 2) END * 100, 2) HGL
         FROM
             (
             SELECT

+ 21 - 16
vseaf4.4-cyyzs/src/main/resources/mapper/TubularStructureDao.xml

@@ -4,22 +4,27 @@
 
     <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
+            a.*, b.flag_name gymc
+        from (
+            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
+        ) a
+        left join sys_flag b on a.gylx = b.flag_code
     </select>
 
     <select id="selectDetails" resultType="cn.com.victorysoft.business.cyyzs.entity.TubularStructure">