1098226878 лет назад: 4
Родитель
Сommit
4014c170cc

+ 97 - 0
java110-db/src/main/resources/mapper/community/RoomAttrV1ServiceDaoImplMapper.xml

@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="roomAttrV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存房屋属性信息 add by wuxw 2018-07-03 -->
+    <insert id="saveRoomAttrInfo" parameterType="Map">
+        insert into building_room_attr(
+attr_id,spec_cd,value,room_id
+) values (
+#{attrId},#{specCd},#{value},#{roomId}
+)
+    </insert>
+
+
+
+    <!-- 查询房屋属性信息 add by wuxw 2018-07-03 -->
+    <select id="getRoomAttrInfo" parameterType="Map" resultType="Map">
+        select  t.attr_id,t.attr_id attrId,t.spec_cd,t.spec_cd specCd,t.status_cd,t.status_cd statusCd,t.value,t.room_id,t.room_id roomId 
+from building_room_attr t 
+where 1 =1 
+<if test="attrId !=null and attrId != ''">
+   and t.attr_id= #{attrId}
+</if> 
+<if test="specCd !=null and specCd != ''">
+   and t.spec_cd= #{specCd}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="value !=null and value != ''">
+   and t.value= #{value}
+</if> 
+<if test="roomId !=null and roomId != ''">
+   and t.room_id= #{roomId}
+</if> 
+order by t.create_time desc
+<if test="page != -1 and page != null ">
+   limit #{page}, #{row}
+</if> 
+
+    </select>
+
+
+
+
+    <!-- 修改房屋属性信息 add by wuxw 2018-07-03 -->
+    <update id="updateRoomAttrInfo" parameterType="Map">
+        update  building_room_attr t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="specCd !=null and specCd != ''">
+, t.spec_cd= #{specCd}
+</if> 
+<if test="value !=null and value != ''">
+, t.value= #{value}
+</if> 
+<if test="roomId !=null and roomId != ''">
+, t.room_id= #{roomId}
+</if> 
+ where 1=1 <if test="attrId !=null and attrId != ''">
+and t.attr_id= #{attrId}
+</if> 
+
+    </update>
+
+    <!-- 查询房屋属性数量 add by wuxw 2018-07-03 -->
+     <select id="queryRoomAttrsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from building_room_attr t 
+where 1 =1 
+<if test="attrId !=null and attrId != ''">
+   and t.attr_id= #{attrId}
+</if> 
+<if test="specCd !=null and specCd != ''">
+   and t.spec_cd= #{specCd}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="value !=null and value != ''">
+   and t.value= #{value}
+</if> 
+<if test="roomId !=null and roomId != ''">
+   and t.room_id= #{roomId}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 22 - 38
java110-generator/src/main/resources/newBack/template_1.json

@@ -1,55 +1,39 @@
 {
+  "autoMove": true,
+  "desc": "房屋属性",
+  "id": "attrId",
+  "name": "roomAttr",
   "param": {
-    "relId": "rel_id",
-    "remark": "remark",
+    "attrId": "attr_id",
+    "roomId": "room_id",
+    "specCd": "spec_cd",
     "statusCd": "status_cd",
-    "startTime": "start_time",
-    "state": "state",
-    "endTime": "end_time",
-    "ownerId": "owner_id",
-    "userId": "user_id",
-    "roomId": "room_id"
+    "value": "value"
   },
-  "name": "ownerRoomRel",
-  "shareColumn": "community_id",
-  "id": "relId",
-  "shareName": "community",
-  "autoMove": true,
   "required": [
     {
-      "msg": "关系ID不能为空",
-      "code": "relId"
-    },
-    {
-      "msg": "业主ID不能为空",
-      "code": "ownerId"
+      "code": "attrId",
+      "msg": "属性id不能为空"
     },
     {
-      "msg": "房间ID不能为空",
-      "code": "roomId"
+      "code": "roomId",
+      "msg": "房屋ID不能为空"
     },
     {
-      "msg": "业务状态不能为空",
-      "code": "state"
+      "code": "specCd",
+      "msg": "规格id,参考spec表不能为空"
     },
     {
-      "msg": "用户ID不能为空",
-      "code": "userId"
+      "code": "value",
+      "msg": "属性值不能为空"
     },
     {
-      "msg": "数据状态不能为空",
-      "code": "statusCd"
-    },
-    {
-      "msg": "起租时间不能为空",
-      "code": "startTime"
-    },
-    {
-      "msg": "起租时间不能为空",
-      "code": "endTime"
+      "code": "statusCd",
+      "msg": "数据状态不能为空"
     }
   ],
-  "desc": "业主房屋关系表",
+  "shareColumn": "community_id",
+  "shareName": "community",
   "shareParam": "communityId",
-  "tableName": "building_owner_room_rel"
-}
+  "tableName": "building_room_attr"
+}

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/community/IRoomAttrV1InnerServiceSMO.java

@@ -0,0 +1,68 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.intf.community;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.RoomAttrDto;
+import com.java110.po.room.RoomAttrPo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2021-09-16 10:16:52 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@FeignClient(name = "community-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/roomAttrV1Api")
+public interface IRoomAttrV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveRoomAttr", method = RequestMethod.POST)
+    public int saveRoomAttr(@RequestBody RoomAttrPo roomAttrPo);
+
+    @RequestMapping(value = "/updateRoomAttr", method = RequestMethod.POST)
+    public int updateRoomAttr(@RequestBody  RoomAttrPo roomAttrPo);
+
+    @RequestMapping(value = "/deleteRoomAttr", method = RequestMethod.POST)
+    public int deleteRoomAttr(@RequestBody  RoomAttrPo roomAttrPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param roomAttrDto 数据对象分享
+     * @return RoomAttrDto 对象数据
+     */
+    @RequestMapping(value = "/queryRoomAttrs", method = RequestMethod.POST)
+    List<RoomAttrDto> queryRoomAttrs(@RequestBody RoomAttrDto roomAttrDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param roomAttrDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryRoomAttrsCount", method = RequestMethod.POST)
+    int queryRoomAttrsCount(@RequestBody RoomAttrDto roomAttrDto);
+}

+ 71 - 0
service-community/src/main/java/com/java110/community/cmd/roomAttr/DeleteRoomAttrCmd.java

@@ -0,0 +1,71 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.cmd.roomAttr;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.community.IRoomAttrV1InnerServiceSMO;
+import com.java110.po.room.RoomAttrPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+/**
+ * 类表述:删除
+ * 服务编码:roomAttr.deleteRoomAttr
+ * 请求路劲:/app/roomAttr.DeleteRoomAttr
+ * add by 吴学文 at 2021-09-16 10:16:53 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "roomAttr.deleteRoomAttr")
+public class DeleteRoomAttrCmd extends AbstractServiceCmdListener {
+  private static Logger logger = LoggerFactory.getLogger(DeleteRoomAttrCmd.class);
+
+    @Autowired
+    private IRoomAttrV1InnerServiceSMO roomAttrV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "attrId", "attrId不能为空");
+Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+       RoomAttrPo roomAttrPo = BeanConvertUtil.covertBean(reqJson, RoomAttrPo.class);
+        int flag = roomAttrV1InnerServiceSMOImpl.deleteRoomAttr(roomAttrPo);
+
+        if (flag < 1) {
+            throw new CmdException("删除数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 83 - 0
service-community/src/main/java/com/java110/community/cmd/roomAttr/ListRoomAttrCmd.java

@@ -0,0 +1,83 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.cmd.roomAttr;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.dto.RoomAttrDto;
+import com.java110.intf.community.IRoomAttrV1InnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import java.util.List;
+import java.util.ArrayList;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.HttpStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 类表述:查询
+ * 服务编码:roomAttr.listRoomAttr
+ * 请求路劲:/app/roomAttr.ListRoomAttr
+ * add by 吴学文 at 2021-09-16 10:16:53 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "roomAttr.listRoomAttr")
+public class ListRoomAttrCmd extends AbstractServiceCmdListener {
+
+  private static Logger logger = LoggerFactory.getLogger(ListRoomAttrCmd.class);
+    @Autowired
+    private IRoomAttrV1InnerServiceSMO roomAttrV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+           RoomAttrDto roomAttrDto = BeanConvertUtil.covertBean(reqJson, RoomAttrDto.class);
+
+           int count = roomAttrV1InnerServiceSMOImpl.queryRoomAttrsCount(roomAttrDto);
+
+           List<RoomAttrDto> roomAttrDtos = null;
+
+           if (count > 0) {
+               roomAttrDtos = roomAttrV1InnerServiceSMOImpl.queryRoomAttrs(roomAttrDto);
+           } else {
+               roomAttrDtos = new ArrayList<>();
+           }
+
+           ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, roomAttrDtos);
+
+           ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+           cmdDataFlowContext.setResponseEntity(responseEntity);
+    }
+}

+ 79 - 0
service-community/src/main/java/com/java110/community/cmd/roomAttr/SaveRoomAttrCmd.java

@@ -0,0 +1,79 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.cmd.roomAttr;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.community.IRoomAttrV1InnerServiceSMO;
+import com.java110.po.room.RoomAttrPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 类表述:保存
+ * 服务编码:roomAttr.saveRoomAttr
+ * 请求路劲:/app/roomAttr.SaveRoomAttr
+ * add by 吴学文 at 2021-09-16 10:16:52 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "roomAttr.saveRoomAttr")
+public class SaveRoomAttrCmd extends AbstractServiceCmdListener {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveRoomAttrCmd.class);
+
+    public static final String CODE_PREFIX_ID = "10";
+
+    @Autowired
+    private IRoomAttrV1InnerServiceSMO roomAttrV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "attrId", "请求报文中未包含attrId");
+Assert.hasKeyAndValue(reqJson, "roomId", "请求报文中未包含roomId");
+Assert.hasKeyAndValue(reqJson, "specCd", "请求报文中未包含specCd");
+Assert.hasKeyAndValue(reqJson, "value", "请求报文中未包含value");
+Assert.hasKeyAndValue(reqJson, "statusCd", "请求报文中未包含statusCd");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+       RoomAttrPo roomAttrPo = BeanConvertUtil.covertBean(reqJson, RoomAttrPo.class);
+        roomAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+        int flag = roomAttrV1InnerServiceSMOImpl.saveRoomAttr(roomAttrPo);
+
+        if (flag < 1) {
+            throw new CmdException("保存数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 75 - 0
service-community/src/main/java/com/java110/community/cmd/roomAttr/UpdateRoomAttrCmd.java

@@ -0,0 +1,75 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.cmd.roomAttr;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.community.IRoomAttrV1InnerServiceSMO;
+import com.java110.po.room.RoomAttrPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 类表述:更新
+ * 服务编码:roomAttr.updateRoomAttr
+ * 请求路劲:/app/roomAttr.UpdateRoomAttr
+ * add by 吴学文 at 2021-09-16 10:16:53 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "roomAttr.updateRoomAttr")
+public class UpdateRoomAttrCmd extends AbstractServiceCmdListener {
+
+  private static Logger logger = LoggerFactory.getLogger(UpdateRoomAttrCmd.class);
+
+
+    @Autowired
+    private IRoomAttrV1InnerServiceSMO roomAttrV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "attrId", "attrId不能为空");
+Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+       RoomAttrPo roomAttrPo = BeanConvertUtil.covertBean(reqJson, RoomAttrPo.class);
+        int flag = roomAttrV1InnerServiceSMOImpl.updateRoomAttr(roomAttrPo);
+
+        if (flag < 1) {
+            throw new CmdException("更新数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 77 - 0
service-community/src/main/java/com/java110/community/dao/IRoomAttrV1ServiceDao.java

@@ -0,0 +1,77 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2021-09-16 10:16:52 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+public interface IRoomAttrV1ServiceDao {
+
+
+    /**
+     * 保存 房屋属性信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveRoomAttrInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询房屋属性信息(instance过程)
+     * 根据bId 查询房屋属性信息
+     * @param info bId 信息
+     * @return 房屋属性信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getRoomAttrInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改房屋属性信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateRoomAttrInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询房屋属性总数
+     *
+     * @param info 房屋属性信息
+     * @return 房屋属性数量
+     */
+    int queryRoomAttrsCount(Map info);
+
+}

+ 112 - 0
service-community/src/main/java/com/java110/community/dao/impl/RoomAttrV1ServiceDaoImpl.java

@@ -0,0 +1,112 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.community.dao.IRoomAttrV1ServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2021-09-16 10:16:52 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Service("roomAttrV1ServiceDaoImpl")
+public class RoomAttrV1ServiceDaoImpl extends BaseServiceDao implements IRoomAttrV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(RoomAttrV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存房屋属性信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveRoomAttrInfo(Map info) throws DAOException {
+        logger.debug("保存 saveRoomAttrInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("roomAttrV1ServiceDaoImpl.saveRoomAttrInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询房屋属性信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getRoomAttrInfo(Map info) throws DAOException {
+        logger.debug("查询 getRoomAttrInfo 入参 info : {}",info);
+
+        List<Map> businessRoomAttrInfos = sqlSessionTemplate.selectList("roomAttrV1ServiceDaoImpl.getRoomAttrInfo",info);
+
+        return businessRoomAttrInfos;
+    }
+
+
+    /**
+     * 修改房屋属性信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateRoomAttrInfo(Map info) throws DAOException {
+        logger.debug("修改 updateRoomAttrInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("roomAttrV1ServiceDaoImpl.updateRoomAttrInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询房屋属性数量
+     * @param info 房屋属性信息
+     * @return 房屋属性数量
+     */
+    @Override
+    public int queryRoomAttrsCount(Map info) {
+        logger.debug("查询 queryRoomAttrsCount 入参 info : {}",info);
+
+        List<Map> businessRoomAttrInfos = sqlSessionTemplate.selectList("roomAttrV1ServiceDaoImpl.queryRoomAttrsCount", info);
+        if (businessRoomAttrInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessRoomAttrInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
service-community/src/main/java/com/java110/community/smo/impl/RoomAttrV1InnerServiceSMOImpl.java

@@ -0,0 +1,89 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.smo.impl;
+
+
+import com.java110.community.dao.IRoomAttrV1ServiceDao;
+import com.java110.dto.RoomAttrDto;
+import com.java110.intf.community.IRoomAttrV1InnerServiceSMO;
+import com.java110.po.room.RoomAttrPo;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.dto.PageDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2021-09-16 10:16:52 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@RestController
+public class RoomAttrV1InnerServiceSMOImpl extends BaseServiceSMO implements IRoomAttrV1InnerServiceSMO {
+
+    @Autowired
+    private IRoomAttrV1ServiceDao roomAttrV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveRoomAttr(@RequestBody RoomAttrPo roomAttrPo) {
+        int saveFlag = roomAttrV1ServiceDaoImpl.saveRoomAttrInfo(BeanConvertUtil.beanCovertMap(roomAttrPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateRoomAttr(@RequestBody  RoomAttrPo roomAttrPo) {
+        int saveFlag = roomAttrV1ServiceDaoImpl.updateRoomAttrInfo(BeanConvertUtil.beanCovertMap(roomAttrPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteRoomAttr(@RequestBody  RoomAttrPo roomAttrPo) {
+       roomAttrPo.setStatusCd("1");
+       int saveFlag = roomAttrV1ServiceDaoImpl.updateRoomAttrInfo(BeanConvertUtil.beanCovertMap(roomAttrPo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<RoomAttrDto> queryRoomAttrs(@RequestBody  RoomAttrDto roomAttrDto) {
+
+        //校验是否传了 分页信息
+
+        int page = roomAttrDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            roomAttrDto.setPage((page - 1) * roomAttrDto.getRow());
+        }
+
+        List<RoomAttrDto> roomAttrs = BeanConvertUtil.covertBeanList(roomAttrV1ServiceDaoImpl.getRoomAttrInfo(BeanConvertUtil.beanCovertMap(roomAttrDto)), RoomAttrDto.class);
+
+        return roomAttrs;
+    }
+
+
+    @Override
+    public int queryRoomAttrsCount(@RequestBody RoomAttrDto roomAttrDto) {
+        return roomAttrV1ServiceDaoImpl.queryRoomAttrsCount(BeanConvertUtil.beanCovertMap(roomAttrDto));    }
+
+}