java110 лет назад: 2
Родитель
Сommit
bb98ec3e89

+ 20 - 0
java110-bean/src/main/java/com/java110/dto/room/RoomDto.java

@@ -97,6 +97,10 @@ public class RoomDto extends PageDto implements Serializable {
 
     private String contractCount;
 
+    private String startDate;
+
+    private String endDate;
+
 
 
     public String getFeeCoefficient() {
@@ -522,4 +526,20 @@ public class RoomDto extends PageDto implements Serializable {
     public void setOwnerTel(String ownerTel) {
         this.ownerTel = ownerTel;
     }
+
+    public String getStartDate() {
+        return startDate;
+    }
+
+    public void setStartDate(String startDate) {
+        this.startDate = startDate;
+    }
+
+    public String getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(String endDate) {
+        this.endDate = endDate;
+    }
 }

+ 112 - 0
java110-db/src/main/resources/mapper/report/BaseDataStatisticsServiceDaoImplMapper.xml

@@ -106,4 +106,116 @@
     </select>
 
 
+    <select id="getReceivedRoomCount" parameterType="Map" resultType="Map">
+
+        select count(1) count
+        from building_room t
+        inner join building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
+        inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
+        <if test="ownerId != null and ownerId != ''">
+            inner join building_owner_room_rel borr on t.room_id = borr.room_id and borr.status_cd = '0'
+            left join building_owner bo on borr.owner_id = bo.member_id and bo.status_cd = '0'
+        </if>
+        inner join pay_fee pf on t.room_id = pf.payer_obj_id and pf.payer_obj_type = '3333' and pf.status_cd = '0'
+        inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+        where 1=1
+        <if test="floorId != null and floorId != ''">
+            and pfd.create_time &gt;= #{startDate}
+            and pfd.create_time &lt;= #{endDate}
+        </if>
+        and t.status_cd = '0'
+        <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 bu.unit_num = #{unitNum}
+        </if>
+        <if test="roomNum != null and roomNum != ''">
+            and t.room_num = #{roomNum}
+        </if>
+        <if test="roomNumLike !=null and roomNumLike != ''">
+            and t.room_num like concat('%',#{roomNumLike},'%')
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="roomId != null and roomId != ''">
+            and t.room_id = #{roomId}
+        </if>
+        <if test="communityId != null and communityId != ''">
+            and t.community_id = #{communityId}
+        </if>
+        <if test="ownerId != null and ownerId != ''">
+            and bo.owner_id = #{ownerId}
+        </if>
+        <if test="ownerName != null and ownerName != ''">
+            and bo.`name` like concat('%',#{ownerName},'%')
+        </if>
+        <if test="link != null and link != ''">
+            and bo.link = #{link}
+        </if>
+    </select>
+
+    <!-- 查询单月欠费 -->
+    <select id="getReceivedRoomInfo" parameterType="Map" resultType="Map">
+        select t.fee_coefficient feeCoefficient,t.section,t.remark,t.user_id userId,
+        t.room_id roomId,t.layer,t.built_up_area,t.built_up_area
+        builtUpArea,t.room_num,t.room_num roomNum,t.unit_id,t.unit_id unitId,t.b_id,t.b_id
+        bId,t.apartment,t.state,t.community_id,t.community_id communityId,t.room_type,t.room_type roomType,
+        t.room_sub_type,t.room_rent,t.room_area,t.room_sub_type roomSubType,t.room_rent roomRent,t.room_area roomArea,
+        f.floor_num floorNum,bu.unit_num unitNum,bo.name ownerName,bo.owner_id ownerId,bo.link
+        from building_room t
+        inner join building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
+        inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
+        inner join building_owner_room_rel borr on t.room_id = borr.room_id and borr.status_cd = '0'
+        left join building_owner bo on borr.owner_id = bo.member_id and bo.status_cd = '0'
+        inner join pay_fee pf on t.room_id = pf.payer_obj_id and pf.payer_obj_type = '3333' and pf.status_cd = '0'
+        inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+        where 1=1
+        <if test="floorId != null and floorId != ''">
+        and pfd.create_time &gt;= #{startDate}
+        and pfd.create_time &lt;= #{endDate}
+        </if>
+        <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 bu.unit_num = #{unitNum}
+        </if>
+        <if test="roomNum != null and roomNum != ''">
+            and t.room_num = #{roomNum}
+        </if>
+        <if test="roomNumLike !=null and roomNumLike != ''">
+            and t.room_num like concat('%',#{roomNumLike},'%')
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="roomId != null and roomId != ''">
+            and t.room_id = #{roomId}
+        </if>
+        <if test="communityId != null and communityId != ''">
+            and t.community_id = #{communityId}
+        </if>
+        <if test="ownerId != null and ownerId != ''">
+            and bo.owner_id = #{ownerId}
+        </if>
+        <if test="ownerName != null and ownerName != ''">
+            and bo.`name` like concat('%',#{ownerName},'%')
+        </if>
+        <if test="link != null and link != ''">
+            and bo.link = #{link}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null">
+            limit #{page},#{row}
+        </if>
+    </select>
+
 </mapper>

+ 16 - 0
java110-interface/src/main/java/com/java110/intf/report/IBaseDataStatisticsInnerServiceSMO.java

@@ -39,4 +39,20 @@ public interface IBaseDataStatisticsInnerServiceSMO {
      */
     @RequestMapping(value = "/getRoomInfo", method = RequestMethod.POST)
     List<RoomDto> getRoomInfo(@RequestBody RoomDto roomDto);
+
+    /**
+     * 查询实收房屋数
+     * @param roomDto
+     * @return
+     */
+    @RequestMapping(value = "/getReceivedRoomCount", method = RequestMethod.POST)
+    long getReceivedRoomCount(@RequestBody RoomDto roomDto);
+
+    /**
+     * 查询实收房屋
+     * @param roomDto
+     * @return
+     */
+    @RequestMapping(value = "/getReceivedRoomInfo", method = RequestMethod.POST)
+    List<RoomDto> getReceivedRoomInfo(@RequestBody RoomDto roomDto);
 }

+ 2 - 2
service-report/src/main/java/com/java110/report/cmd/dataReport/QueryReceivedDetailStatisticsCmd.java

@@ -67,10 +67,10 @@ public class QueryReceivedDetailStatisticsCmd extends Cmd {
         queryStatisticsDto.setLink(reqJson.getString("link"));
         queryStatisticsDto.setPage(reqJson.getInteger("page"));
         queryStatisticsDto.setRow(reqJson.getInteger("row"));
-        long count = baseDataStatisticsImpl.getRoomCount(queryStatisticsDto);
+        long count = baseDataStatisticsImpl.getReceivedRoomCount(queryStatisticsDto);
         List<RoomDto> rooms = null;
         if (count > 0) {
-            rooms = baseDataStatisticsImpl.getRoomInfo(queryStatisticsDto);
+            rooms = baseDataStatisticsImpl.getReceivedRoomInfo(queryStatisticsDto);
         } else {
             rooms = new ArrayList<>();
         }

+ 16 - 0
service-report/src/main/java/com/java110/report/dao/IBaseDataStatisticsServiceDao.java

@@ -19,4 +19,20 @@ public interface IBaseDataStatisticsServiceDao {
      * @return
      */
     List<Map> getRoomInfo(Map info);
+
+    /**
+     * 查询实收房屋数
+     *
+     * @param info
+     * @return
+     */
+    int getReceivedRoomCount(Map info);
+
+    /**
+     * 查询实收房屋
+     *
+     * @param info
+     * @return
+     */
+    List<Map> getReceivedRoomInfo(Map info);
 }

+ 26 - 0
service-report/src/main/java/com/java110/report/dao/impl/BaseDataStatisticsServiceDaoImpl.java

@@ -32,4 +32,30 @@ public class BaseDataStatisticsServiceDaoImpl extends BaseServiceDao implements
         List<Map> infos = sqlSessionTemplate.selectList("baseDataStatisticsServiceDaoImpl.getRoomInfo", info);
         return infos;
     }
+
+    /**
+     * 查询实收房屋数
+     * @param info
+     * @return
+     */
+    @Override
+    public int getReceivedRoomCount(Map info) {
+        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("baseDataStatisticsServiceDaoImpl.getReceivedRoomCount", info);
+        if (businessReportFeeMonthStatisticsInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessReportFeeMonthStatisticsInfos.get(0).get("count").toString());
+    }
+
+    /**
+     * 查询实收房屋
+     * @param info
+     * @return
+     */
+    @Override
+    public List<Map> getReceivedRoomInfo(Map info) {
+        List<Map> infos = sqlSessionTemplate.selectList("baseDataStatisticsServiceDaoImpl.getReceivedRoomInfo", info);
+        return infos;
+    }
 }

+ 18 - 0
service-report/src/main/java/com/java110/report/smo/impl/BaseDataStatisticsInnerServiceSMOImpl.java

@@ -59,4 +59,22 @@ public class BaseDataStatisticsInnerServiceSMOImpl extends BaseServiceSMO implem
         List<Map> info = baseDataStatisticsServiceDaoImpl.getRoomInfo(BeanConvertUtil.beanCovertMap(roomDto));
         return BeanConvertUtil.covertBeanList(info, RoomDto.class);
     }
+
+    @Override
+    public long getReceivedRoomCount(@RequestBody RoomDto roomDto) {
+        int info = baseDataStatisticsServiceDaoImpl.getReceivedRoomCount(BeanConvertUtil.beanCovertMap(roomDto));
+        return info;
+    }
+
+    @Override
+    public List<RoomDto> getReceivedRoomInfo(@RequestBody RoomDto roomDto) {
+        int page = roomDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            roomDto.setPage((page - 1) * roomDto.getRow());
+        }
+
+        List<Map> info = baseDataStatisticsServiceDaoImpl.getReceivedRoomInfo(BeanConvertUtil.beanCovertMap(roomDto));
+        return BeanConvertUtil.covertBeanList(info, RoomDto.class);
+    }
 }

+ 14 - 0
service-report/src/main/java/com/java110/report/statistics/IBaseDataStatistics.java

@@ -71,4 +71,18 @@ public interface IBaseDataStatistics {
      * @return
      */
     List<OwnerCarDto> getCar(QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 查询实收房屋数
+     * @param queryStatisticsDto
+     * @return
+     */
+    long getReceivedRoomCount(QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 查询实收房屋
+     * @param queryStatisticsDto
+     * @return
+     */
+    List<RoomDto> getReceivedRoomInfo(QueryStatisticsDto queryStatisticsDto);
 }

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

@@ -77,6 +77,36 @@ public class BaseDataStatisticsImpl implements IBaseDataStatistics {
         return baseDataStatisticsInnerServiceSMOImpl.getRoomInfo(roomDto);
     }
 
+    @Override
+    public long getReceivedRoomCount(QueryStatisticsDto queryStatisticsDto) {
+        RoomDto roomDto = new RoomDto();
+        roomDto.setFloorId(queryStatisticsDto.getFloorId());
+        roomDto.setCommunityId(queryStatisticsDto.getCommunityId());
+        roomDto.setOwnerName(queryStatisticsDto.getOwnerName());
+        roomDto.setFloorId(queryStatisticsDto.getFloorId());
+        roomDto.setLink(queryStatisticsDto.getLink());
+        roomDto.setStartDate(queryStatisticsDto.getStartDate());
+        roomDto.setEndDate(queryStatisticsDto.getEndDate());
+        addRoomNumCondition(queryStatisticsDto, roomDto);
+        return baseDataStatisticsInnerServiceSMOImpl.getReceivedRoomCount(roomDto);
+    }
+
+    @Override
+    public List<RoomDto> getReceivedRoomInfo(QueryStatisticsDto queryStatisticsDto) {
+        RoomDto roomDto = new RoomDto();
+        roomDto.setCommunityId(queryStatisticsDto.getCommunityId());
+        roomDto.setFloorId(queryStatisticsDto.getFloorId());
+        roomDto.setPage(queryStatisticsDto.getPage());
+        roomDto.setRow(queryStatisticsDto.getRow());
+        roomDto.setOwnerName(queryStatisticsDto.getOwnerName());
+        roomDto.setFloorId(queryStatisticsDto.getFloorId());
+        roomDto.setLink(queryStatisticsDto.getLink());
+        roomDto.setStartDate(queryStatisticsDto.getStartDate());
+        roomDto.setEndDate(queryStatisticsDto.getEndDate());
+        addRoomNumCondition(queryStatisticsDto, roomDto);
+        return baseDataStatisticsInnerServiceSMOImpl.getReceivedRoomInfo(roomDto);
+    }
+
 
     /**
      * 查询空闲房屋
@@ -163,6 +193,8 @@ public class BaseDataStatisticsImpl implements IBaseDataStatistics {
     }
 
 
+
+
     /**
      * roomNum 拆分 查询房屋信息
      *