java110 пре 2 година
родитељ
комит
3b925c794d

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

@@ -218,4 +218,108 @@
         </if>
     </select>
 
+    <select id="getOweRoomCount" 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 report_owe_fee rof on t.room_id = rof.payer_obj_id and rof.payer_obj_type = '3333'
+        where 1=1
+        and rof.amount_owed > 0
+        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="getOweRoomInfo" 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 report_owe_fee rof on t.room_id = rof.payer_obj_id and rof.payer_obj_type = '3333'
+        where 1=1
+        and rof.amount_owed > 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>
+        order by t.create_time desc
+        <if test="page != -1 and page != null">
+            limit #{page},#{row}
+        </if>
+    </select>
+
 </mapper>

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

@@ -55,4 +55,10 @@ public interface IBaseDataStatisticsInnerServiceSMO {
      */
     @RequestMapping(value = "/getReceivedRoomInfo", method = RequestMethod.POST)
     List<RoomDto> getReceivedRoomInfo(@RequestBody RoomDto roomDto);
+
+    @RequestMapping(value = "/getOweRoomCount", method = RequestMethod.POST)
+    long getOweRoomCount(@RequestBody RoomDto roomDto);
+
+    @RequestMapping(value = "/getOweRoomInfo", method = RequestMethod.POST)
+    List<RoomDto> getOweRoomInfo(@RequestBody RoomDto roomDto);
 }

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

@@ -69,10 +69,10 @@ public class QueryOweDetailStatisticsCmd extends Cmd {
         queryStatisticsDto.setRow(reqJson.getInteger("row"));
 
         //todo 查询房屋信息
-        long count = baseDataStatisticsImpl.getRoomCount(queryStatisticsDto);
+        long count = baseDataStatisticsImpl.getOweRoomCount(queryStatisticsDto);
         List<RoomDto> rooms = null;
         if (count > 0) {
-            rooms = baseDataStatisticsImpl.getRoomInfo(queryStatisticsDto);
+            rooms = baseDataStatisticsImpl.getOweRoomInfo(queryStatisticsDto);
         } else {
             rooms = new ArrayList<>();
         }

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

@@ -35,4 +35,18 @@ public interface IBaseDataStatisticsServiceDao {
      * @return
      */
     List<Map> getReceivedRoomInfo(Map info);
+
+    /**
+     * 查询欠费房屋总数
+     * @param info
+     * @return
+     */
+    int getOweRoomCount(Map info);
+
+    /**
+     * 查询欠费房屋数
+     * @param info
+     * @return
+     */
+    List<Map> getOweRoomInfo(Map info);
 }

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

@@ -58,4 +58,20 @@ public class BaseDataStatisticsServiceDaoImpl extends BaseServiceDao implements
         List<Map> infos = sqlSessionTemplate.selectList("baseDataStatisticsServiceDaoImpl.getReceivedRoomInfo", info);
         return infos;
     }
+
+    @Override
+    public int getOweRoomCount(Map info) {
+        List<Map> infos = sqlSessionTemplate.selectList("baseDataStatisticsServiceDaoImpl.getOweRoomCount", info);
+        if (infos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(infos.get(0).get("count").toString());
+    }
+
+    @Override
+    public List<Map> getOweRoomInfo(Map info) {
+        List<Map> infos = sqlSessionTemplate.selectList("baseDataStatisticsServiceDaoImpl.getOweRoomInfo", info);
+        return infos;
+    }
 }

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

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

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

@@ -85,4 +85,8 @@ public interface IBaseDataStatistics {
      * @return
      */
     List<RoomDto> getReceivedRoomInfo(QueryStatisticsDto queryStatisticsDto);
+
+    long getOweRoomCount(QueryStatisticsDto queryStatisticsDto);
+
+    List<RoomDto> getOweRoomInfo(QueryStatisticsDto queryStatisticsDto);
 }

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

@@ -107,6 +107,36 @@ public class BaseDataStatisticsImpl implements IBaseDataStatistics {
         return baseDataStatisticsInnerServiceSMOImpl.getReceivedRoomInfo(roomDto);
     }
 
+    @Override
+    public long getOweRoomCount(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.getOweRoomCount(roomDto);
+    }
+
+    @Override
+    public List<RoomDto> getOweRoomInfo(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.getOweRoomInfo(roomDto);
+    }
+
 
     /**
      * 查询空闲房屋