浏览代码

客户抄表率BUG

lin 4 年之前
父节点
当前提交
4523e59a08

+ 2 - 2
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/StatMeterReadRateByBuildingServiceImpl.java

@@ -252,10 +252,10 @@ public class StatMeterReadRateByBuildingServiceImpl implements StatMeterReadRate
             String tableName = "sc_stat_meter_read_rate_by_building";
             return statMeterReadRateByBuildingMapper.getRateCountByTimeV2(tableName,loginUser.getSiteId(), startDate, buildingIds, UserUtil.getCustomerIds());
         } else if (period == 7) {
-            String tableName = "sc_stat_meter_read_rate_by_building";
+            String tableName = "sc_stat_meter_read_rate_by_building_7day";
             return statMeterReadRateByBuildingMapper.getRateCountByTimeV2(tableName,loginUser.getSiteId(), startDate, buildingIds, UserUtil.getCustomerIds());
         } else if (period == 15) {
-            String tableName = "sc_stat_meter_read_rate_by_building";
+            String tableName = "sc_stat_meter_read_rate_by_building_15day";
             return statMeterReadRateByBuildingMapper.getRateCountByTimeV2(tableName,loginUser.getSiteId(), startDate, buildingIds, UserUtil.getCustomerIds());
         }
         return null;

+ 2 - 2
smart-city-platform/src/main/resources/application.properties

@@ -1,2 +1,2 @@
-#开发环境:dev  测试环境:sit  线上环境:prd  演示环境:uat
-spring.profiles.active=dev
+#锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷dev  锟斤拷锟皆伙拷锟斤拷锟斤拷sit  锟斤拷锟较伙拷锟斤拷锟斤拷prd  锟斤拷示锟斤拷锟斤拷锟斤拷uat
+spring.profiles.active=prd

+ 5 - 4
smart-city-platform/src/main/resources/mapper/StatMeterReadRateByBuildingMapper.xml

@@ -168,7 +168,8 @@
 		<!-- 表类型 -->
 		<if test="param.channelId != null and param.channelId != 0">
 			and rb.channel_id = #{param.channelId}
-		</if> 
+		</if>
+        <if test="param.channelId == null "> and rb.channel_id != -99</if>
 		<!-- 数据权限 -->
 		<if test="param.siteId != null and param.siteId != 0 "> and rb.site_id = #{param.siteId} </if>
 		<!--  
@@ -558,10 +559,10 @@
             FROM
                 ${tableName} ssmrrbb
             WHERE 1 = 1
-                <if test="siteId != null"> ssmrrbb.site_id = #{siteId} </if>
+                <if test="siteId != null"> and ssmrrbb.site_id = #{siteId} </if>
                 <if test="channelId != null"> and ssmrrbb.channel_id = #{channelId} </if>
                 AND ssmrrbb.stat_day = #{startDate}
-                AND ssmrrbb.channel_id <![CDATA[ <> ]]> - 99
+                AND ssmrrbb.channel_id <![CDATA[ <> ]]> -99
                 <if test="buildingIds != null and buildingIds.size() != 0"> and ssmrrbb.building_id in <foreach collection="buildingIds" item="item" open="(" separator="," close=")">#{item}</foreach> </if>
                 <if test="customerIds != null and customerIds.size() != 0"> and ssmrrbb.customer_id in <foreach collection="customerIds" item="item" open="(" separator="," close=")">#{item}</foreach> </if>
             GROUP BY
@@ -584,7 +585,7 @@
         FROM ${tableName} ssmrrbb
         left join sc_channel sc on(sc.id = ssmrrbb.channel_id)
         WHERE 1 = 1
-        <if test="siteId != null"> ssmrrbb.site_id = #{siteId} </if>
+        <if test="siteId != null"> and ssmrrbb.site_id = #{siteId} </if>
         and ssmrrbb.stat_day = #{startDate}
         AND ssmrrbb.channel_id <![CDATA[ <> ]]> - 99
         <if test="customerId != null"> and ssmrrbb.customer_id = #{customerId} </if>