Просмотр исходного кода

Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

java110 лет назад: 5
Родитель
Сommit
9ef70a936f
19 измененных файлов с 1018 добавлено и 96 удалено
  1. 9 0
      java110-bean/src/main/java/com/java110/dto/machine/MachineDto.java
  2. 71 0
      java110-bean/src/main/java/com/java110/dto/machineType/MachineTypeDto.java
  3. 9 0
      java110-bean/src/main/java/com/java110/po/machine/MachinePo.java
  4. 67 0
      java110-bean/src/main/java/com/java110/po/machineType/MachineTypePo.java
  5. 9 0
      java110-bean/src/main/java/com/java110/vo/api/machine/ApiMachineDataVo.java
  6. 21 6
      java110-db/src/main/resources/mapper/common/MachineServiceDaoImplMapper.xml
  7. 93 0
      java110-db/src/main/resources/mapper/common/MachineTypeV1ServiceDaoImplMapper.xml
  8. 18 16
      java110-generator/src/main/java/com/java110/code/TableToJson.java
  9. 20 13
      java110-generator/src/main/java/com/java110/code/TableToJsonWeb.java
  10. 0 38
      java110-generator/src/main/resources/newBack/template_1.json
  11. 48 23
      java110-generator/src/main/resources/web/template_1.json
  12. 68 0
      java110-interface/src/main/java/com/java110/intf/common/IMachineTypeV1InnerServiceSMO.java
  13. 72 0
      service-common/src/main/java/com/java110/common/cmd/machineType/DeleteMachineTypeCmd.java
  14. 84 0
      service-common/src/main/java/com/java110/common/cmd/machineType/ListMachineTypeCmd.java
  15. 76 0
      service-common/src/main/java/com/java110/common/cmd/machineType/SaveMachineTypeCmd.java
  16. 75 0
      service-common/src/main/java/com/java110/common/cmd/machineType/UpdateMachineTypeCmd.java
  17. 77 0
      service-common/src/main/java/com/java110/common/dao/IMachineTypeV1ServiceDao.java
  18. 112 0
      service-common/src/main/java/com/java110/common/dao/impl/MachineTypeV1ServiceDaoImpl.java
  19. 89 0
      service-common/src/main/java/com/java110/common/smo/impl/MachineTypeV1InnerServiceSMOImpl.java

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/machine/MachineDto.java

@@ -51,6 +51,7 @@ public class MachineDto extends PageDto implements Serializable {
     private String locationObjName;
     private String direction;//设备方向
     private String directionName;
+    private String typeId;
 
     private List<MachineAttrDto> machineAttrs;
 
@@ -310,4 +311,12 @@ public class MachineDto extends PageDto implements Serializable {
     public void setHeartbeatTime(String heartbeatTime) {
         this.heartbeatTime = heartbeatTime;
     }
+
+    public String getTypeId() {
+        return typeId;
+    }
+
+    public void setTypeId(String typeId) {
+        this.typeId = typeId;
+    }
 }

+ 71 - 0
java110-bean/src/main/java/com/java110/dto/machineType/MachineTypeDto.java

@@ -0,0 +1,71 @@
+package com.java110.dto.machineType;
+
+import com.java110.dto.PageDto;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 设备类型数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class MachineTypeDto extends PageDto implements Serializable {
+
+    private String machineTypeName;
+private String typeId;
+private String machineTypeCd;
+private String communityId;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getMachineTypeName() {
+        return machineTypeName;
+    }
+public void setMachineTypeName(String machineTypeName) {
+        this.machineTypeName = machineTypeName;
+    }
+public String getTypeId() {
+        return typeId;
+    }
+public void setTypeId(String typeId) {
+        this.typeId = typeId;
+    }
+public String getMachineTypeCd() {
+        return machineTypeCd;
+    }
+public void setMachineTypeCd(String machineTypeCd) {
+        this.machineTypeCd = machineTypeCd;
+    }
+
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+}

+ 9 - 0
java110-bean/src/main/java/com/java110/po/machine/MachinePo.java

@@ -25,6 +25,7 @@ public class MachinePo implements Serializable {
     private String locationObjId;
     private String state;
     private String direction;
+    private String typeId;
 
 
     public String getMachineId() {
@@ -130,4 +131,12 @@ public class MachinePo implements Serializable {
     public void setDirection(String direction) {
         this.direction = direction;
     }
+
+    public String getTypeId() {
+        return typeId;
+    }
+
+    public void setTypeId(String typeId) {
+        this.typeId = typeId;
+    }
 }

+ 67 - 0
java110-bean/src/main/java/com/java110/po/machineType/MachineTypePo.java

@@ -0,0 +1,67 @@
+/*
+ * 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.po.machineType;
+
+import java.io.Serializable;
+import java.util.Date;
+/**
+ * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
+ * add by 吴学文 at 2021-10-15 12:38:42 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 class MachineTypePo implements Serializable {
+
+    private String machineTypeName;
+private String typeId;
+private String statusCd = "0";
+private String machineTypeCd;
+private String communityId;
+public String getMachineTypeName() {
+        return machineTypeName;
+    }
+public void setMachineTypeName(String machineTypeName) {
+        this.machineTypeName = machineTypeName;
+    }
+public String getTypeId() {
+        return typeId;
+    }
+public void setTypeId(String typeId) {
+        this.typeId = typeId;
+    }
+public String getStatusCd() {
+        return statusCd;
+    }
+public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+public String getMachineTypeCd() {
+        return machineTypeCd;
+    }
+public void setMachineTypeCd(String machineTypeCd) {
+        this.machineTypeCd = machineTypeCd;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+}

+ 9 - 0
java110-bean/src/main/java/com/java110/vo/api/machine/ApiMachineDataVo.java

@@ -20,6 +20,7 @@ public class ApiMachineDataVo implements Serializable {
     private String locationObjId;
     private String state;
     private String stateName;
+    private String typeId;
 
 
     private String floorId;
@@ -236,4 +237,12 @@ public class ApiMachineDataVo implements Serializable {
     public void setHeartbeatTime(String heartbeatTime) {
         this.heartbeatTime = heartbeatTime;
     }
+
+    public String getTypeId() {
+        return typeId;
+    }
+
+    public void setTypeId(String typeId) {
+        this.typeId = typeId;
+    }
 }

+ 21 - 6
java110-db/src/main/resources/mapper/common/MachineServiceDaoImplMapper.xml

@@ -8,11 +8,11 @@
     <insert id="saveBusinessMachineInfo" parameterType="Map">
         insert into business_machine(
         machine_mac,machine_id,machine_code,auth_code,operate,machine_version,community_id,b_id,
-        machine_name,machine_type_cd,machine_ip,location_type_cd,location_obj_id,state,direction,heartbeat_time
+        machine_name,machine_type_cd,machine_ip,location_type_cd,location_obj_id,state,direction,heartbeat_time,type_id
         ) values (
         #{machineMac},#{machineId},#{machineCode},#{authCode},#{operate},#{machineVersion},
         #{communityId},#{bId},#{machineName},#{machineTypeCd},#{machineIp},
-        #{locationTypeCd},#{locationObjId},#{state},#{direction},#{heartbeatTime}
+        #{locationTypeCd},#{locationObjId},#{state},#{direction},#{heartbeatTime},#{typeId}
         )
     </insert>
 
@@ -24,7 +24,7 @@
         machineVersion,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.machine_name,t.machine_name
         machineName,t.machine_type_cd,t.machine_type_cd machineTypeCd,t.machine_ip,t.machine_ip machineIp,
         t.location_type_cd,t.location_obj_id,t.state,t.location_type_cd,t.location_obj_id,t.location_type_cd
-        locationTypeCd,t.location_obj_id locationObjId,t.direction,t.heartbeat_time,t.heartbeat_time heartbeatTime
+        locationTypeCd,t.location_obj_id locationObjId,t.direction,t.heartbeat_time,t.heartbeat_time heartbeatTime,t.type_id typeId
         from business_machine t
         where 1 =1
         <if test="machineMac !=null and machineMac != ''">
@@ -60,6 +60,9 @@
         <if test="machineIp !=null and machineIp != ''">
             and t.machine_ip= #{machineIp}
         </if>
+        <if test="typeId !=null and typeId != ''">
+            and t.type_id= #{typeId}
+        </if>
 
         <if test="locationTypeCd !=null and locationTypeCd != ''">
             and t.location_type_cd= #{locationTypeCd}
@@ -83,11 +86,11 @@
         insert into machine(
         machine_mac,machine_id,machine_code,auth_code,machine_version,status_cd,
         community_id,b_id,machine_name,machine_type_cd,machine_ip,
-        location_type_cd,location_obj_id,state,direction,heartbeat_time
+        location_type_cd,location_obj_id,state,direction,heartbeat_time,type_id
         ) select
         t.machine_mac,t.machine_id,t.machine_code,t.auth_code,t.machine_version,'0',t.community_id,t.b_id,
         t.machine_name,t.machine_type_cd,t.machine_ip,
-        t.location_type_cd,t.location_obj_id,t.state,t.direction,t.heartbeat_time
+        t.location_type_cd,t.location_obj_id,t.state,t.direction,t.heartbeat_time,type_id
         from business_machine t where 1=1
         <if test="machineMac !=null and machineMac != ''">
             and t.machine_mac= #{machineMac}
@@ -111,6 +114,9 @@
         <if test="bId !=null and bId != ''">
             and t.b_id= #{bId}
         </if>
+        <if test="typeId !=null and typeId != ''">
+            and t.type_id= #{typeId}
+        </if>
         <if test="machineName !=null and machineName != ''">
             and t.machine_name= #{machineName}
         </if>
@@ -146,7 +152,7 @@
         machineTypeCd,t.machine_ip,t.machine_ip machineIp,td.name machineTypeCdName,
         t.state,c.location_id locationTypeCd, c.location_name locationTypeName, t.location_obj_id locationObjId,
         t.location_type_cd,t.location_obj_id,t.heartbeat_time,t.heartbeat_time heartbeatTime,
-        td1.name stateName,t.create_time createTime,t.direction,td3.name directionName
+        td1.name stateName,t.create_time createTime,t.direction,td3.name directionName,t.type_id typeId
         from machine t
         left join t_dict td on t.machine_type_cd=td.status_cd and td.table_name='machine' and td.table_columns='machine_type_cd'
         left join t_dict td1 on t.state = td1.status_cd and td1.table_name='machine' and td1.table_columns='state'
@@ -189,6 +195,9 @@
         <if test="locationTypeCd !=null and locationTypeCd != ''">
             and t.location_type_cd= #{locationTypeCd}
         </if>
+        <if test="typeId !=null and typeId != ''">
+            and t.type_id= #{typeId}
+        </if>
         <if test="locationObjId !=null and locationObjId != ''">
             and t.location_obj_id= #{locationObjId}
         </if>
@@ -251,6 +260,9 @@
         <if test="state !=null and state != ''">
             , t.state = #{state}
         </if>
+        <if test="typeId !=null and typeId != ''">
+            , t.type_id = #{typeId}
+        </if>
         <if test="direction !=null and direction != ''">
             , t.direction = #{direction}
         </if>
@@ -288,6 +300,9 @@
         <if test="authCode !=null and authCode != ''">
             and t.auth_code= #{authCode}
         </if>
+        <if test="typeId !=null and typeId != ''">
+            and t.type_id= #{typeId}
+        </if>
         <if test="machineVersion !=null and machineVersion != ''">
             and t.machine_version= #{machineVersion}
         </if>

+ 93 - 0
java110-db/src/main/resources/mapper/common/MachineTypeV1ServiceDaoImplMapper.xml

@@ -0,0 +1,93 @@
+<?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="machineTypeV1ServiceDaoImpl">
+
+
+    <!-- 保存设备类型信息 add by wuxw 2018-07-03 -->
+    <insert id="saveMachineTypeInfo" parameterType="Map">
+        insert into machine_type(
+        machine_type_name,type_id,machine_type_cd,community_id
+        ) values (
+        #{machineTypeName},#{typeId},#{machineTypeCd},#{communityId}
+        )
+    </insert>
+
+
+    <!-- 查询设备类型信息 add by wuxw 2018-07-03 -->
+    <select id="getMachineTypeInfo" parameterType="Map" resultType="Map">
+        select t.machine_type_name,t.machine_type_name machineTypeName,t.type_id,t.type_id
+        typeId,t.status_cd,t.status_cd statusCd,t.machine_type_cd,t.machine_type_cd machineTypeCd,t.community_id communityId
+        from machine_type t
+        where 1 =1
+        <if test="machineTypeName !=null and machineTypeName != ''">
+            and t.machine_type_name= #{machineTypeName}
+        </if>
+        <if test="typeId !=null and typeId != ''">
+            and t.type_id= #{typeId}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="machineTypeCd !=null and machineTypeCd != ''">
+            and t.machine_type_cd= #{machineTypeCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </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="updateMachineTypeInfo" parameterType="Map">
+        update machine_type t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="machineTypeName !=null and machineTypeName != ''">
+            , t.machine_type_name= #{machineTypeName}
+        </if>
+        <if test="machineTypeCd !=null and machineTypeCd != ''">
+            , t.machine_type_cd= #{machineTypeCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        where 1=1
+        <if test="typeId !=null and typeId != ''">
+            and t.type_id= #{typeId}
+        </if>
+
+    </update>
+
+    <!-- 查询设备类型数量 add by wuxw 2018-07-03 -->
+    <select id="queryMachineTypesCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from machine_type t
+        where 1 =1
+        <if test="machineTypeName !=null and machineTypeName != ''">
+            and t.machine_type_name= #{machineTypeName}
+        </if>
+        <if test="typeId !=null and typeId != ''">
+            and t.type_id= #{typeId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="machineTypeCd !=null and machineTypeCd != ''">
+            and t.machine_type_cd= #{machineTypeCd}
+        </if>
+
+
+    </select>
+
+</mapper>

+ 18 - 16
java110-generator/src/main/java/com/java110/code/TableToJson.java

@@ -7,19 +7,21 @@ import com.java110.utils.util.StringUtil;
 public class TableToJson {
 
     //show create table c_orders  用这个语句获取
-    public static final String createTableSql = "CREATE TABLE `car_inout_payment` (\n" +
-            "  `payment_id` varchar(30) NOT NULL COMMENT '扩展ID',\n" +
-            "  `inout_id` varchar(30) NOT NULL COMMENT '进出ID',\n" +
-            "  `community_id` varchar(30) NOT NULL COMMENT '小区ID',\n" +
-            "  `pa_id` varchar(30) NOT NULL DEFAULT '停车场ID',\n" +
-            "  `pay_type` varchar(12) NOT NULL COMMENT '支付方式 1,现金 2 微信,3 支付宝',\n" +
-            "  `pay_charge` varchar(12) DEFAULT NULL COMMENT '应收金额',\n" +
-            "  `real_charge` varchar(12) DEFAULT NULL COMMENT '实收金额',\n" +
+    public static final String createTableSql = "CREATE TABLE `machine_type` (\n" +
+            "  `type_id` varchar(30) NOT NULL COMMENT '设备类型ID',\n" +
+            "  `machine_type_cd` varchar(30) NOT NULL COMMENT '设备大类 详情看t_dict',\n" +
+            "  `machine_type_name` varchar(30) NOT NULL COMMENT '设备类型名称',\n" +
             "  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',\n" +
-            "  `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效'\n" +
-            ")";
+            "  `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',\n" +
+            "  KEY `idx_bm_machine_id` (`type_id`) USING BTREE\n";
 
     public static void main(String[] args) {
+        String desc = "老人类型";
+        String id = "typeId";
+        String name = "govOldPersonType";
+        String shareName = "cust"; //生成到那个服务下
+        String shareColumn = "ca_id";
+        String shareParam = "caId";
 
         //业务名称 desc 业务编码名称生成后类名 name 主键 id  需要放到那个服务 shareName
         String newSql = createTableSql.substring(createTableSql.indexOf("(") + 1, createTableSql.lastIndexOf(")"));
@@ -29,12 +31,12 @@ public class TableToJson {
         String[] rowSqls = newSql.split("',");
         JSONObject param = new JSONObject();
         param.put("autoMove", true);
-        param.put("desc", "车辆支付");
-        param.put("id", "paymentId");
-        param.put("name", "carInoutPayment");
-        param.put("shareColumn", "community_id");
-        param.put("shareName", "common");
-        param.put("shareParam", "communityId");
+        param.put("desc", desc);
+        param.put("id", id);
+        param.put("name", name);
+        param.put("shareColumn", shareColumn);
+        param.put("shareName", shareName);
+        param.put("shareParam", shareParam);
         param.put("tableName", tableName);
         JSONObject paramColumn = new JSONObject();
         JSONArray requireds = new JSONArray();

+ 20 - 13
java110-generator/src/main/java/com/java110/code/TableToJsonWeb.java

@@ -7,16 +7,23 @@ import com.java110.utils.util.StringUtil;
 public class TableToJsonWeb {
 
     //show create table c_orders  用这个语句获取
-    public static final String createTableSql = "CREATE TABLE `meter_type` (\n" +
-            "  `type_id` varchar(30) NOT NULL COMMENT '类型ID',\n" +
-            "  `type_name` varchar(12) NOT NULL COMMENT '名称',\n" +
-            "  `community_id` varchar(30) NOT NULL COMMENT '小区ID',\n" +
-            "  `remark` varchar(200) DEFAULT NULL COMMENT '说明',\n" +
+    public static final String createTableSql = "CREATE TABLE `machine_type` (\n" +
+            "  `type_id` varchar(30) NOT NULL COMMENT '设备类型ID',\n" +
+            "  `machine_type_cd` varchar(30) NOT NULL COMMENT '设备大类 详情看t_dict',\n" +
+            "  `machine_type_name` varchar(30) NOT NULL COMMENT '设备类型名称',\n" +
             "  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',\n" +
-            "  `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,0, 在用 1失效'\n" +
+            "  `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',\n" +
+            "  KEY `idx_bm_machine_id` (`type_id`) USING BTREE\n" +
             ")";
 
     public static void main(String[] args) {
+        String templateName = "设备类型"; //业务名称
+        String templateCode = "machineType"; //表名大写
+        String templateKey = "typeId"; //表主键
+        String templateKeyName = "设备类型ID";//主键说明
+        String searchCode = "typeId"; //分片字段
+        String searchName = "设备类型ID"; //分片字段说明
+        String directories = "property"; //前端生成到那个目录下
 
         // templateName 业务名称 业务编码名称生成后文件名 templateCode 主键 templateKey
         // 业务主键名称 templateKeyName=templateName+ID 主机驼峰 searchCode 主键名称 searchName
@@ -27,13 +34,13 @@ public class TableToJsonWeb {
         newSql = newSql.replaceAll("\n", "");
         String[] rowSqls = newSql.split("',");
         JSONObject param = new JSONObject();
-        param.put("templateName", "");
-        param.put("templateCode", "");
-        param.put("templateKey", "");
-        param.put("templateKeyName", "");
-        param.put("searchCode", "");
-        param.put("searchName", "");
-        param.put("directories", "");
+        param.put("templateName", templateName);
+        param.put("templateCode", templateCode);
+        param.put("templateKey", templateKey);
+        param.put("templateKeyName", templateKeyName);
+        param.put("searchCode", searchCode);
+        param.put("searchName", searchName);
+        param.put("directories", directories);
         JSONObject paramColumn = null;
         JSONArray conditions = new JSONArray();
         JSONArray paramColumns = new JSONArray();

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

@@ -1,38 +0,0 @@
-{
-  "param": {
-    "realCharge": "real_charge",
-    "inoutId": "inout_id",
-    "payType": "pay_type",
-    "paymentId": "payment_id",
-    "paId": "pa_id",
-    "statusCd": "status_cd",
-    "communityId": "community_id",
-    "payCharge": "pay_charge"
-  },
-  "name": "carInoutPayment",
-  "shareColumn": "community_id",
-  "id": "paymentId",
-  "shareName": "common",
-  "autoMove": true,
-  "required": [
-    {
-      "msg": "进出ID不能为空",
-      "code": "inoutId"
-    },
-    {
-      "msg": "小区ID不能为空",
-      "code": "communityId"
-    },
-    {
-      "msg": "paId不能为空",
-      "code": "paId"
-    },
-    {
-      "msg": "支付方式不能为空",
-      "code": "payType"
-    }
-  ],
-  "desc": "车辆支付",
-  "shareParam": "communityId",
-  "tableName": "car_inout_payment"
-}

+ 48 - 23
java110-generator/src/main/resources/web/template_1.json

@@ -1,49 +1,74 @@
 {
-  "templateKeyName": "抄表类型",
-  "templateName": "抄表类型",
-  "searchName": "抄表类型",
-  "directories": "property",
-  "searchCode": "typeId",
-  "templateCode": "meterType",
-  "templateKey": "typeId",
+  "templateKeyName": "设备类型ID",
+  "templateName": "设备类型",
   "columns": [
     {
       "hasDefaultValue": false,
-      "limitParam": "12",
-      "code": "typeName",
-      "limitErrInfo": "名称不能超过12",
-      "cnCode": "名称",
+      "limitParam": "30",
+      "code": "typeId",
+      "limitErrInfo": "设备类型ID不能超过30",
+      "cnCode": "设备类型ID",
       "limit": "maxLength",
       "show": true,
       "inputType": "input",
       "required": true,
-      "desc": "必填,名称"
+      "desc": "必填,设备类型ID"
     },
     {
       "hasDefaultValue": false,
-      "limitParam": "200",
-      "code": "remark",
-      "limitErrInfo": "说明不能超过200",
-      "cnCode": "说明",
+      "limitParam": "30",
+      "code": "machineTypeCd",
+      "limitErrInfo": "设备大类不能超过30",
+      "cnCode": "设备大类",
       "limit": "maxLength",
       "show": true,
       "inputType": "input",
       "required": true,
-      "desc": "说明"
+      "desc": "必填,设备大类"
+    },
+    {
+      "hasDefaultValue": false,
+      "limitParam": "30",
+      "code": "machineTypeName",
+      "limitErrInfo": "设备类型名称不能超过30",
+      "cnCode": "设备类型名称",
+      "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,设备类型名称"
+    },
+    {
+      "hasDefaultValue": false,
+      "limitParam": "2",
+      "code": "statusCd",
+      "limitErrInfo": "数据状态不能超过2",
+      "cnCode": "数据状态",
+      "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,数据状态"
     }
   ],
+  "searchName": "设备类型ID",
+  "directories": "property",
+  "searchCode": "typeId",
+  "templateCode": "machineType",
   "conditions": [
+
     {
       "whereCondition": "equal",
-      "code": "typeId",
-      "name": "类型ID",
+      "code": "machineTypeCd",
+      "name": "设备大类",
       "inputType": "input"
     },
     {
       "whereCondition": "equal",
-      "code": "typeName",
-      "name": "名称",
+      "code": "machineTypeName",
+      "name": "设备类型名称",
       "inputType": "input"
     }
-  ]
-}
+  ],
+  "templateKey": "typeId"
+}

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/common/IMachineTypeV1InnerServiceSMO.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.common;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.machineType.MachineTypeDto;
+import com.java110.po.machineType.MachineTypePo;
+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-10-15 12:38:42 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 = "common-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/machineTypeV1Api")
+public interface IMachineTypeV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveMachineType", method = RequestMethod.POST)
+    public int saveMachineType(@RequestBody  MachineTypePo machineTypePo);
+
+    @RequestMapping(value = "/updateMachineType", method = RequestMethod.POST)
+    public int updateMachineType(@RequestBody  MachineTypePo machineTypePo);
+
+    @RequestMapping(value = "/deleteMachineType", method = RequestMethod.POST)
+    public int deleteMachineType(@RequestBody  MachineTypePo machineTypePo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param machineTypeDto 数据对象分享
+     * @return MachineTypeDto 对象数据
+     */
+    @RequestMapping(value = "/queryMachineTypes", method = RequestMethod.POST)
+    List<MachineTypeDto> queryMachineTypes(@RequestBody MachineTypeDto machineTypeDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param machineTypeDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryMachineTypesCount", method = RequestMethod.POST)
+    int queryMachineTypesCount(@RequestBody MachineTypeDto machineTypeDto);
+}

+ 72 - 0
service-common/src/main/java/com/java110/common/cmd/machineType/DeleteMachineTypeCmd.java

@@ -0,0 +1,72 @@
+/*
+ * 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.common.cmd.machineType;
+
+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.common.IMachineTypeV1InnerServiceSMO;
+import com.java110.po.machineType.MachineTypePo;
+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;
+
+/**
+ * 类表述:删除
+ * 服务编码:machineType.deleteMachineType
+ * 请求路劲:/app/machineType.DeleteMachineType
+ * add by 吴学文 at 2021-10-15 12:38:43 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 = "machineType.deleteMachineType")
+public class DeleteMachineTypeCmd extends AbstractServiceCmdListener {
+    private static Logger logger = LoggerFactory.getLogger(DeleteMachineTypeCmd.class);
+
+    @Autowired
+    private IMachineTypeV1InnerServiceSMO machineTypeV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "typeId", "typeId不能为空");
+        Assert.hasKeyAndValue(reqJson, "typeId", "typeId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        MachineTypePo machineTypePo = BeanConvertUtil.covertBean(reqJson, MachineTypePo.class);
+        int flag = machineTypeV1InnerServiceSMOImpl.deleteMachineType(machineTypePo);
+
+        if (flag < 1) {
+            throw new CmdException("删除数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 84 - 0
service-common/src/main/java/com/java110/common/cmd/machineType/ListMachineTypeCmd.java

@@ -0,0 +1,84 @@
+/*
+ * 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.common.cmd.machineType;
+
+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.common.IMachineTypeV1InnerServiceSMO;
+import com.java110.po.machineType.MachineTypePo;
+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 com.java110.dto.machineType.MachineTypeDto;
+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;
+
+
+/**
+ * 类表述:查询
+ * 服务编码:machineType.listMachineType
+ * 请求路劲:/app/machineType.ListMachineType
+ * add by 吴学文 at 2021-10-15 12:38:43 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 = "machineType.listMachineType")
+public class ListMachineTypeCmd extends AbstractServiceCmdListener {
+
+  private static Logger logger = LoggerFactory.getLogger(ListMachineTypeCmd.class);
+    @Autowired
+    private IMachineTypeV1InnerServiceSMO machineTypeV1InnerServiceSMOImpl;
+
+    @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 {
+
+           MachineTypeDto machineTypeDto = BeanConvertUtil.covertBean(reqJson, MachineTypeDto.class);
+
+           int count = machineTypeV1InnerServiceSMOImpl.queryMachineTypesCount(machineTypeDto);
+
+           List<MachineTypeDto> machineTypeDtos = null;
+
+           if (count > 0) {
+               machineTypeDtos = machineTypeV1InnerServiceSMOImpl.queryMachineTypes(machineTypeDto);
+           } else {
+               machineTypeDtos = new ArrayList<>();
+           }
+
+           ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, machineTypeDtos);
+
+           ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+           cmdDataFlowContext.setResponseEntity(responseEntity);
+    }
+}

+ 76 - 0
service-common/src/main/java/com/java110/common/cmd/machineType/SaveMachineTypeCmd.java

@@ -0,0 +1,76 @@
+/*
+ * 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.common.cmd.machineType;
+
+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.common.IMachineTypeV1InnerServiceSMO;
+import com.java110.po.machineType.MachineTypePo;
+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;
+
+/**
+ * 类表述:保存
+ * 服务编码:machineType.saveMachineType
+ * 请求路劲:/app/machineType.SaveMachineType
+ * add by 吴学文 at 2021-10-15 12:38:43 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 = "machineType.saveMachineType")
+public class SaveMachineTypeCmd extends AbstractServiceCmdListener {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveMachineTypeCmd.class);
+
+    public static final String CODE_PREFIX_ID = "10";
+
+    @Autowired
+    private IMachineTypeV1InnerServiceSMO machineTypeV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "machineTypeCd", "请求报文中未包含machineTypeCd");
+        Assert.hasKeyAndValue(reqJson, "machineTypeName", "请求报文中未包含machineTypeName");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        MachineTypePo machineTypePo = BeanConvertUtil.covertBean(reqJson, MachineTypePo.class);
+        machineTypePo.setTypeId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+        int flag = machineTypeV1InnerServiceSMOImpl.saveMachineType(machineTypePo);
+
+        if (flag < 1) {
+            throw new CmdException("保存数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 75 - 0
service-common/src/main/java/com/java110/common/cmd/machineType/UpdateMachineTypeCmd.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.common.cmd.machineType;
+
+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.common.IMachineTypeV1InnerServiceSMO;
+import com.java110.po.machineType.MachineTypePo;
+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;
+
+
+/**
+ * 类表述:更新
+ * 服务编码:machineType.updateMachineType
+ * 请求路劲:/app/machineType.UpdateMachineType
+ * add by 吴学文 at 2021-10-15 12:38:43 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 = "machineType.updateMachineType")
+public class UpdateMachineTypeCmd extends AbstractServiceCmdListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateMachineTypeCmd.class);
+
+
+    @Autowired
+    private IMachineTypeV1InnerServiceSMO machineTypeV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "typeId", "typeId不能为空");
+        Assert.hasKeyAndValue(reqJson, "typeId", "typeId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        MachineTypePo machineTypePo = BeanConvertUtil.covertBean(reqJson, MachineTypePo.class);
+        int flag = machineTypeV1InnerServiceSMOImpl.updateMachineType(machineTypePo);
+
+        if (flag < 1) {
+            throw new CmdException("更新数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 77 - 0
service-common/src/main/java/com/java110/common/dao/IMachineTypeV1ServiceDao.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.common.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-10-15 12:38:42 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 IMachineTypeV1ServiceDao {
+
+
+    /**
+     * 保存 设备类型信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveMachineTypeInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询设备类型信息(instance过程)
+     * 根据bId 查询设备类型信息
+     * @param info bId 信息
+     * @return 设备类型信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getMachineTypeInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改设备类型信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateMachineTypeInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询设备类型总数
+     *
+     * @param info 设备类型信息
+     * @return 设备类型数量
+     */
+    int queryMachineTypesCount(Map info);
+
+}

+ 112 - 0
service-common/src/main/java/com/java110/common/dao/impl/MachineTypeV1ServiceDaoImpl.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.common.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.common.dao.IMachineTypeV1ServiceDao;
+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-10-15 12:38:42 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("machineTypeV1ServiceDaoImpl")
+public class MachineTypeV1ServiceDaoImpl extends BaseServiceDao implements IMachineTypeV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(MachineTypeV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存设备类型信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveMachineTypeInfo(Map info) throws DAOException {
+        logger.debug("保存 saveMachineTypeInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("machineTypeV1ServiceDaoImpl.saveMachineTypeInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询设备类型信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getMachineTypeInfo(Map info) throws DAOException {
+        logger.debug("查询 getMachineTypeInfo 入参 info : {}",info);
+
+        List<Map> businessMachineTypeInfos = sqlSessionTemplate.selectList("machineTypeV1ServiceDaoImpl.getMachineTypeInfo",info);
+
+        return businessMachineTypeInfos;
+    }
+
+
+    /**
+     * 修改设备类型信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateMachineTypeInfo(Map info) throws DAOException {
+        logger.debug("修改 updateMachineTypeInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("machineTypeV1ServiceDaoImpl.updateMachineTypeInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询设备类型数量
+     * @param info 设备类型信息
+     * @return 设备类型数量
+     */
+    @Override
+    public int queryMachineTypesCount(Map info) {
+        logger.debug("查询 queryMachineTypesCount 入参 info : {}",info);
+
+        List<Map> businessMachineTypeInfos = sqlSessionTemplate.selectList("machineTypeV1ServiceDaoImpl.queryMachineTypesCount", info);
+        if (businessMachineTypeInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessMachineTypeInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
service-common/src/main/java/com/java110/common/smo/impl/MachineTypeV1InnerServiceSMOImpl.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.common.smo.impl;
+
+
+import com.java110.common.dao.IMachineTypeV1ServiceDao;
+import com.java110.intf.common.IMachineTypeV1InnerServiceSMO;
+import com.java110.dto.machineType.MachineTypeDto;
+import com.java110.po.machineType.MachineTypePo;
+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-10-15 12:38:42 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 MachineTypeV1InnerServiceSMOImpl extends BaseServiceSMO implements IMachineTypeV1InnerServiceSMO {
+
+    @Autowired
+    private IMachineTypeV1ServiceDao machineTypeV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveMachineType(@RequestBody  MachineTypePo machineTypePo) {
+        int saveFlag = machineTypeV1ServiceDaoImpl.saveMachineTypeInfo(BeanConvertUtil.beanCovertMap(machineTypePo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateMachineType(@RequestBody  MachineTypePo machineTypePo) {
+        int saveFlag = machineTypeV1ServiceDaoImpl.updateMachineTypeInfo(BeanConvertUtil.beanCovertMap(machineTypePo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteMachineType(@RequestBody  MachineTypePo machineTypePo) {
+       machineTypePo.setStatusCd("1");
+       int saveFlag = machineTypeV1ServiceDaoImpl.updateMachineTypeInfo(BeanConvertUtil.beanCovertMap(machineTypePo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<MachineTypeDto> queryMachineTypes(@RequestBody  MachineTypeDto machineTypeDto) {
+
+        //校验是否传了 分页信息
+
+        int page = machineTypeDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            machineTypeDto.setPage((page - 1) * machineTypeDto.getRow());
+        }
+
+        List<MachineTypeDto> machineTypes = BeanConvertUtil.covertBeanList(machineTypeV1ServiceDaoImpl.getMachineTypeInfo(BeanConvertUtil.beanCovertMap(machineTypeDto)), MachineTypeDto.class);
+
+        return machineTypes;
+    }
+
+
+    @Override
+    public int queryMachineTypesCount(@RequestBody MachineTypeDto machineTypeDto) {
+        return machineTypeV1ServiceDaoImpl.queryMachineTypesCount(BeanConvertUtil.beanCovertMap(machineTypeDto));    }
+
+}