Browse Source

加入房屋状态信息

wuxw 7 years ago
parent
commit
73669bfcfd

+ 8 - 0
Api/src/main/java/com/java110/api/listener/room/SaveRoomListener.java

@@ -117,6 +117,7 @@ public class SaveRoomListener extends AbstractServiceApiDataFlowListener {
         Assert.jsonObjectHaveKey(paramIn, "layer", "请求报文中未包含layer节点");
         Assert.jsonObjectHaveKey(paramIn, "section", "请求报文中未包含section节点");
         Assert.jsonObjectHaveKey(paramIn, "apartment", "请求报文中未包含apartment节点");
+        Assert.jsonObjectHaveKey(paramIn, "state", "请求报文中未包含state节点");
         Assert.jsonObjectHaveKey(paramIn, "builtUpArea", "请求报文中未包含builtUpArea节点");
         Assert.jsonObjectHaveKey(paramIn, "unitPrice", "请求报文中未包含unitPrice节点");
         JSONObject reqJson = JSONObject.parseObject(paramIn);
@@ -128,6 +129,13 @@ public class SaveRoomListener extends AbstractServiceApiDataFlowListener {
             throw new IllegalArgumentException("不是有效房屋户型 传入数据错误");
         }
 
+        if (!"2001".equals(reqJson.getString("state"))
+                && !"2002".equals(reqJson.getString("state"))
+                && !"2003".equals(reqJson.getString("state"))
+                && !"2004".equals(reqJson.getString("state"))) {
+            throw new IllegalArgumentException("不是有效房屋状态 传入数据错误");
+        }
+
         UnitDto unitDto = new UnitDto();
         unitDto.setCommunityId(reqJson.getString("communityId"));
         unitDto.setUnitId(reqJson.getString("unitId"));

+ 8 - 0
Api/src/main/java/com/java110/api/listener/room/UpdateRoomListener.java

@@ -118,6 +118,7 @@ public class UpdateRoomListener extends AbstractServiceApiDataFlowListener {
         Assert.jsonObjectHaveKey(paramIn, "section", "请求报文中未包含section节点");
         Assert.jsonObjectHaveKey(paramIn, "apartment", "请求报文中未包含apartment节点");
         Assert.jsonObjectHaveKey(paramIn, "builtUpArea", "请求报文中未包含builtUpArea节点");
+        Assert.jsonObjectHaveKey(paramIn, "state", "请求报文中未包含state节点");
         Assert.jsonObjectHaveKey(paramIn, "unitPrice", "请求报文中未包含unitPrice节点");
         JSONObject reqJson = JSONObject.parseObject(paramIn);
         Assert.isInteger(reqJson.getString("section"), "房间数不是有效数字");
@@ -128,6 +129,13 @@ public class UpdateRoomListener extends AbstractServiceApiDataFlowListener {
             throw new IllegalArgumentException("不是有效房屋户型 传入数据错误");
         }
 
+        if (!"2001".equals(reqJson.getString("state"))
+                && !"2002".equals(reqJson.getString("state"))
+                && !"2003".equals(reqJson.getString("state"))
+                && !"2004".equals(reqJson.getString("state"))) {
+            throw new IllegalArgumentException("不是有效房屋状态 传入数据错误");
+        }
+
         UnitDto unitDto = new UnitDto();
         unitDto.setCommunityId(reqJson.getString("communityId"));
         unitDto.setUnitId(reqJson.getString("unitId"));

+ 2 - 0
CommunityService/src/main/java/com/java110/community/listener/room/AbstractRoomBusinessServiceDataFlowListener.java

@@ -45,6 +45,7 @@ public abstract class AbstractRoomBusinessServiceDataFlowListener extends Abstra
         businessRoomInfo.put("layer", businessRoomInfo.get("layer"));
         businessRoomInfo.put("builtUpArea", businessRoomInfo.get("built_up_area"));
         businessRoomInfo.put("operate", businessRoomInfo.get("operate"));
+        businessRoomInfo.put("state", businessRoomInfo.get("state"));
         businessRoomInfo.put("roomNum", businessRoomInfo.get("room_num"));
         businessRoomInfo.put("unitId", businessRoomInfo.get("unit_id"));
         businessRoomInfo.put("apartment", businessRoomInfo.get("apartment"));
@@ -80,6 +81,7 @@ public abstract class AbstractRoomBusinessServiceDataFlowListener extends Abstra
         currentRoomInfo.put("layer", currentRoomInfo.get("layer"));
         currentRoomInfo.put("builtUpArea", currentRoomInfo.get("built_up_area"));
         currentRoomInfo.put("operate", currentRoomInfo.get("operate"));
+        currentRoomInfo.put("state", currentRoomInfo.get("state"));
         currentRoomInfo.put("roomNum", currentRoomInfo.get("room_num"));
         currentRoomInfo.put("unitId", currentRoomInfo.get("unit_id"));
         currentRoomInfo.put("apartment", currentRoomInfo.get("apartment"));

+ 23 - 0
WebService/src/main/java/com/java110/web/components/room/RoomComponent.java

@@ -2,6 +2,7 @@ package com.java110.web.components.room;
 
 import com.java110.core.context.IPageData;
 import com.java110.web.smo.IRoomServiceSMO;
+import com.java110.web.smo.IUnitServiceSMO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
@@ -18,6 +19,10 @@ import org.springframework.stereotype.Component;
 public class RoomComponent {
 
 
+    @Autowired
+    private IUnitServiceSMO unitServiceSMOImpl;
+
+
     @Autowired
     private IRoomServiceSMO roomServiceSMOImpl;
 
@@ -31,6 +36,16 @@ public class RoomComponent {
         return roomServiceSMOImpl.listRoom(pd);
     }
 
+    /**
+     * 根据 floorId 查询单元信息
+     *
+     * @param pd 包含floorId 和小区ID 页面封装对象
+     * @return 单元信息
+     */
+    public ResponseEntity<String> loadUnits(IPageData pd) {
+        return unitServiceSMOImpl.listUnits(pd);
+    }
+
     public IRoomServiceSMO getRoomServiceSMOImpl() {
         return roomServiceSMOImpl;
     }
@@ -38,4 +53,12 @@ public class RoomComponent {
     public void setRoomServiceSMOImpl(IRoomServiceSMO roomServiceSMOImpl) {
         this.roomServiceSMOImpl = roomServiceSMOImpl;
     }
+
+    public IUnitServiceSMO getUnitServiceSMOImpl() {
+        return unitServiceSMOImpl;
+    }
+
+    public void setUnitServiceSMOImpl(IUnitServiceSMO unitServiceSMOImpl) {
+        this.unitServiceSMOImpl = unitServiceSMOImpl;
+    }
 }

+ 8 - 0
WebService/src/main/java/com/java110/web/smo/impl/RoomServiceSMOImpl.java

@@ -184,6 +184,7 @@ public class RoomServiceSMOImpl extends BaseComponentSMO implements IRoomService
         Assert.jsonObjectHaveKey(pd.getReqData(), "section", "请求报文中未包含section节点");
         Assert.jsonObjectHaveKey(pd.getReqData(), "apartment", "请求报文中未包含apartment节点");
         Assert.jsonObjectHaveKey(pd.getReqData(), "builtUpArea", "请求报文中未包含builtUpArea节点");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "state", "请求报文中未包含state节点");
         Assert.jsonObjectHaveKey(pd.getReqData(), "unitPrice", "请求报文中未包含unitPrice节点");
         JSONObject reqJson = JSONObject.parseObject(pd.getReqData());
 
@@ -196,6 +197,13 @@ public class RoomServiceSMOImpl extends BaseComponentSMO implements IRoomService
             throw new IllegalArgumentException("不是有效房屋户型 传入数据错误");
         }
 
+        if (!"2001".equals(reqJson.getString("state"))
+                && !"2002".equals(reqJson.getString("state"))
+                && !"2003".equals(reqJson.getString("state"))
+                && !"2004".equals(reqJson.getString("state"))) {
+            throw new IllegalArgumentException("不是有效房屋状态 传入数据错误");
+        }
+
     }
 
     /**

+ 13 - 0
WebService/src/main/resources/components/add-room/addRoom.html

@@ -46,6 +46,19 @@
                                 <label class="col-sm-2 col-form-label">房屋单价</label>
                                 <div class="col-sm-10"><input v-model="addRoomInfo.unitPrice" type="number" placeholder="必填,请填写房屋美平米单价" class="form-control"></div>
                             </div>
+
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">房屋状态</label>
+                                <div class="col-sm-10">
+                                    <select class="custom-select" v-model="addRoomInfo.state">
+                                        <option selected disabled value="">必填,请选择房屋状态</option>
+                                        <option value="2001">已出售</option>
+                                        <option value="2002">未出售</option>
+                                        <option value="2003">已交定金</option>
+                                        <option value="2004">已出租</option>
+                                    </select>
+                                </div>
+                            </div>
                             <div class="form-group row">
                                 <label class="col-sm-2 col-form-label">备注</label>
                                 <div class="col-sm-10"><input v-model="addRoomInfo.remark" type="text" placeholder="请填写备注信息" class="form-control"></div>

+ 8 - 0
WebService/src/main/resources/components/add-room/addRoom.js

@@ -11,6 +11,7 @@
                 apartment:'',
                 builtUpArea:'',
                 unitPrice:'',
+                state:'',
                 remark:'',
                 communityId:''
             }
@@ -118,6 +119,13 @@
                                     errInfo:"户型不能为空"
                                 }
                             ],
+                            'addRoomInfo.state':[
+                                {
+                                    limit:"required",
+                                    param:"",
+                                    errInfo:"房间状态不能为空"
+                                }
+                            ],
                             'addRoomInfo.builtUpArea':[
                                 {
                                     limit:"required",

+ 12 - 0
WebService/src/main/resources/components/edit-room/editRoom.html

@@ -46,6 +46,18 @@
                                 <label class="col-sm-2 col-form-label">房屋单价</label>
                                 <div class="col-sm-10"><input v-model="editRoomInfo.unitPrice" type="number" placeholder="必填,请填写房屋美平米单价" class="form-control"></div>
                             </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">房屋状态</label>
+                                <div class="col-sm-10">
+                                    <select class="custom-select" v-model="addRoomInfo.state">
+                                        <option selected disabled value="">必填,请选择房屋状态</option>
+                                        <option value="2001">已出售</option>
+                                        <option value="2002">未出售</option>
+                                        <option value="2003">已交定金</option>
+                                        <option value="2004">已出租</option>
+                                    </select>
+                                </div>
+                            </div>
                             <div class="form-group row">
                                 <label class="col-sm-2 col-form-label">备注</label>
                                 <div class="col-sm-10"><input v-model="editRoomInfo.remark" type="text" placeholder="请填写备注信息" class="form-control"></div>

+ 10 - 2
WebService/src/main/resources/components/edit-room/editRoom.js

@@ -12,6 +12,7 @@
                 apartment:'',
                 builtUpArea:'',
                 unitPrice:'',
+                state:'',
                 remark:'',
                 communityId:''
             }
@@ -22,7 +23,7 @@
          _initEvent:function(){
              vc.on('editRoom','openEditRoomModal',function(_room){
                  vc.copyObject(_room,vc.component.editRoomInfo);
-                 vc.component.loadUnits(_room.floorId);
+                 vc.component.loadUnitsFromEditRoom(_room.floorId);
                  $('#editRoomModel').modal('show');
 
                 vc.component.editRoomInfo.floorId = _room.floorId;
@@ -34,7 +35,7 @@
             /**
                 根据楼ID加载房屋
             **/
-            loadUnits:function(_floorId){
+            loadUnitsFromEditRoom:function(_floorId){
                 vc.component.editRoomUnits = [];
                 var param = {
                     params:{
@@ -114,6 +115,13 @@
                                     errInfo:"房间数必须为数字"
                                 }
                             ],
+                            'addRoomInfo.state':[
+                                {
+                                    limit:"required",
+                                    param:"",
+                                    errInfo:"房间状态不能为空"
+                                }
+                            ],
                             'editRoomInfo.apartment':[
                                 {
                                     limit:"required",

+ 15 - 9
WebService/src/main/resources/components/room/room.html

@@ -12,28 +12,30 @@
 
                     <div class="row">
                         <div class="col-sm-4 m-b-xs">
-                            <select class="form-control-sm form-control input-s-sm inline">
-                                <option selected  disabled value="">请选择单元</option>
-                                <option >1单元</option>
+                            <select class="form-control-sm form-control input-s-sm inline" v-model="roomInfo.unitId">
+                                <option selected  value="">请选择单元</option>
+                                <option v-for="(unit,index) in roomUnits" :key="index" v-bind:value="unit.unitId">{{unit.unitNum}}单元</option>
                             </select>
                         </div>
                         <div class="col-sm-3 m-b-xs">
-                            <select class="form-control-sm form-control input-s-sm inline">
-                                <option selected  disabled value="">请选择状态</option>
-                                <option>出售</option>
-                                <option>未出售</option>
+                            <select class="form-control-sm form-control input-s-sm inline" v-model="roomInfo.roomState">
+                                <option selected  value="">请选择状态</option>
+                                <option value="2001">已出售</option>
+                                <option value="2002">未出售</option>
+                                <option value="2003">已交定金</option>
+                                <option value="2004">已出租</option>
                             </select>
                         </div>
 
                         <div class="col-sm-3">
                             <div class="input-group">
-                                <input type="text" placeholder="请填写房屋编号" class="form-control form-control-sm">
+                                <input type="text" placeholder="请填写房屋编号" class="form-control form-control-sm" v-model="roomInfo.roomNum">
                             </div>
 
                         </div>
 
                         <div class="col-sm-2">
-                            <button type="button" class="btn btn-primary btn-sm" v-on:click="openSearchFloorModel()">
+                            <button type="button" class="btn btn-primary btn-sm" v-on:click="queryRoomMethod()">
                                 <i class="glyphicon glyphicon-search"></i> 马上查询</button>
                         </div>
 
@@ -50,6 +52,7 @@
                             <th data-hide="phone" >户型</th>
                             <th data-hide="phone">建筑面积</th>
                             <th data-hide="phone">单价</th>
+                            <th data-hide="phone">房屋状态</th>
                             <th data-hide="phone">创建员工</th>
                             <th data-hide="phone">备注</th>
                             <th class="text-right">操作</th>
@@ -82,6 +85,9 @@
                             <td>
                                 {{room.unitPrice}}
                             </td>
+                            <td>
+                                {{room.state}}
+                            </td>
                             <td>
                                 {{room.userName}}
                             </td>

+ 53 - 1
WebService/src/main/resources/components/room/room.js

@@ -6,11 +6,15 @@
     var DEFAULT_ROW = 10;
     vc.extends({
         data:{
+            roomUnits:[],
             roomInfo:{
                 rooms:[],
                 total:0,
                 records:1,
                 floorId:'',
+                unitId:'',
+                roomState:'',
+                roomNum:''
             }
         },
         _initMethod:function(){
@@ -22,7 +26,12 @@
             });
             vc.on('room','loadData',function(_param){
                 vc.component.roomInfo.floorId = _param.floorId;
+                vc.component.roomInfo.unitId = '';
+                vc.component.roomInfo.roomState = '';
+                vc.component.roomInfo.roomNum = '';
+
                 vc.component.listRoom(DEFAULT_PAGE,DEFAULT_ROW);
+                vc.component.loadUnits(_param.floorId);
             });
             vc.on('pagination','page_event',function(_currentPage){
                 vc.component.listRoom(_currentPage,DEFAULT_ROW);
@@ -35,7 +44,11 @@
                         page:_page,
                         row:_row,
                         communityId:vc.getCurrentCommunity().communityId,
-                        floorId:vc.component.roomInfo.floorId
+                        floorId:vc.component.roomInfo.floorId,
+                        unitId:vc.component.roomInfo.unitId,
+                        roomState:vc.component.roomInfo.roomState,
+                        roomNum:vc.component.roomInfo.roomNum
+
                     }
                 }
                //发送get请求
@@ -65,6 +78,45 @@
             _openDelRoomModel:function(_room){
                  _room.floorId = vc.component.roomInfo.floorId;
                  vc.emit('deleteRoom','openRoomModel',_room);
+            },
+            /**
+                根据楼ID加载房屋
+            **/
+            loadUnits:function(_floorId){
+                vc.component.addRoomUnits = [];
+                var param = {
+                    params:{
+                        floorId:_floorId,
+                        communityId:vc.getCurrentCommunity().communityId
+                    }
+                }
+                vc.http.get(
+                    'room',
+                    'loadUnits',
+                     param,
+                     function(json,res){
+                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
+                        if(res.status == 200){
+                            var tmpUnits = JSON.parse(json);
+                            vc.component.roomUnits = tmpUnits;
+                            /*if(tmpUnits == null || tmpUnits.length == 0){
+                                return ;
+                            }
+                            for(var unitIndex = 0; unitIndex < tmpUnits.length;unitIndex++){
+                               vc.component.addRoomInfo.units[unitIndex] = tmpUnits[unitIndex];
+                            }*/
+                            return ;
+                        }
+                        vc.message(json);
+                     },
+                     function(errInfo,error){
+                        console.log('请求失败处理');
+
+                        vc.message(errInfo);
+                     });
+            },
+            queryRoomMethod:function(){
+                vc.component.listRoom(DEFAULT_PAGE,DEFAULT_ROW);
             }
         }
     });

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

@@ -28,6 +28,8 @@ public class RoomDto extends PageDto implements Serializable {
     private String floorId;
     private String userName;
 
+    private String state;
+
     private String unitNum;
 
     private List<RoomAttrDto> roomAttrDto;
@@ -175,4 +177,12 @@ public class RoomDto extends PageDto implements Serializable {
     public void setUnitNum(String unitNum) {
         this.unitNum = unitNum;
     }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
 }

+ 10 - 0
java110-bean/src/main/java/com/java110/vo/api/ApiRoomDataVo.java

@@ -22,6 +22,8 @@ public class ApiRoomDataVo implements Serializable {
     private String roomNum;
     private String unitId;
     private String unitNum;
+
+    private String state;
     private String apartment;
 
 
@@ -113,4 +115,12 @@ public class ApiRoomDataVo implements Serializable {
     public void setUnitNum(String unitNum) {
         this.unitNum = unitNum;
     }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
 }

+ 33 - 12
java110-config/src/main/resources/mapper/room/RoomServiceDaoImplMapper.xml

@@ -7,16 +7,16 @@
     <!-- 保存小区房屋信息 add by wuxw 2018-07-03 -->
        <insert id="saveBusinessRoomInfo" parameterType="Map">
            insert into business_building_room(
-unit_price,section,remark,user_id,room_id,layer,built_up_area,operate,room_num,unit_id,b_id,apartment
+unit_price,section,remark,user_id,room_id,layer,built_up_area,operate,room_num,unit_id,b_id,apartment,state
 ) values (
-#{unitPrice},#{section},#{remark},#{userId},#{roomId},#{layer},#{builtUpArea},#{operate},#{roomNum},#{unitId},#{bId},#{apartment}
+#{unitPrice},#{section},#{remark},#{userId},#{roomId},#{layer},#{builtUpArea},#{operate},#{roomNum},#{unitId},#{bId},#{apartment},#{state}
 )
        </insert>
 
 
        <!-- 查询小区房屋信息(Business) add by wuxw 2018-07-03 -->
        <select id="getBusinessRoomInfo" parameterType="Map" resultType="Map">
-           select  t.unit_price,t.unit_price unitPrice,t.section,t.remark,t.user_id,t.user_id userId,t.room_id,t.room_id roomId,t.layer,t.built_up_area,t.built_up_area builtUpArea,t.operate,t.room_num,t.room_num roomNum,t.unit_id,t.unit_id unitId,t.b_id,t.b_id bId,t.apartment 
+           select  t.unit_price,t.unit_price unitPrice,t.section,t.remark,t.user_id,t.user_id userId,t.room_id,t.room_id roomId,t.layer,t.built_up_area,t.built_up_area builtUpArea,t.operate,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
 from business_building_room t 
 where 1 =1 
 <if test="unitPrice !=null and unitPrice != ''">
@@ -54,7 +54,10 @@ where 1 =1
 </if> 
 <if test="apartment !=null and apartment != ''">
    and t.apartment= #{apartment}
-</if> 
+</if>
+           <if test="state !=null and state != ''">
+               and t.state= #{state}
+           </if>
 
        </select>
 
@@ -65,8 +68,8 @@ where 1 =1
     <!-- 保存小区房屋信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveRoomInfoInstance" parameterType="Map">
         insert into building_room(
-unit_price,section,status_cd,remark,user_id,room_id,layer,built_up_area,room_num,unit_id,b_id,apartment
-) select t.unit_price,t.section,'0',t.remark,t.user_id,t.room_id,t.layer,t.built_up_area,t.room_num,t.unit_id,t.b_id,t.apartment from business_building_room t where 1=1
+unit_price,section,status_cd,remark,user_id,room_id,layer,built_up_area,room_num,unit_id,b_id,apartment,state
+) select t.unit_price,t.section,'0',t.remark,t.user_id,t.room_id,t.layer,t.built_up_area,t.room_num,t.unit_id,t.b_id,t.apartment,t.state from business_building_room t where 1=1
 <if test="unitPrice !=null and unitPrice != ''">
    and t.unit_price= #{unitPrice}
 </if> 
@@ -100,7 +103,10 @@ unit_price,section,status_cd,remark,user_id,room_id,layer,built_up_area,room_num
 </if> 
 <if test="apartment !=null and apartment != ''">
    and t.apartment= #{apartment}
-</if> 
+</if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
 
     </insert>
 
@@ -108,7 +114,7 @@ unit_price,section,status_cd,remark,user_id,room_id,layer,built_up_area,room_num
 
     <!-- 查询小区房屋信息 add by wuxw 2018-07-03 -->
     <select id="getRoomInfo" parameterType="Map" resultType="Map">
-        select  t.unit_price,t.unit_price unitPrice,t.section,t.status_cd,t.status_cd statusCd,t.remark,t.user_id,t.user_id userId,t.room_id,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 
+        select  t.unit_price,t.unit_price unitPrice,t.section,t.status_cd,t.status_cd statusCd,t.remark,t.user_id,t.user_id userId,t.room_id,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
 from building_room t 
 where 1 =1 
 <if test="unitPrice !=null and unitPrice != ''">
@@ -149,7 +155,10 @@ where 1 =1
 </if> 
 <if test="page != -1 and page != null">
    limit #{page},#{row}
-</if> 
+</if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
 
     </select>
 
@@ -188,7 +197,10 @@ where 1 =1
 </if> 
 <if test="apartment !=null and apartment != ''">
 , t.apartment= #{apartment}
-</if> 
+</if>
+        <if test="state !=null and state != ''">
+            , t.state= #{state}
+        </if>
  where 1=1 <if test="roomId !=null and roomId != ''">
 and t.room_id= #{roomId}
 </if> 
@@ -238,7 +250,10 @@ where 1 =1
 </if> 
 <if test="apartment !=null and apartment != ''">
    and t.apartment= #{apartment}
-</if> 
+</if>
+         <if test="state !=null and state != ''">
+             and t.state= #{state}
+         </if>
 
 
      </select>
@@ -299,6 +314,9 @@ where 1 =1
         <if test="apartment !=null and apartment != ''">
             and t.apartment= #{apartment}
         </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
 
 
     </select>
@@ -307,7 +325,7 @@ where 1 =1
     <select id="getRoomInfoByCommunityId" parameterType="Map" resultType="Map">
         SELECT  t.unit_price,t.unit_price unitPrice,t.section,t.status_cd,t.status_cd statusCd,t.remark,t.user_id,
         t.user_id userId,t.room_id,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,u.`unit_num` unitNum
+        t.room_num roomNum,t.unit_id,t.unit_id unitId,t.b_id,t.b_id bId,t.apartment,t.state,u.`unit_num` unitNum
         FROM building_room t,s_community c,s_community_member cm,building_unit u,f_floor f
         WHERE 1 =1
             AND t.`unit_id` = u.`unit_id`
@@ -359,6 +377,9 @@ where 1 =1
         <if test="apartment !=null and apartment != ''">
             and t.apartment= #{apartment}
         </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
         <if test="page != -1 and page != null">
             limit #{page},#{row}
         </if>