Przeglądaj źródła

完善电度采集,负值都取绝对值然后计算

hfxc226 6 miesięcy temu
rodzic
commit
c71eb40b47

+ 4 - 1
platform-dao/src/main/resources/mapper/remote/RemoteDegreeMapper.xml

@@ -95,7 +95,10 @@
             and degree.update_time = #{updateTime}
         </if>
         <if test="keyword != null and keyword != ''">
-            degree.position_num like concat('%',#{keyword},'%')
+            and (
+                degree.position_num like concat('%',#{keyword},'%')
+                or degree.sb_name like concat('%',#{keyword},'%')
+            )
         </if>
     </sql>
     <select id="selectList" parameterType="com.platform.dao.dto.remote.RemoteDegreeDTO"

+ 6 - 0
platform-service/src/main/java/com/platform/service/big/impl/BigScreenSbInfoServiceImpl.java

@@ -222,6 +222,12 @@ public class BigScreenSbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, Sb
             record.setHour(0);
         }
         List<RemoteDegreeLogVO> list = remoteDegreeLogMapper.selectList(record);
+
+        // 全部取绝对值,有负数的去掉
+        for (RemoteDegreeLogVO degreeLog : list) {
+            degreeLog.setResult(degreeLog.getResult().replace("-", ""));
+        }
+
         JSONArray jSONArray = new JSONArray();
         if (isDay) {// 日报,需要减去上个小时的
             // 找到前天晚上23点的