dingxin 6 years ago
parent
commit
5ab8abb496

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TpHotelController.java View File

@@ -35,9 +35,9 @@ public class TpHotelController extends BaseController {
35 35
     private TpHotelServicel tpHotelServicel;
36 36
 
37 37
 
38
-    @ApiOperation(value = "获取所有酒店", notes = "获取所有酒店")
38
+    @ApiOperation(value = "获取本小区酒店", notes = "获取本小区酒店")
39 39
     @ApiImplicitParams({
40
-            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
40
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
41 41
     })
42 42
     @RequestMapping(value = "/hotel",method = RequestMethod.GET)
43 43
     public Object getHotel(HttpSession session){

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TpRentalHouseController.java View File

@@ -50,7 +50,7 @@ public class TpRentalHouseController extends BaseController{
50 50
                                     @RequestParam(value = "rentalPriceValue",required = false) Integer rentalPriceValue,
51 51
                                     @RequestParam(value = "priceFluctuateValue",required = false) Integer priceFluctuateValue,
52 52
                                  @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
53
-                                 @RequestParam(value = "pageSize", defaultValue = "3") Integer pageSize){
53
+                                 @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize){
54 54
         UserElement userElement = getUserElement(session);
55 55
         ResponseBean responseBean = tpRentalHouseServicel.getRentalHouse(userElement,houseName,rentalTypeValue,houseTypeValue,rentalPriceValue,priceFluctuateValue,pageNum,pageSize);
56 56
         return responseBean;

+ 6
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TpShopController.java View File

@@ -35,13 +35,17 @@ public class TpShopController extends BaseController{
35 35
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
36 36
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "shopName",value = "搜所名称"),
37 37
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "tpShopTypeId",value = "商铺类型"),
38
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
39
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")
38 40
     })
39 41
     @RequestMapping(value = "/shop",method = RequestMethod.GET)
40 42
     public Object getShop(HttpSession session,
41 43
                           @RequestParam(value = "shopName",required = false ) String houseName,
42
-                          @RequestParam(value = "tpShopTypeId",required = false ) Integer tpShopTypeId){
44
+                          @RequestParam(value = "tpShopTypeId",required = false ) Integer tpShopTypeId,
45
+                          @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
46
+                          @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize){
43 47
         UserElement userElement = getUserElement(session);
44
-        ResponseBean responseBean = tpShopServicel.getShop(userElement,houseName,tpShopTypeId);
48
+        ResponseBean responseBean = tpShopServicel.getShop(userElement,houseName,tpShopTypeId,pageNum,pageSize);
45 49
         return responseBean;
46 50
     }
47 51
 

+ 28
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpHotelRoomMapper.java View File

@@ -0,0 +1,28 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TpHotelRoom;
4
+import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+
9
+@Mapper
10
+public interface TpHotelRoomMapper {
11
+    int deleteByPrimaryKey(Integer id);
12
+
13
+    int insert(TpHotelRoom record);
14
+
15
+    int insertSelective(TpHotelRoom record);
16
+
17
+    TpHotelRoom selectByPrimaryKey(Integer id);
18
+
19
+    int updateByPrimaryKeySelective(TpHotelRoom record);
20
+
21
+    int updateByPrimaryKey(TpHotelRoom record);
22
+
23
+    /**
24
+     * 获取当前所有房间
25
+     * @return
26
+     */
27
+    List<TpHotelRoom> selectHotelRoomList(@Param("communityId") Integer communityId,@Param("hotelId") Integer hotelId);
28
+}

+ 15
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpHotel.java View File

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3 3
 import java.util.Date;
4
+import java.util.List;
4 5
 
5 6
 public class TpHotel {
6 7
     private Integer id;
@@ -53,6 +54,20 @@ public class TpHotel {
53 54
      */
54 55
     private String hotelIntroduction;
55 56
 
57
+    /**
58
+     * 房间
59
+     * @return
60
+     */
61
+    private List<TpHotelRoom> tpHotelRoomsList;
62
+
63
+    public void setTpHotelRoomsList(List<TpHotelRoom> tpHotelRoomsList) {
64
+        this.tpHotelRoomsList = tpHotelRoomsList;
65
+    }
66
+
67
+    public List<TpHotelRoom> getTpHotelRoomsList() {
68
+        return tpHotelRoomsList;
69
+    }
70
+
56 71
     public Integer getId() {
57 72
         return id;
58 73
     }

+ 172
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpHotelRoom.java View File

@@ -0,0 +1,172 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TpHotelRoom {
6
+
7
+    private Integer id;
8
+
9
+    /**
10
+     * 小区ID
11
+     */
12
+    private Integer communityId;
13
+
14
+    /**
15
+     * 酒店ID
16
+      */
17
+    private Integer hotelId;
18
+
19
+    /**
20
+     * 房间编号
21
+     */
22
+    private String roomNo;
23
+
24
+    /**
25
+     * 房间名称
26
+     */
27
+    private String roomName;
28
+
29
+    /**
30
+     * 排序(权重)
31
+     */
32
+    private Integer sort;
33
+
34
+    /**
35
+     * 房间价格
36
+     */
37
+    private String price;
38
+
39
+    /**
40
+     * 上架状态 1 是已上架 2是已下架
41
+     */
42
+    private String roomStatus;
43
+
44
+    /**
45
+     * 房间备注
46
+     */
47
+    private String remark;
48
+
49
+    /**
50
+     * 创建时间
51
+     */
52
+    private Date createDate;
53
+
54
+    /**
55
+     * 创建人
56
+     */
57
+    private Integer createUser;
58
+
59
+    /**
60
+     * 更新时间
61
+     */
62
+    private Date updateDate;
63
+
64
+    /**
65
+     * 更新人
66
+     */
67
+    private Integer updateUser;
68
+
69
+    public Integer getId() {
70
+        return id;
71
+    }
72
+
73
+    public void setId(Integer id) {
74
+        this.id = id;
75
+    }
76
+
77
+    public Integer getCommunityId() {
78
+        return communityId;
79
+    }
80
+
81
+    public void setCommunityId(Integer communityId) {
82
+        this.communityId = communityId;
83
+    }
84
+
85
+    public Integer getHotelId() {
86
+        return hotelId;
87
+    }
88
+
89
+    public void setHotelId(Integer hotelId) {
90
+        this.hotelId = hotelId;
91
+    }
92
+
93
+    public String getRoomNo() {
94
+        return roomNo;
95
+    }
96
+
97
+    public void setRoomNo(String roomNo) {
98
+        this.roomNo = roomNo == null ? null : roomNo.trim();
99
+    }
100
+
101
+    public String getRoomName() {
102
+        return roomName;
103
+    }
104
+
105
+    public void setRoomName(String roomName) {
106
+        this.roomName = roomName == null ? null : roomName.trim();
107
+    }
108
+
109
+    public Integer getSort() {
110
+        return sort;
111
+    }
112
+
113
+    public void setSort(Integer sort) {
114
+        this.sort = sort;
115
+    }
116
+
117
+    public String getPrice() {
118
+        return price;
119
+    }
120
+
121
+    public void setPrice(String price) {
122
+        this.price = price == null ? null : price.trim();
123
+    }
124
+
125
+    public String getRoomStatus() {
126
+        return roomStatus;
127
+    }
128
+
129
+    public void setRoomStatus(String roomStatus) {
130
+        this.roomStatus = roomStatus == null ? null : roomStatus.trim();
131
+    }
132
+
133
+    public String getRemark() {
134
+        return remark;
135
+    }
136
+
137
+    public void setRemark(String remark) {
138
+        this.remark = remark == null ? null : remark.trim();
139
+    }
140
+
141
+    public Date getCreateDate() {
142
+        return createDate;
143
+    }
144
+
145
+    public void setCreateDate(Date createDate) {
146
+        this.createDate = createDate;
147
+    }
148
+
149
+    public Integer getCreateUser() {
150
+        return createUser;
151
+    }
152
+
153
+    public void setCreateUser(Integer createUser) {
154
+        this.createUser = createUser;
155
+    }
156
+
157
+    public Date getUpdateDate() {
158
+        return updateDate;
159
+    }
160
+
161
+    public void setUpdateDate(Date updateDate) {
162
+        this.updateDate = updateDate;
163
+    }
164
+
165
+    public Integer getUpdateUser() {
166
+        return updateUser;
167
+    }
168
+
169
+    public void setUpdateUser(Integer updateUser) {
170
+        this.updateUser = updateUser;
171
+    }
172
+}

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TpShopServicel.java View File

@@ -17,7 +17,7 @@ public interface TpShopServicel {
17 17
      * @param userElement
18 18
      * @return
19 19
      */
20
-    ResponseBean getShop(UserElement userElement,String houseName,Integer tpShopTypeId);
20
+    ResponseBean getShop(UserElement userElement,String houseName,Integer tpShopTypeId,Integer pageNum,Integer pageSize);
21 21
 
22 22
     /**
23 23
      * 获取线下商铺详情

+ 8
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TpHotelServiceimpl.java View File

@@ -4,8 +4,10 @@ import com.community.commom.mode.ResponseBean;
4 4
 import com.community.commom.session.UserElement;
5 5
 import com.community.huiju.dao.TpHotelImgMapper;
6 6
 import com.community.huiju.dao.TpHotelMapper;
7
+import com.community.huiju.dao.TpHotelRoomMapper;
7 8
 import com.community.huiju.model.TpHotel;
8 9
 import com.community.huiju.model.TpHotelImg;
10
+import com.community.huiju.model.TpHotelRoom;
9 11
 import com.community.huiju.service.TpHotelServicel;
10 12
 import org.springframework.beans.factory.annotation.Autowired;
11 13
 import org.springframework.stereotype.Service;
@@ -32,12 +34,18 @@ public class TpHotelServiceimpl implements TpHotelServicel {
32 34
     @Autowired
33 35
     private TpHotelImgMapper tpHotelImgMapper;
34 36
 
37
+    @Autowired
38
+    private TpHotelRoomMapper tpHotelRoomMapper;
39
+
35 40
     @Override
36 41
     public ResponseBean getHotel(UserElement userElement) {
37 42
        ResponseBean responseBean= new ResponseBean<>();
38 43
         // 每个小区只有一个酒店
39 44
         TpHotel tpHotel= tpHotelMapper.selectCommunityHotel(userElement.getCommunityId());
40 45
         if (null != tpHotel) {
46
+            // 获取当前酒店所有房间
47
+            List<TpHotelRoom> tpHotelRoom = tpHotelRoomMapper.selectHotelRoomList(userElement.getCommunityId(),tpHotel.getId());
48
+            tpHotel.setTpHotelRoomsList(tpHotelRoom);
41 49
             // 查询当前酒店所有的banner图
42 50
             List<String> img = tpHotelImgMapper.selectHotelImg(tpHotel.getId(), userElement.getCommunityId());
43 51
             Map map = new HashMap<>();

+ 10
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TpRentalHouseServicelImpl.java View File

@@ -5,9 +5,13 @@ import com.community.commom.mode.ResponseBean;
5 5
 import com.community.commom.session.UserElement;
6 6
 import com.community.huiju.dao.TpRentalHouseImgMapper;
7 7
 import com.community.huiju.dao.TpRentalHouseMapper;
8
+import com.community.huiju.model.TpAnnouncement;
8 9
 import com.community.huiju.model.TpRentalHouse;
9 10
 import com.community.huiju.model.TpRentalHouseImg;
10 11
 import com.community.huiju.service.TpRentalHouseServicel;
12
+import com.github.pagehelper.Page;
13
+import com.github.pagehelper.PageHelper;
14
+import com.google.common.collect.Maps;
11 15
 import org.springframework.beans.factory.annotation.Autowired;
12 16
 import org.springframework.stereotype.Service;
13 17
 
@@ -34,7 +38,9 @@ public class TpRentalHouseServicelImpl implements TpRentalHouseServicel {
34 38
     @Override
35 39
     public ResponseBean getRentalHouse(UserElement userElement, String houseName, Integer rentalType, Integer houseType, Integer rentalPrice, Integer priceFluctuate,Integer pageNum,Integer pageSize) {
36 40
         ResponseBean response= new ResponseBean<>();
37
-
41
+        Map<String, Object> parameter = Maps.newHashMap();
42
+        //使用分页插件
43
+        Page<TpRentalHouse> pageTpRentalHouseList = PageHelper.startPage(pageNum, pageSize);
38 44
         List<TpRentalHouse> tpRentalHouseList= tpRentalHouseMapper.getRentalHouse(houseName,rentalType,houseType,rentalPrice,priceFluctuate);
39 45
         for (TpRentalHouse tpRentalHouse:tpRentalHouseList){
40 46
             // 根据 tpRentalHouse.getId()和img_type为2查询列表图
@@ -45,7 +51,9 @@ public class TpRentalHouseServicelImpl implements TpRentalHouseServicel {
45 51
                  }
46 52
              }
47 53
         }
48
-        response.addSuccess(tpRentalHouseList);
54
+        parameter.put("total", pageTpRentalHouseList.getTotal());
55
+        parameter.put("list", tpRentalHouseList);
56
+        response.addSuccess(parameter);
49 57
         return response;
50 58
     }
51 59
 

+ 12
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TpShopServicelmpl.java View File

@@ -5,10 +5,14 @@ import com.community.commom.session.UserElement;
5 5
 import com.community.huiju.dao.TpShopImgMapper;
6 6
 import com.community.huiju.dao.TpShopMapper;
7 7
 import com.community.huiju.dao.TpShopTypeMapper;
8
+import com.community.huiju.model.TpAnnouncement;
8 9
 import com.community.huiju.model.TpShop;
9 10
 import com.community.huiju.model.TpShopImg;
10 11
 import com.community.huiju.model.TpShopType;
11 12
 import com.community.huiju.service.TpShopServicel;
13
+import com.github.pagehelper.Page;
14
+import com.github.pagehelper.PageHelper;
15
+import com.google.common.collect.Maps;
12 16
 import org.springframework.beans.factory.annotation.Autowired;
13 17
 import org.springframework.stereotype.Service;
14 18
 
@@ -36,8 +40,11 @@ public class TpShopServicelmpl implements TpShopServicel {
36 40
     @Autowired
37 41
     private TpShopImgMapper tpShopImgMapper;
38 42
     @Override
39
-    public ResponseBean getShop(UserElement userElement,String houseName,Integer tpShopTypeId) {
43
+    public ResponseBean getShop(UserElement userElement,String houseName,Integer tpShopTypeId,Integer pageNum,Integer pageSize) {
40 44
         ResponseBean responseBean= new ResponseBean<>();
45
+        Map<String, Object> parameter = Maps.newHashMap();
46
+        //使用分页插件
47
+        Page<TpShop> pageShopList = PageHelper.startPage(pageNum, pageSize);
41 48
         List<TpShop> tpShopList= tpShopMapper.selectcommunityIdShop(userElement.getCommunityId(),houseName,tpShopTypeId);
42 49
         if (null != tpShopList) {
43 50
             for (TpShop tpShop : tpShopList) {
@@ -49,10 +56,10 @@ public class TpShopServicelmpl implements TpShopServicel {
49 56
             }
50 57
         }
51 58
         List<TpShopType> tpShopTypeList = tpShopTypeMapper.selectCommunityIdShop(userElement.getCommunityId());
52
-        Map map= new HashMap<>();
53
-        map.put("tpShopTypeList",tpShopTypeList);
54
-        map.put("tpShopList",tpShopList);
55
-        responseBean.addSuccess(map);
59
+        parameter.put("total", pageShopList.getTotal());
60
+        parameter.put("list", tpShopList);
61
+        parameter.put("tpShopTypeList",tpShopTypeList);
62
+        responseBean.addSuccess(parameter);
56 63
         return responseBean;
57 64
     }
58 65
 

+ 197
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpHotelRoomMapper.xml View File

@@ -0,0 +1,197 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TpHotelRoomMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpHotelRoom" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="hotel_id" property="hotelId" jdbcType="INTEGER" />
8
+    <result column="room_no" property="roomNo" jdbcType="VARCHAR" />
9
+    <result column="room_name" property="roomName" jdbcType="VARCHAR" />
10
+    <result column="sort" property="sort" jdbcType="INTEGER" />
11
+    <result column="price" property="price" jdbcType="VARCHAR" />
12
+    <result column="room_status" property="roomStatus" jdbcType="VARCHAR" />
13
+    <result column="remark" property="remark" jdbcType="VARCHAR" />
14
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
15
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
16
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
17
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
18
+  </resultMap>
19
+  <sql id="Base_Column_List" >
20
+    id, community_id, hotel_id, room_no, room_name, sort, price, room_status, remark, 
21
+    create_date, create_user, update_date, update_user
22
+  </sql>
23
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
24
+    select 
25
+    <include refid="Base_Column_List" />
26
+    from tp_hotel_room
27
+    where id = #{id,jdbcType=INTEGER}
28
+  </select>
29
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
30
+    delete from tp_hotel_room
31
+    where id = #{id,jdbcType=INTEGER}
32
+  </delete>
33
+  <insert id="insert" parameterType="com.community.huiju.model.TpHotelRoom" >
34
+    insert into tp_hotel_room (id, community_id, hotel_id, 
35
+      room_no, room_name, sort, 
36
+      price, room_status, remark, 
37
+      create_date, create_user, update_date, 
38
+      update_user)
39
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{hotelId,jdbcType=INTEGER}, 
40
+      #{roomNo,jdbcType=VARCHAR}, #{roomName,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, 
41
+      #{price,jdbcType=VARCHAR}, #{roomStatus,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, 
42
+      #{createDate,jdbcType=TIMESTAMP}, #{createUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP}, 
43
+      #{updateUser,jdbcType=INTEGER})
44
+  </insert>
45
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpHotelRoom" >
46
+    insert into tp_hotel_room
47
+    <trim prefix="(" suffix=")" suffixOverrides="," >
48
+      <if test="id != null" >
49
+        id,
50
+      </if>
51
+      <if test="communityId != null" >
52
+        community_id,
53
+      </if>
54
+      <if test="hotelId != null" >
55
+        hotel_id,
56
+      </if>
57
+      <if test="roomNo != null" >
58
+        room_no,
59
+      </if>
60
+      <if test="roomName != null" >
61
+        room_name,
62
+      </if>
63
+      <if test="sort != null" >
64
+        sort,
65
+      </if>
66
+      <if test="price != null" >
67
+        price,
68
+      </if>
69
+      <if test="roomStatus != null" >
70
+        room_status,
71
+      </if>
72
+      <if test="remark != null" >
73
+        remark,
74
+      </if>
75
+      <if test="createDate != null" >
76
+        create_date,
77
+      </if>
78
+      <if test="createUser != null" >
79
+        create_user,
80
+      </if>
81
+      <if test="updateDate != null" >
82
+        update_date,
83
+      </if>
84
+      <if test="updateUser != null" >
85
+        update_user,
86
+      </if>
87
+    </trim>
88
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
89
+      <if test="id != null" >
90
+        #{id,jdbcType=INTEGER},
91
+      </if>
92
+      <if test="communityId != null" >
93
+        #{communityId,jdbcType=INTEGER},
94
+      </if>
95
+      <if test="hotelId != null" >
96
+        #{hotelId,jdbcType=INTEGER},
97
+      </if>
98
+      <if test="roomNo != null" >
99
+        #{roomNo,jdbcType=VARCHAR},
100
+      </if>
101
+      <if test="roomName != null" >
102
+        #{roomName,jdbcType=VARCHAR},
103
+      </if>
104
+      <if test="sort != null" >
105
+        #{sort,jdbcType=INTEGER},
106
+      </if>
107
+      <if test="price != null" >
108
+        #{price,jdbcType=VARCHAR},
109
+      </if>
110
+      <if test="roomStatus != null" >
111
+        #{roomStatus,jdbcType=VARCHAR},
112
+      </if>
113
+      <if test="remark != null" >
114
+        #{remark,jdbcType=VARCHAR},
115
+      </if>
116
+      <if test="createDate != null" >
117
+        #{createDate,jdbcType=TIMESTAMP},
118
+      </if>
119
+      <if test="createUser != null" >
120
+        #{createUser,jdbcType=INTEGER},
121
+      </if>
122
+      <if test="updateDate != null" >
123
+        #{updateDate,jdbcType=TIMESTAMP},
124
+      </if>
125
+      <if test="updateUser != null" >
126
+        #{updateUser,jdbcType=INTEGER},
127
+      </if>
128
+    </trim>
129
+  </insert>
130
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpHotelRoom" >
131
+    update tp_hotel_room
132
+    <set >
133
+      <if test="communityId != null" >
134
+        community_id = #{communityId,jdbcType=INTEGER},
135
+      </if>
136
+      <if test="hotelId != null" >
137
+        hotel_id = #{hotelId,jdbcType=INTEGER},
138
+      </if>
139
+      <if test="roomNo != null" >
140
+        room_no = #{roomNo,jdbcType=VARCHAR},
141
+      </if>
142
+      <if test="roomName != null" >
143
+        room_name = #{roomName,jdbcType=VARCHAR},
144
+      </if>
145
+      <if test="sort != null" >
146
+        sort = #{sort,jdbcType=INTEGER},
147
+      </if>
148
+      <if test="price != null" >
149
+        price = #{price,jdbcType=VARCHAR},
150
+      </if>
151
+      <if test="roomStatus != null" >
152
+        room_status = #{roomStatus,jdbcType=VARCHAR},
153
+      </if>
154
+      <if test="remark != null" >
155
+        remark = #{remark,jdbcType=VARCHAR},
156
+      </if>
157
+      <if test="createDate != null" >
158
+        create_date = #{createDate,jdbcType=TIMESTAMP},
159
+      </if>
160
+      <if test="createUser != null" >
161
+        create_user = #{createUser,jdbcType=INTEGER},
162
+      </if>
163
+      <if test="updateDate != null" >
164
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
165
+      </if>
166
+      <if test="updateUser != null" >
167
+        update_user = #{updateUser,jdbcType=INTEGER},
168
+      </if>
169
+    </set>
170
+    where id = #{id,jdbcType=INTEGER}
171
+  </update>
172
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpHotelRoom" >
173
+    update tp_hotel_room
174
+    set community_id = #{communityId,jdbcType=INTEGER},
175
+      hotel_id = #{hotelId,jdbcType=INTEGER},
176
+      room_no = #{roomNo,jdbcType=VARCHAR},
177
+      room_name = #{roomName,jdbcType=VARCHAR},
178
+      sort = #{sort,jdbcType=INTEGER},
179
+      price = #{price,jdbcType=VARCHAR},
180
+      room_status = #{roomStatus,jdbcType=VARCHAR},
181
+      remark = #{remark,jdbcType=VARCHAR},
182
+      create_date = #{createDate,jdbcType=TIMESTAMP},
183
+      create_user = #{createUser,jdbcType=INTEGER},
184
+      update_date = #{updateDate,jdbcType=TIMESTAMP},
185
+      update_user = #{updateUser,jdbcType=INTEGER}
186
+    where id = #{id,jdbcType=INTEGER}
187
+  </update>
188
+
189
+  <select id="selectHotelRoomList" resultType="com.community.huiju.model.TpHotelRoom">
190
+    select
191
+    <include refid="Base_Column_List" />
192
+    from tp_hotel_room
193
+    where  community_id = #{communityId,jdbcType=INTEGER}
194
+    and hotel_id = #{hotelId,jdbcType=INTEGER}
195
+    and room_status = 1
196
+  </select>
197
+</mapper>