Pārlūkot izejas kodu

【CHG】修改查询字段

zhaomn 2 gadi atpakaļ
vecāks
revīzija
01329a9b77

+ 4 - 0
railway-business/src/main/java/com/railway/business/bi/domain/ShowGsd.java

@@ -36,6 +36,10 @@ public class ShowGsd extends BaseEntity {
   @Excel(name = "铁路线别")
   private String lineName;
 
+  @ApiModelProperty(value = "变配电所名称")
+  @Excel(name = "线路名称")
+  private String substationName;
+
   @ApiModelProperty(value = "架空线路 km")
   @Excel(name = "设备名称架空线路(km)")
   private BigDecimal jkxl;

+ 22 - 0
railway-business/src/main/java/com/railway/business/bi/mapper/ShowBpdjxjhMapper.java

@@ -60,4 +60,26 @@ public interface ShowBpdjxjhMapper {
   List<String> getLineList();
 
   Integer countUndone(@Param("month") int month);
+
+  /**
+   * 本月已完成数
+   */
+  Integer countByywc(@Param("month") int month);
+  /**
+   * 本月未完成数
+   */
+  Integer countBywwc(@Param("month") int month);
+  /**
+   * 下月计划完成数
+   */
+  Integer countXyjhwc(@Param("month") int month);
+  /**
+   * 年度剩余数
+   */
+  Integer countNdsys();
+  /**
+   * 未完成明细
+   */
+  List<String> listWwcmx(@Param("month") int month);
+
 }

+ 21 - 0
railway-business/src/main/java/com/railway/business/bi/mapper/ShowGsdMapper.java

@@ -5,6 +5,7 @@ import com.railway.business.bi.domain.ShowGsd;
 import com.railway.business.bi.domain.vo.GsdQuery;
 import com.railway.business.bi.domain.vo.QuarterTotalVO;
 import com.railway.business.bi.domain.vo.SingleTotalVO;
+import java.util.List;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
@@ -51,4 +52,24 @@ public interface ShowGsdMapper {
 
   Integer countUndone(@Param("month") int month);
 
+  /**
+   * 本月已完成数
+   */
+  Integer countByywc(@Param("month") int month);
+  /**
+   * 本月未完成数
+   */
+  Integer countBywwc(@Param("month") int month);
+  /**
+   * 下月计划完成数
+   */
+  Integer countXyjhwc(@Param("month") int month);
+  /**
+   * 年度剩余数
+   */
+  Integer countNdsys();
+  /**
+   * 未完成明细
+   */
+  List<String> listWwcmx(@Param("month") int month);
 }

+ 22 - 0
railway-business/src/main/java/com/railway/business/bi/mapper/ShowGsyMapper.java

@@ -5,6 +5,7 @@ import com.railway.business.bi.domain.ShowGsy;
 import com.railway.business.bi.domain.vo.GsyQuery;
 import com.railway.business.bi.domain.vo.QuarterTotalVO;
 import com.railway.business.bi.domain.vo.SingleTotalVO;
+import java.util.List;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
@@ -51,4 +52,25 @@ public interface ShowGsyMapper {
 
   Integer countUndone(@Param("month") int month);
 
+  /**
+   * 本月已完成数
+   */
+  Integer countByywc(@Param("month") int month);
+  /**
+   * 本月未完成数
+   */
+  Integer countBywwc(@Param("month") int month);
+  /**
+   * 下月计划完成数
+   */
+  Integer countXyjhwc(@Param("month") int month);
+  /**
+   * 年度剩余数
+   */
+  Integer countNdsys();
+  /**
+   * 未完成明细
+   */
+  List<String> listWwcmx(@Param("month") int month);
+
 }

+ 22 - 0
railway-business/src/main/java/com/railway/business/bi/mapper/ShowYdtsMapper.java

@@ -5,6 +5,7 @@ import com.railway.business.bi.domain.ShowYdts;
 import com.railway.business.bi.domain.vo.SingleTotalVO;
 import com.railway.business.bi.domain.vo.YdtsQuery;
 import com.railway.business.bi.domain.vo.QuarterTotalVO;
+import io.swagger.annotations.ApiModelProperty;
 import java.util.List;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -53,4 +54,25 @@ public interface ShowYdtsMapper {
 
     Integer countUndone(@Param("month") int month);
 
+    /**
+     * 本月已完成数
+     */
+    Integer countByywc(@Param("month") int month);
+    /**
+     * 本月未完成数
+     */
+    Integer countBywwc(@Param("month") int month);
+    /**
+     * 下月计划完成数
+     */
+    Integer countXyjhwc(@Param("month") int month);
+    /**
+     * 年度剩余数
+     */
+    Integer countNdsys();
+    /**
+     * 未完成明细
+     */
+    List<String> listWwcmx(@Param("month") int month);
+
 }

+ 42 - 47
railway-business/src/main/java/com/railway/business/bi/service/impl/DetailServiceImpl.java

@@ -1,8 +1,12 @@
 package com.railway.business.bi.service.impl;
 
 import com.railway.business.bi.domain.vo.ChartMsgVO;
+import com.railway.business.bi.mapper.ShowBpdjxjhMapper;
+import com.railway.business.bi.mapper.ShowGsdMapper;
+import com.railway.business.bi.mapper.ShowGsyMapper;
+import com.railway.business.bi.mapper.ShowYdtsMapper;
 import com.railway.business.bi.service.IDetailService;
-import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.List;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -19,6 +23,19 @@ import org.springframework.stereotype.Service;
 @Service
 public class DetailServiceImpl implements IDetailService {
 
+  private final ShowYdtsMapper ydtsMapper;
+  private final ShowGsdMapper gsdMapper;
+  private final ShowGsyMapper gsyMapper;
+  private final ShowBpdjxjhMapper bpdjxjhMapper;
+
+  public DetailServiceImpl(ShowYdtsMapper ydtsMapper, ShowGsdMapper gsdMapper,
+      ShowGsyMapper gsyMapper, ShowBpdjxjhMapper bpdjxjhMapper) {
+    this.ydtsMapper = ydtsMapper;
+    this.gsdMapper = gsdMapper;
+    this.gsyMapper = gsyMapper;
+    this.bpdjxjhMapper = bpdjxjhMapper;
+  }
+
   /**
    * 获取检修本月兑现情况描述
    *
@@ -26,16 +43,13 @@ public class DetailServiceImpl implements IDetailService {
    */
   @Override
   public ChartMsgVO getChartJxdxqkbyDetail() {
-    //TODO
+    int month = Calendar.getInstance().get(Calendar.MONTH) + 1;
     ChartMsgVO chartMsg = new ChartMsgVO();
-    chartMsg.setByywc(4);
-    chartMsg.setBywwc(3);
-    chartMsg.setXyjhwc(0);
-    chartMsg.setNdsys(0);
-    List<String> wwcmx = new ArrayList<>();
-    wwcmx.add("长春西牵引变电所");
-    wwcmx.add("英安河AT所");
-    wwcmx.add("珲春分区所");
+    chartMsg.setByywc(bpdjxjhMapper.countByywc(month));
+    chartMsg.setBywwc(bpdjxjhMapper.countBywwc(month));
+    chartMsg.setXyjhwc(bpdjxjhMapper.countXyjhwc(month + 1));
+    chartMsg.setNdsys(bpdjxjhMapper.countNdsys());
+    List<String> wwcmx = bpdjxjhMapper.listWwcmx(month);
     chartMsg.setWwcmx(wwcmx);
     return chartMsg;
   }
@@ -47,21 +61,13 @@ public class DetailServiceImpl implements IDetailService {
    */
   @Override
   public ChartMsgVO getChartDlydtsbyDetail() {
-    //TODO
+    int month = Calendar.getInstance().get(Calendar.MONTH) + 1;
     ChartMsgVO chartMsg = new ChartMsgVO();
-    chartMsg.setByywc(4);
-    chartMsg.setBywwc(8);
-    chartMsg.setXyjhwc(0);
-    chartMsg.setNdsys(0);
-    List<String> wwcmx = new ArrayList<>();
-    wwcmx.add("吉蛟03号箱变(吉林隧道)");
-    wwcmx.add("吉蛟13号箱变(吉林隧道)");
-    wwcmx.add("吉蛟12号箱变(草木沟隧道)");
-    wwcmx.add("吉蛟33号箱变(草木沟隧道)");
-    wwcmx.add("吉蛟56号箱变(草木沟隧道)");
-    wwcmx.add("吉蛟20号箱变(拉法山隧道)");
-    wwcmx.add("吉蛟21号箱变(拉法山隧道)");
-    wwcmx.add("吉蛟22号箱变(拉法山隧道)");
+    chartMsg.setByywc(ydtsMapper.countByywc(month));
+    chartMsg.setBywwc(ydtsMapper.countBywwc(month));
+    chartMsg.setXyjhwc(ydtsMapper.countXyjhwc(month + 1));
+    chartMsg.setNdsys(ydtsMapper.countNdsys());
+    List<String> wwcmx = ydtsMapper.listWwcmx(month);
     chartMsg.setWwcmx(wwcmx);
     return chartMsg;
   }
@@ -73,20 +79,13 @@ public class DetailServiceImpl implements IDetailService {
    */
   @Override
   public ChartMsgVO getChartDlsdxlbyDetail() {
-    //TODO
+    int month = Calendar.getInstance().get(Calendar.MONTH) + 1;
     ChartMsgVO chartMsg = new ChartMsgVO();
-    chartMsg.setByywc(0);
-    chartMsg.setBywwc(7);
-    chartMsg.setXyjhwc(12);
-    chartMsg.setNdsys(12);
-    List<String> wwcmx = new ArrayList<>();
-    wwcmx.add("四平东10KV配电所(一面城线)");
-    wwcmx.add("公主岭南10KV配电所(岭南线)");
-    wwcmx.add("龙嘉10KV配电所(东湖)");
-    wwcmx.add("安图西10KV配电所");
-    wwcmx.add("长春10KV配电所");
-    wwcmx.add("图门北10KV配电所");
-    wwcmx.add("双击10KV配电所");
+    chartMsg.setByywc(gsdMapper.countByywc(month));
+    chartMsg.setBywwc(gsdMapper.countBywwc(month));
+    chartMsg.setXyjhwc(gsdMapper.countXyjhwc(month + 1));
+    chartMsg.setNdsys(gsdMapper.countNdsys());
+    List<String> wwcmx = gsdMapper.listWwcmx(month);
     chartMsg.setWwcmx(wwcmx);
     return chartMsg;
   }
@@ -98,17 +97,13 @@ public class DetailServiceImpl implements IDetailService {
    */
   @Override
   public ChartMsgVO getChartDlbpdsbyDetail() {
-    //TODO
+    int month = Calendar.getInstance().get(Calendar.MONTH) + 1;
     ChartMsgVO chartMsg = new ChartMsgVO();
-    chartMsg.setByywc(0);
-    chartMsg.setBywwc(4);
-    chartMsg.setXyjhwc(0);
-    chartMsg.setNdsys(0);
-    List<String> wwcmx = new ArrayList<>();
-    wwcmx.add("长春西动车所1号10kV配电所");
-    wwcmx.add("长春西动车所2号10kV配电所");
-    wwcmx.add("长白山动车库配电所");
-    wwcmx.add("扶余北10kV配电所");
+    chartMsg.setByywc(gsyMapper.countByywc(month));
+    chartMsg.setBywwc(gsyMapper.countBywwc(month));
+    chartMsg.setXyjhwc(gsyMapper.countXyjhwc(month + 1));
+    chartMsg.setNdsys(gsyMapper.countNdsys());
+    List<String> wwcmx = gsyMapper.listWwcmx(month);
     chartMsg.setWwcmx(wwcmx);
     return chartMsg;
   }

+ 27 - 0
railway-business/src/main/resources/mapper/bi/ShowBpdjxjhMapper.xml

@@ -205,4 +205,31 @@
       and (completion_state != '1' or completion_state = '')
   </select>
 
+  <select id="countByywc" resultType="java.lang.Integer">
+    select count(*)
+    from show_bpdjxjh
+    where LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0)
+      and completion_state = '1';
+  </select>
+
+  <select id="countBywwc" resultType="java.lang.Integer">
+    select count(*)
+    from show_bpdjxjh
+    where LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0) and (completion_state != '1' or completion_state = '')
+  </select>
+
+  <select id="countXyjhwc" resultType="java.lang.Integer">
+    select count(*) from show_bpdjxjh where LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0)
+  </select>
+
+  <select id="countNdsys" resultType="java.lang.Integer">
+    select count(*) from show_bpdjxjh where completion_state != '1' or completion_state = ''
+  </select>
+
+  <select id="listWwcmx" resultType="java.lang.String">
+    select substation_name
+    from show_bpdjxjh
+    where LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0) and (completion_state != '1' or completion_state = '')
+  </select>
+
 </mapper>

+ 29 - 0
railway-business/src/main/resources/mapper/bi/ShowGsdMapper.xml

@@ -8,6 +8,7 @@
     <result column="dept_name" property="deptName"/>
     <result column="line_id" property="lineId"/>
     <result column="line_name" property="lineName"/>
+    <result column="substation_name" property="substationName"/>
     <result column="jkxl" property="jkxl"/>
     <result column="dlxl" property="dlxl"/>
     <result column="glkg" property="glkg"/>
@@ -34,6 +35,7 @@
     id, dept_name,
     line_id,
     line_name,
+    substation_name,
     jkxl,
     dlxl,
     glkg,
@@ -68,6 +70,9 @@
       <if test='null != lineName'>
         line_name,
       </if>
+      <if test='null != substationName'>
+        substation_name,
+      </if>
       <if test='null != jkxl'>
         jkxl,
       </if>
@@ -133,6 +138,9 @@
       <if test='null != lineName'>
         #{lineName},
       </if>
+      <if test='null != substationName'>
+        #{substationName},
+      </if>
       <if test='null != jkxl'>
         #{jkxl},
       </if>
@@ -202,6 +210,7 @@
       <if test='null != deptName'>dept_name = #{deptName},</if>
       <if test='null != lineId'>line_id = #{lineId},</if>
       <if test='null != lineName'>line_name = #{lineName},</if>
+      <if test='null != substationName'>substation_name = #{substationName},</if>
       <if test='null != jkxl'>jkxl = #{jkxl},</if>
       <if test='null != dlxl'>dlxl = #{dlxl},</if>
       <if test='null != glkg'>glkg = #{glkg},</if>
@@ -306,4 +315,24 @@
       and plan_month = #{month} and (completion_date is null or completion_date = '')
   </select>
 
+  <select id="countByywc" resultType="java.lang.Integer">
+    select count(*) from show_gsd where plan_month = #{month} and completion_date is not null and completion_date != '';
+  </select>
+
+  <select id="countBywwc" resultType="java.lang.Integer">
+    select count(*) from show_gsd where plan_month = #{month} and (completion_date is null or completion_date = '')
+  </select>
+
+  <select id="countXyjhwc" resultType="java.lang.Integer">
+    select count(*) from show_gsd where plan_month = #{month}
+  </select>
+
+  <select id="countNdsys" resultType="java.lang.Integer">
+    select count(*) from show_gsd where completion_date is null or completion_date = ''
+  </select>
+
+  <select id="listWwcmx" resultType="java.lang.String">
+    select substation_name from show_gsd where plan_month = #{month} and (completion_date is null or completion_date = '')
+  </select>
+
 </mapper>

+ 20 - 0
railway-business/src/main/resources/mapper/bi/ShowGsyMapper.xml

@@ -273,4 +273,24 @@
       and (completion_date1 is null or completion_date1 = '')
   </select>
 
+  <select id="countByywc" resultType="java.lang.Integer">
+    select count(*) from show_gsy where MONTH(test_plan1) = #{month} and completion_date1 is not null and completion_date1 != '';
+  </select>
+
+  <select id="countBywwc" resultType="java.lang.Integer">
+    select count(*) from show_gsy where MONTH(test_plan1) = #{month} and (completion_date1 is null or completion_date1 = '')
+  </select>
+
+  <select id="countXyjhwc" resultType="java.lang.Integer">
+    select count(*) from show_gsy where MONTH(test_plan1) = #{month}
+  </select>
+
+  <select id="countNdsys" resultType="java.lang.Integer">
+    select count(*) from show_gsy where completion_date1 is null or completion_date1 = ''
+  </select>
+
+  <select id="listWwcmx" resultType="java.lang.String">
+    select substation_name from show_gsy where MONTH(test_plan1) = #{month} and (completion_date1 is null or completion_date1 = '')
+  </select>
+
 </mapper>

+ 20 - 0
railway-business/src/main/resources/mapper/bi/ShowYdtsMapper.xml

@@ -298,4 +298,24 @@
       and plan_month = #{month} and (completion_date is null or completion_date = '')
   </select>
 
+  <select id="countByywc" resultType="java.lang.Integer">
+    select count(*) from show_ydts where plan_month = #{month} and completion_date is not null and completion_date != '';
+  </select>
+
+  <select id="countBywwc" resultType="java.lang.Integer">
+    select count(*) from show_ydts where plan_month = #{month} and (completion_date is null or completion_date = '')
+  </select>
+
+  <select id="countXyjhwc" resultType="java.lang.Integer">
+    select count(*) from show_ydts where plan_month = #{month}
+  </select>
+
+  <select id="countNdsys" resultType="java.lang.Integer">
+    select count(*) from show_ydts where completion_date is null or completion_date = ''
+  </select>
+
+  <select id="listWwcmx" resultType="java.lang.String">
+    select substation_name from show_ydts where plan_month = #{month} and (completion_date is null or completion_date = '')
+  </select>
+
 </mapper>