Bläddra i källkod

抄表客户查询优化

chenhao 1 månad sedan
förälder
incheckning
240dcefc69

+ 1 - 8
xrtyMeter/src/main/java/com/tofly/watermeter/custom/service/impl/ReadStatisticServiceImpl.java

@@ -532,15 +532,8 @@ public class ReadStatisticServiceImpl implements ReadStatisticService {
         if ("1".equals(template)) {
             //如果是导出,必须要条件,否则所有抄表历史数据都会导出
             if (StringUtil.isNotEmpty(inputContent)) {
-/*                List<Readmeterhis> mapperReadDayInfo = readmeterhisService.list(Wrappers.<Readmeterhis>lambdaQuery().eq(Readmeterhis::getCbbz, "1")
-                        .eq(StringUtil.isNotEmpty(isGeneral), Readmeterhis::getIsGeneral, isGeneral)
-                        .and(StringUtil.isNotEmpty(inputContent), v -> v.like(Readmeterhis::getYhbh, inputContent)
-                                .or().like(Readmeterhis::getYhxm, inputContent).or().like(Readmeterhis::getYhdz, inputContent))
-                        .orderByDesc(Readmeterhis::getYhbh, Readmeterhis::getCbrq));*/
-
                 List<Readmeterhis> mapperReadDayInfo = readmeterhisMapper.getClient(search);
-
-                        // 根据templateServiceType,templateFlag获取对应模板数据
+                // 根据templateServiceType,templateFlag获取对应模板数据
                 ExcelExportFileTypeEnum excelExportFileTypeEnum = ExcelExportFileTypeEnum.getExcelExportFileTypeEnum("readDayInfoService", search.getTemplateFlag());
                 if (null == excelExportFileTypeEnum) {
                     return null;

+ 4 - 6
xrtyMeter/src/main/java/com/tofly/watermeter/custom/service/sxj/impl/SynchronousAboutServiceImpl.java

@@ -421,16 +421,14 @@ public class SynchronousAboutServiceImpl implements SynchronousAboutService {
             int equal = 0;
             if (CollectionUtil.isNotEmpty(lastMonthData) && CollectionUtil.isNotEmpty(lastMonthData.get(data.getYhbh()))){
               Qfcbqfmxls last = lastMonthData.get(data.getYhbh()).get(0);
-              long dCbsl = data.getCbsl() != null ? data.getCbsl() : 0;
-              long lCbsl = last.getCbsl() != null ? last.getCbsl() : 0;
               Integer zeroCount = last.getZeroCount();
               Integer continuityDown = last.getContinuityDown();
               Integer continuityUp = last.getContinuityUp();
               Integer continuityEqual = last.getContinuityEqual();
-              zero = dCbsl == 0 ? zeroCount + 1 : 0;
-              down = dCbsl < lCbsl ? continuityDown + 1 : 0;
-              up = dCbsl > lCbsl ? continuityUp + 1 : 0;
-              equal = dCbsl==lCbsl ? continuityEqual + 1 : 0;
+              zero = data.getCbsl() == 0 ? zeroCount + 1 : 0;
+              down = data.getCbsl() < last.getCbsl() ? continuityDown + 1 : 0;
+              up = data.getCbsl() > last.getCbsl() ? continuityUp + 1 : 0;
+              equal = data.getCbsl().equals(last.getCbsl()) ? continuityEqual + 1 : 0;
             }
             data.setZeroCount(zero);
             data.setContinuityDown(down);

+ 2 - 2
xrtyMeter/src/main/java/com/tofly/watermeter/service/impl/QfcbplandetailsServiceImpl.java

@@ -335,7 +335,7 @@ public class QfcbplandetailsServiceImpl extends ServiceImpl<QfcbplandetailsMappe
     }
     //查询是否存在重复数据
     Integer repeat = baseMapper.countRepeatReadMater();
-    if (repeat > 0){
+    if (repeat != null && repeat > 0){
       baseMapper.deleteRepeatData();
     }
   }
@@ -453,7 +453,7 @@ public class QfcbplandetailsServiceImpl extends ServiceImpl<QfcbplandetailsMappe
     }
     //查询是否存在重复数据
     Integer repeat = baseMapper.countRepeatReadMater();
-    if (repeat > 0){
+    if (repeat != null && repeat > 0){
       baseMapper.deleteRepeatData();
     }
     return true;

+ 23 - 4
xrtyMeter/src/main/resources/mapper/ReadmeterhisMapper.xml

@@ -1629,14 +1629,33 @@
         continuity_equal, diff_time, yearonyear1, yearonyear2, yearonyear3, yearonmonth1, yearonmonth2, yearonmonth3,
         audit_time, audit_type, quality_count, update_water, upload_day, abnomal_id, sjsl, update_bcds, update_scds,
         is_updatecbsl, is_updateid, isfirst, isbreak_read, order_ids, sxj_sbqd, cbrq4, is_estimate, img_url
-        from TF_YWPN_METERREADING_W_VIEW
-        where (CBBZ = 1 or CBBZ is null)
+        from TF_YWPN_READMETERHIS_W
+        where CBBZ = 1
         <if test="search.isGeneral != null and search.isGeneral != ''">
             and IS_GENERAL = #{search.isGeneral}
         </if>
         <if test="search.inputContent != null and search.inputContent != ''">
             and yhbh || yhxm || yhdz || lxdh like '%' || #{search.inputContent} || '%'
         </if>
+        <if test="search.cbb != null and search.cbb != ''">
+            and CBB in
+            <foreach collection="search.cbb.split(',')" item="c" open="(" separator="," close=")">
+                #{c}
+            </foreach>
+        </if>
+        <if test="search.cbry != null">
+            and CBRY = #{search.cbry}
+        </if>
+        <if test="search.sspq != null and search.sspq != ''">
+            and CBQY_BM in
+            <foreach collection="search.sspq.split(',')" item="s" open="(" separator="," close=")">
+                #{s}
+            </foreach>
+        </if>
+        <if test="search.startTime != null and search.startTime != '' and search.endTime != null and search.endTime != ''">
+            and CBRQ between to_date(#{search.startTime},'yyyy-mm-dd hh24:mi:ss') and
+            to_date(#{search.endTime},'yyyy-mm-dd hh24:mi:ss')
+        </if>
         order by yhbh,cbrq
     </select>
 
@@ -1652,13 +1671,13 @@
     <update id="handleAbnormalUser">
         update TF_YWPN_READMETERHIS_W r
         set SCDS = (select q.SCDS from TF_YWPN_QFKHJBXX_W q where q.YHBH = r.YHBH)
-        where MONTH_PLAN = to_char(sysdate,'yyyyMM')
+        where MONTH_PLAN = to_char(sysdate, 'yyyyMM')
           and YHBH in (select r.YHBH
                        from TF_YWPN_READMETERHIS_W r
                                 left join TF_YWPN_QFKHJBXX_W q
                                           on r.YHBH = q.YHBH
                        where CBBZ = 0
-                         and MONTH_PLAN = to_char(sysdate,'yyyyMM')
+                         and MONTH_PLAN = to_char(sysdate, 'yyyyMM')
                          and r.scds != q.SCDS
                          and r.XZBS = 0)
     </update>