Преглед изворни кода

优化定时任务手工测试

Your Name пре 2 година
родитељ
комит
b87cfce785

+ 30 - 0
java110-bean/src/main/java/com/java110/dto/report/QueryStatisticsDto.java

@@ -12,6 +12,12 @@ public class QueryStatisticsDto implements Serializable {
      */
     private String endDate;
 
+    private String floorId;
+
+    private String configId;
+
+    private String objName;
+
 
     public String getCommunityId() {
         return communityId;
@@ -37,4 +43,28 @@ public class QueryStatisticsDto implements Serializable {
     public void setEndDate(String endDate) {
         this.endDate = endDate;
     }
+
+    public String getFloorId() {
+        return floorId;
+    }
+
+    public void setFloorId(String floorId) {
+        this.floorId = floorId;
+    }
+
+    public String getConfigId() {
+        return configId;
+    }
+
+    public void setConfigId(String configId) {
+        this.configId = configId;
+    }
+
+    public String getObjName() {
+        return objName;
+    }
+
+    public void setObjName(String objName) {
+        this.objName = objName;
+    }
 }

+ 1 - 1
java110-db/src/main/resources/mapper/community/FloorServiceDaoImplMapper.xml

@@ -235,7 +235,7 @@
             and f.floor_num= #{floorNum}
         </if>
         AND f.`status_cd` = '0'
-        order by f.create_time desc
+        order by f.seq asc,f.create_time desc
         <if test="page != -1 and page != null ">
             LIMIT #{page}, #{row}
         </if>

+ 12 - 0
java110-db/src/main/resources/mapper/community/RoomV1ServiceDaoImplMapper.xml

@@ -39,6 +39,12 @@
         <if test="floorId !=null and floorId != ''">
             and f.floor_id= #{floorId}
         </if>
+        <if test="floorNum !=null and floorNum != ''">
+            and f.`floor_num`= #{floorNum}
+        </if>
+        <if test="unitNum !=null and unitNum != ''">
+            and u.unit_num= #{unitNum}
+        </if>
         <if test="floorIds !=null ">
             and f.floor_id in
             <foreach collection="floorIds" item="item" index="index" open="(" close=")" separator=",">
@@ -172,6 +178,12 @@
         <if test="floorId !=null and floorId != ''">
             and f.floor_id= #{floorId}
         </if>
+        <if test="floorNum !=null and floorNum != ''">
+            and f.`floor_num`= #{floorNum}
+        </if>
+        <if test="unitNum !=null and unitNum != ''">
+            and u.unit_num= #{unitNum}
+        </if>
         <if test="floorIds !=null ">
             and f.floor_id in
             <foreach collection="floorIds" item="item" index="index" open="(" close=")" separator=",">

+ 90 - 4
java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml

@@ -9,8 +9,21 @@
         select ifnull(sum(t.receivable_amount - t.received_amount - t.discount_amount),0.0) hisOweFee
         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>
         and t.status_cd = '0'
         and t.community_id= #{communityId}
         and t.cur_month_time &lt; #{startDate}
@@ -21,8 +34,21 @@
         select ifnull(sum(t.receivable_amount - t.received_amount - t.discount_amount),0.0) curOweFee
         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>
         and t.status_cd = '0'
         and t.community_id= #{communityId}
         and t.cur_month_time &gt; #{startDate}
@@ -34,7 +60,22 @@
         select ifnull(sum(t.received_amount),0.0) hisReceivedFee
         from pay_fee_detail_month t
         INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
-        where t.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>
+        and t.status_cd = '0'
         and t.community_id= #{communityId}
         and t.pay_fee_time &gt;  #{startDate}
         and t.pay_fee_time &lt; #{endDate}
@@ -46,7 +87,22 @@
         select ifnull(sum(t.received_amount),0.0) preReceivedFee
         from pay_fee_detail_month t
         INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
-        where t.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>
+        and t.status_cd = '0'
         and t.community_id= #{communityId}
         and t.pay_fee_time &gt;  #{startDate}
         and t.pay_fee_time &lt; #{endDate}
@@ -58,7 +114,22 @@
         select ifnull(sum(t.received_amount),0.0) receivedFee
         from pay_fee_detail_month t
         INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
-        where t.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>
+        and t.status_cd = '0'
         and t.community_id= #{communityId}
         and t.pay_fee_time &gt;  #{startDate}
         and t.pay_fee_time &lt; #{endDate}
@@ -71,7 +142,22 @@
         (
         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'
-        where t.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>
+        and t.status_cd = '0'
         and pf.payer_obj_type = '3333'
         and t.community_id= #{communityId}
         and t.cur_month_time &lt; #{endDate}

+ 34 - 0
service-report/src/main/java/com/java110/report/statistics/impl/BaseDataStatisticsImpl.java

@@ -21,6 +21,23 @@ public class BaseDataStatisticsImpl implements IBaseDataStatistics {
 
         RoomDto roomDto = new RoomDto();
         roomDto.setCommunityId(queryStatisticsDto.getCommunityId());
+        roomDto.setFloorId(queryStatisticsDto.getFloorId());
+        if(queryStatisticsDto.getObjName().contains("-")){
+            String[] objNames = queryStatisticsDto.getObjName().split("-");
+            if(objNames.length == 2){
+                roomDto.setFloorNum(objNames[0]);
+                roomDto.setUnitNum("0");
+                roomDto.setRoomNum(objNames[1]);
+            }
+            objNames = queryStatisticsDto.getObjName().split("-",3);
+            if(objNames.length == 3){
+                roomDto.setFloorNum(objNames[0]);
+                roomDto.setUnitNum(objNames[1]);
+                roomDto.setRoomNum(objNames[2]);
+            }
+        }else{
+            roomDto.setRoomNumLike(queryStatisticsDto.getObjName());
+        }
         return roomV1InnerServiceSMOImpl.queryRoomsCount(roomDto);
     }
 
@@ -29,6 +46,23 @@ public class BaseDataStatisticsImpl implements IBaseDataStatistics {
         RoomDto roomDto = new RoomDto();
         roomDto.setCommunityId(queryStatisticsDto.getCommunityId());
         roomDto.setState(RoomDto.STATE_FREE);
+        roomDto.setFloorId(queryStatisticsDto.getFloorId());
+        if(queryStatisticsDto.getObjName().contains("-")){
+            String[] objNames = queryStatisticsDto.getObjName().split("-");
+            if(objNames.length == 2){
+                roomDto.setFloorNum(objNames[0]);
+                roomDto.setUnitNum("0");
+                roomDto.setRoomNum(objNames[1]);
+            }
+            objNames = queryStatisticsDto.getObjName().split("-",3);
+            if(objNames.length == 3){
+                roomDto.setFloorNum(objNames[0]);
+                roomDto.setUnitNum(objNames[1]);
+                roomDto.setRoomNum(objNames[2]);
+            }
+        }else{
+            roomDto.setRoomNumLike(queryStatisticsDto.getObjName());
+        }
         return roomV1InnerServiceSMOImpl.queryRoomsCount(roomDto);
     }
 }