瀏覽代碼

optimize report

java110 3 年之前
父節點
當前提交
8ee1921526

+ 45 - 0
java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml

@@ -298,6 +298,51 @@
         ) a
     </select>
 
+    <!-- 查询收费户数 -->
+    <select id="getFeeRoomCount" parameterType="Map" resultType="Map">
+        select count(1) oweRoomCount
+        from
+        (
+        select t.obj_id from pay_fee_detail_month t
+        INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
+        <if test="floorId != null and floorId != ''">
+            LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
+            left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
+        </if>
+        where
+        1=1
+        <if test="floorId != null and floorId != ''">
+            and bu.floor_id = #{floorId}
+        </if>
+        <if test="configId != null and configId != ''">
+            and t.config_id = #{configId}
+        </if>
+        <if test="objName != null and objName != ''">
+            and t.obj_name like concat('%',#{objName},'%')
+        </if>
+        <if test="ownerName != null and ownerName != ''">
+            and t.owner_name like concat('%',#{ownerName},'%')
+        </if>
+        <if test="link != null and link != ''">
+            and t.link = #{link}
+        </if>
+        <if test="configIds !=null ">
+            and t.config_id in
+            <foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="feeTypeCd != null and feeTypeCd != ''">
+            and pf.fee_type_cd = #{feeTypeCd}
+        </if>
+        and t.status_cd = '0'
+        and pf.payer_obj_type = '3333'
+        and t.community_id= #{communityId}
+        and t.cur_month_time &lt; #{endDate}
+        group by t.obj_id
+        ) a
+    </select>
+
 
 
 </mapper>

+ 7 - 0
java110-interface/src/main/java/com/java110/intf/report/IReportFeeStatisticsInnerServiceSMO.java

@@ -68,4 +68,11 @@ public interface IReportFeeStatisticsInnerServiceSMO {
     @RequestMapping(value = "/getOweRoomCount", method = RequestMethod.POST)
     int getOweRoomCount(@RequestBody QueryStatisticsDto queryStatisticsDto);
 
+    /**
+     * 查询收费房屋数
+     * @param queryStatisticsDto
+     * @return
+     */
+    @RequestMapping(value = "/getFeeRoomCount", method = RequestMethod.POST)
+    long getFeeRoomCount(@RequestBody QueryStatisticsDto queryStatisticsDto);
 }

+ 7 - 0
service-report/src/main/java/com/java110/report/dao/IReportFeeStatisticsServiceDao.java

@@ -59,4 +59,11 @@ public interface IReportFeeStatisticsServiceDao {
      * @return
      */
     double getCurReceivableFee(Map info);
+
+    /**
+     * 查询收费房屋数
+     * @param info
+     * @return
+     */
+    int getFeeRoomCount(Map info);
 }

+ 14 - 0
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeStatisticsServiceDaoImpl.java

@@ -65,6 +65,7 @@ public class ReportFeeStatisticsServiceDaoImpl extends BaseServiceDao implements
         return Double.parseDouble(infos.get(0).get("curReceivableFee").toString());
     }
 
+
     /**
      * 查询欠费追回
      * @param info
@@ -133,5 +134,18 @@ public class ReportFeeStatisticsServiceDaoImpl extends BaseServiceDao implements
     }
 
 
+    @Override
+    public int getFeeRoomCount(Map info) {
+        logger.debug("查询 收费户数 入参 info : {}", JSONObject.toJSONString(info));
+
+        List<Map> infos = sqlSessionTemplate.selectList("reportFeeStatisticsServiceDaoImpl.getFeeRoomCount", info);
+
+        if (infos == null || infos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(infos.get(0).get("feeRoomCount").toString());
+    }
+
 
 }

+ 11 - 0
service-report/src/main/java/com/java110/report/smo/impl/ReportFeeStatisticsInnerServiceSMOImpl.java

@@ -83,4 +83,15 @@ public class ReportFeeStatisticsInnerServiceSMOImpl extends BaseServiceSMO imple
         int info = reportFeeStatisticsServiceDaoImpl.getOweRoomCount(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
         return info;
     }
+
+    /**
+     * 查询收费房屋数
+     * @param queryStatisticsDto
+     * @return
+     */
+    @Override
+    public long getFeeRoomCount(@RequestBody QueryStatisticsDto queryStatisticsDto) {
+        int info = reportFeeStatisticsServiceDaoImpl.getFeeRoomCount(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
+        return info;
+    }
 }

+ 7 - 0
service-report/src/main/java/com/java110/report/statistics/impl/FeeStatisticsImpl.java

@@ -48,6 +48,8 @@ public class FeeStatisticsImpl implements IFeeStatistics {
     }
 
 
+
+
     /**
      * 查询 欠费追回
      * @param queryFeeStatisticsDto
@@ -83,4 +85,9 @@ public class FeeStatisticsImpl implements IFeeStatistics {
         return reportFeeStatisticsInnerServiceSMOImpl.getOweRoomCount(queryStatisticsDto);
     }
 
+    @Override
+    public long getFeeRoomCount(QueryStatisticsDto queryStatisticsDto) {
+        return reportFeeStatisticsInnerServiceSMOImpl.getFeeRoomCount(queryStatisticsDto);
+    }
+
 }