Quellcode durchsuchen

优化设备添加时加入位置信息

wuxw vor 6 Jahren
Ursprung
Commit
23e5eaa3ff

+ 4 - 0
Api/src/main/java/com/java110/api/listener/machine/SaveMachineListener.java

@@ -33,6 +33,9 @@ public class SaveMachineListener extends AbstractServiceApiListener {
         Assert.hasKeyAndValue(reqJson, "machineName", "必填,请填写设备名称");
         Assert.hasKeyAndValue(reqJson, "machineTypeCd", "必填,请选择设备类型");
         Assert.hasKeyAndValue(reqJson, "authCode", "必填,请填写鉴权编码");
+        Assert.hasKeyAndValue(reqJson, "locationTypeCd", "必填,请选择位置类型");
+        Assert.hasKeyAndValue(reqJson, "locationObjId", "必填,请填写位置对象ID");
+
 
     }
 
@@ -90,6 +93,7 @@ public class SaveMachineListener extends AbstractServiceApiListener {
         business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
         JSONObject businessMachine = new JSONObject();
         businessMachine.putAll(paramInJson);
+        businessMachine.put("state", "1000");
         businessMachine.put("machineId", "-1");
         //计算 应收金额
         business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessMachine", businessMachine);

+ 18 - 0
Api/src/main/java/com/java110/api/listener/machine/UpdateMachineListener.java

@@ -5,12 +5,15 @@ import com.alibaba.fastjson.JSONObject;
 import com.java110.api.listener.AbstractServiceApiListener;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
+import com.java110.core.smo.hardwareAdapation.IMachineInnerServiceSMO;
+import com.java110.dto.hardwareAdapation.MachineDto;
 import com.java110.entity.center.AppService;
 import com.java110.event.service.api.ServiceDataFlowEvent;
 import com.java110.utils.constant.BusinessTypeConstant;
 import com.java110.utils.constant.CommonConstant;
 import com.java110.utils.constant.ServiceCodeMachineConstant;
 import com.java110.utils.util.Assert;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
 import org.springframework.http.ResponseEntity;
@@ -21,6 +24,10 @@ import org.springframework.http.ResponseEntity;
  */
 @Java110Listener("updateMachineListener")
 public class UpdateMachineListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private IMachineInnerServiceSMO machineInnerServiceSMOImpl;
+
     @Override
     protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
 
@@ -30,6 +37,8 @@ public class UpdateMachineListener extends AbstractServiceApiListener {
         Assert.hasKeyAndValue(reqJson, "machineName", "必填,请填写设备名称");
         Assert.hasKeyAndValue(reqJson, "machineTypeCd", "必填,请选择设备类型");
         Assert.hasKeyAndValue(reqJson, "authCode", "必填,请填写鉴权编码");
+        Assert.hasKeyAndValue(reqJson, "locationTypeCd", "必填,请选择位置类型");
+        Assert.hasKeyAndValue(reqJson, "locationObjId", "必填,请填写位置对象ID");
 
     }
 
@@ -87,9 +96,18 @@ public class UpdateMachineListener extends AbstractServiceApiListener {
         business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
         JSONObject businessMachine = new JSONObject();
         businessMachine.putAll(paramInJson);
+        businessMachine.put("state", "1000");
         //计算 应收金额
         business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessMachine", businessMachine);
         return business;
     }
 
+
+    public IMachineInnerServiceSMO getMachineInnerServiceSMOImpl() {
+        return machineInnerServiceSMOImpl;
+    }
+
+    public void setMachineInnerServiceSMOImpl(IMachineInnerServiceSMO machineInnerServiceSMOImpl) {
+        this.machineInnerServiceSMOImpl = machineInnerServiceSMOImpl;
+    }
 }

+ 7 - 0
HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/listener/machine/AbstractMachineBusinessServiceDataFlowListener.java

@@ -47,6 +47,10 @@ public abstract class AbstractMachineBusinessServiceDataFlowListener extends Abs
         businessMachineInfo.put("machineName", businessMachineInfo.get("machine_name"));
         businessMachineInfo.put("machineTypeCd", businessMachineInfo.get("machine_type_cd"));
         businessMachineInfo.put("machineIp", businessMachineInfo.get("machine_ip"));
+        businessMachineInfo.put("locationTypeCd", businessMachineInfo.get("location_type_cd"));
+        businessMachineInfo.put("locationObjId", businessMachineInfo.get("location_obj_id"));
+        businessMachineInfo.put("state", businessMachineInfo.get("state"));
+
         businessMachineInfo.remove("bId");
         businessMachineInfo.put("statusCd", statusCd);
     }
@@ -81,6 +85,9 @@ public abstract class AbstractMachineBusinessServiceDataFlowListener extends Abs
         currentMachineInfo.put("machineName", currentMachineInfo.get("machine_name"));
         currentMachineInfo.put("machineTypeCd", currentMachineInfo.get("machine_type_cd"));
         currentMachineInfo.put("machineIp", currentMachineInfo.get("machine_ip"));
+        currentMachineInfo.put("locationTypeCd", currentMachineInfo.get("location_type_cd"));
+        currentMachineInfo.put("locationObjId", currentMachineInfo.get("location_obj_id"));
+        currentMachineInfo.put("state", currentMachineInfo.get("state"));
 
 
         currentMachineInfo.put("operate", StatusConstant.OPERATE_DEL);

+ 3 - 0
WebService/src/main/resources/components/floorPackage/floor-select2/floorSelect2.html

@@ -0,0 +1,3 @@
+<select class="form-control floorSelector">
+
+</select>

+ 48 - 0
WebService/src/main/resources/components/floorPackage/floor-select2/floorSelect2.js

@@ -0,0 +1,48 @@
+(function(vc){
+    vc.extends({
+        propTypes: {
+           emitFloorSelect2:vc.propTypes.string,
+           emitLoadData:vc.propTypes.string
+        },
+        data:{
+            floorSelect2Info:{
+                floors:[],
+                floorId:'',
+                floorNum:'',
+                floorName:'',
+            }
+        },
+        _initMethod:function(){
+        },
+        _initEvent:function(){
+
+        },
+        methods: {
+            _initFloorSelect2: function () {
+                $('.floorSelector').select2({
+                    placeholder: '必填,请选择楼栋',
+                    ajax: {
+                        url: "sdata.json",
+                        dataType: 'json',
+                        delay: 250,
+                        data: function (params) {
+                            return {
+                                floorNum: vc.component.addMachineInfo.floorNum,
+                                page: 1,
+                                row:10,
+                                communityId:vc.getCurrentCommunity().communityId
+                            };
+                        },
+                        processResults: function (data) {
+                            return {
+                                results: data
+                            };
+                        },
+                        cache: true
+                    },
+                    minimumInputLength: 2
+                });
+            }
+        }
+    });
+})(window.vc);

+ 57 - 30
WebService/src/main/resources/components/machinePackage/add-machine/addMachine.html

@@ -3,22 +3,10 @@
     <div class="modal-dialog modal-lg">
         <div class="modal-content">
             <div class="modal-body">
-                <h3 class="m-t-none m-b ">添加设备</h3>
+                <h3 class="m-t-none m-b ">添加设备门禁</h3>
                 <div class="ibox-content">
                     <div>
                         <div>
-                            <!--<div class="form-group row">
-                                <label class="col-sm-2 col-form-label">楼名称</label>
-                                <div class="col-sm-10"><input v-model="addFloorInfo.name" type="text" placeholder="必填,请填写名称" class="form-control"></div>
-                            </div>
-                            <div class="form-group row">
-                                <label class="col-sm-2 col-form-label">楼编号</label>
-                                <div class="col-sm-10"><input v-model="addFloorInfo.floorNum" type="email" placeholder="必填,请填写编号" class="form-control"></div>
-                            </div>
-                            <div class="form-group row">
-                                <label class="col-sm-2 col-form-label">备注</label>
-                                <div class="col-sm-10"><input v-model="addFloorInfo.remark" type="tel" placeholder="可填,请填写备注" class="form-control"></div>
-                            </div>-->
 
                             <div class="form-group row">
                                 <label class="col-sm-2 col-form-label">设备编码</label>
@@ -58,32 +46,71 @@
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-sm-2 col-form-label">设备IP</label>
-                                <div class="col-sm-10">
-                                    <input v-model="addMachineInfo.machineIp" type="text" placeholder="选填,请填写设备IP"
-                                           class="form-control">
+                                <label class="col-sm-2 col-form-label">设备位置</label>
+                                <div class="col-sm-5">
+                                    <select class="custom-select" v-model="addMachineInfo.locationTypeCd">
+                                        <option selected disabled value="">必填,请选择设备位置</option>
+                                        <option value="1000">东大门</option>
+                                        <option value="1001">西大门</option>
+                                        <option value="1002">北大门</option>
+                                        <option value="1003">南大门</option>
+                                        <option value="2000">单元门</option>
+                                        <option value="3000">房屋门</option>
+                                    </select>
                                 </div>
                             </div>
-                            <div class="form-group row">
-                                <label class="col-sm-2 col-form-label">设备MAC</label>
-                                <div class="col-sm-10">
-                                    <input v-model="addMachineInfo.machineMac" type="text" placeholder="选填,请填写设备MAC"
-                                           class="form-control">
-                                </div>
+                        </div>
+                        <div class="form-group row"
+                             v-if="addMachineInfo.locationTypeCd == '2000' || addMachineInfo.locationTypeCd == '3000'  ">
+                            <label class="col-sm-2 col-form-label">归属楼栋</label>
+                            <div class="col-sm-10">
+                                <vc:create name="floorSelect2"></vc:create>
                             </div>
+                        </div>
+                        <div class="form-group row"
+                             v-if="addMachineInfo.locationTypeCd == '2000' || addMachineInfo.locationTypeCd == '3000'  ">
+                            <label class="col-sm-2 col-form-label">归属单元</label>
+                            <div class="col-sm-10">
+                                <input v-model="addMachineInfo.authCode" type="text" placeholder="必填,请填写鉴权编码"
+                                       class="form-control">
+                            </div>
+                        </div>
+                        <div class="form-group row"
+                             v-if="addMachineInfo.locationTypeCd == '3000'  ">
+                            <label class="col-sm-2 col-form-label">归属房屋</label>
+                            <div class="col-sm-10">
+                                <input v-model="addMachineInfo.authCode" type="text" placeholder="必填,请填写鉴权编码"
+                                       class="form-control">
+                            </div>
+                        </div>
 
-                            <div class="ibox-content">
-                                <button class="btn btn-primary float-right" type="button"
-                                        v-on:click="saveMachineInfo()"><i class="fa fa-check"></i>&nbsp;保存
-                                </button>
-                                <button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
-                                        data-dismiss="modal">取消
-                                </button>
+                        <div class="form-group row">
+                            <label class="col-sm-2 col-form-label">设备IP</label>
+                            <div class="col-sm-10">
+                                <input v-model="addMachineInfo.machineIp" type="text" placeholder="选填,请填写设备IP"
+                                       class="form-control">
                             </div>
                         </div>
+                        <div class="form-group row">
+                            <label class="col-sm-2 col-form-label">设备MAC</label>
+                            <div class="col-sm-10">
+                                <input v-model="addMachineInfo.machineMac" type="text" placeholder="选填,请填写设备MAC"
+                                       class="form-control">
+                            </div>
+                        </div>
+
+                        <div class="ibox-content">
+                            <button class="btn btn-primary float-right" type="button"
+                                    v-on:click="saveMachineInfo()"><i class="fa fa-check"></i>&nbsp;保存
+                            </button>
+                            <button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
+                                    data-dismiss="modal">取消
+                            </button>
+                        </div>
                     </div>
                 </div>
             </div>
         </div>
     </div>
 </div>
+</div>

+ 30 - 1
WebService/src/main/resources/components/machinePackage/add-machine/addMachine.js

@@ -15,7 +15,13 @@
                 authCode: '',
                 machineIp: '',
                 machineMac: '',
-
+                floorId:'',
+                floorNum:'',
+                floorName:'',
+                unitId:'',
+                unitName:'',
+                roomId:'',
+                roomName:''
             }
         },
         _initMethod: function () {
@@ -153,6 +159,29 @@
                     machineMac: '',
 
                 };
+            },
+            _initAddMachineData:function () {
+                $('.floorSelector').select2({
+                    placeholder: '必填,请选择楼栋',
+                    ajax: {
+                        url: "sdata.json",
+                        dataType: 'json',
+                        delay: 250,
+                        data: function (params) {
+                            return {
+                                floorNum: vc.component.addMachineInfo.floorNum,
+                               /* page:*/
+                            };
+                        },
+                        processResults: function (data) {
+                            return {
+                                results: data
+                            };
+                        },
+                        cache: true
+                    },
+                    minimumInputLength: 2
+                });
             }
         }
     });

+ 8 - 2
WebService/src/main/resources/components/machinePackage/machine-manage/machineManage.html

@@ -69,13 +69,15 @@
                     >
                         <thead>
                         <tr>
-                            <th class="text-center">设备ID</th>
+                            <!--<th class="text-center">设备ID</th>-->
                             <th class="text-center">设备编码</th>
                             <th class="text-center">版本号</th>
                             <th class="text-center">设备名称</th>
                             <th class="text-center">设备类型</th>
                             <th class="text-center">设备IP</th>
                             <th class="text-center">设备MAC</th>
+                            <th class="text-center">设备位置</th>
+
                             <th class="text-center">操作</th>
 
 
@@ -83,13 +85,14 @@
                         </thead>
                         <tbody>
                         <tr v-for="machine in machineManageInfo.machines">
-                            <td class="text-center">{{machine.machineId}}</td>
+                            <!--<td class="text-center">{{machine.machineId}}</td>-->
                             <td class="text-center">{{machine.machineCode}}</td>
                             <td class="text-center">{{machine.machineVersion}}</td>
                             <td class="text-center">{{machine.machineName}}</td>
                             <td class="text-center">{{machine.machineTypeCdName}}</td>
                             <td class="text-center">{{machine.machineIp}}</td>
                             <td class="text-center">{{machine.machineMac}}</td>
+                            <td class="text-center">{{machine.machineMac}}</td>
                             <td class="text-center">
                                 <div class="btn-group">
                                     <button class="btn-white btn btn-xs" v-on:click="_openEditMachineModel(machine)">修改</button>
@@ -97,6 +100,9 @@
                                 <div class="btn-group">
                                     <button class="btn-white btn btn-xs" v-on:click="_openDeleteMachineModel(machine)">删除</button>
                                 </div>
+                                <div class="btn-group">
+                                    <button class="btn-white btn btn-xs" v-on:click="_openMachineDetailModel(machine)">详情</button>
+                                </div>
                             </td>
 
                         </tr>

+ 3 - 0
WebService/src/main/resources/components/machinePackage/machine-manage/machineManage.js

@@ -81,6 +81,9 @@
                 } else {
                     vc.component.machineManageInfo.moreCondition = true;
                 }
+            },
+            _openMachineDetailModel:function (_machine) {
+                
             }
 
 

+ 3 - 0
WebService/src/main/resources/components/pageFramePackage/common/commonTop.html

@@ -4,6 +4,7 @@
 <link href="/css/plugins/toastr/toastr.min.css" rel="stylesheet"/>
 <!-- Gritter -->
 <link href="/js/plugins/gritter/jquery.gritter.css" rel="stylesheet"/>
+<link href="/css/plugins/select2/select2.min.css" rel="stylesheet">
 <link href="/css/animate.css" rel="stylesheet"/>
 <link href="/css/style.css" rel="stylesheet"/>
 <link rel="stylesheet" href="/css/common.css"/>
@@ -19,6 +20,8 @@
 <!--<script src="/js/bootstrap/bootstrap-datetimepicker.min.js"></script>-->
 <script src="/js/bootstrap/bootstrap-datetimepicker.js"></script>
 <script src="/js/bootstrap/bootstrap-datetimepicker.zh-CN.js"></script>
+<script src="/js/plugins/select2/select2.full.min.js"></script>
+
 <script type="text/javascript">
 
     console.log('############################################################');

+ 29 - 0
java110-bean/src/main/java/com/java110/dto/hardwareAdapation/MachineDto.java

@@ -26,6 +26,10 @@ public class MachineDto extends PageDto implements Serializable {
     private String machineTypeCdName;
     private String machineIp;
     private String bId;
+    private String locationTypeCd;
+    private String locationObjId;
+    private String state;
+
 
     private Date createTime;
 
@@ -136,4 +140,29 @@ public class MachineDto extends PageDto implements Serializable {
     public void setMachineTypeCdName(String machineTypeCdName) {
         this.machineTypeCdName = machineTypeCdName;
     }
+
+
+    public String getLocationTypeCd() {
+        return locationTypeCd;
+    }
+
+    public void setLocationTypeCd(String locationTypeCd) {
+        this.locationTypeCd = locationTypeCd;
+    }
+
+    public String getLocationObjId() {
+        return locationObjId;
+    }
+
+    public void setLocationObjId(String locationObjId) {
+        this.locationObjId = locationObjId;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
 }

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

@@ -14,6 +14,9 @@ public class ApiMachineDataVo implements Serializable {
     private String authCode;
     private String machineIp;
     private String machineMac;
+    private String locationTypeCd;
+    private String locationObjId;
+    private String state;
 
     public String getMachineId() {
         return machineId;
@@ -86,4 +89,28 @@ public class ApiMachineDataVo implements Serializable {
     public void setMachineTypeCdName(String machineTypeCdName) {
         this.machineTypeCdName = machineTypeCdName;
     }
+
+    public String getLocationTypeCd() {
+        return locationTypeCd;
+    }
+
+    public void setLocationTypeCd(String locationTypeCd) {
+        this.locationTypeCd = locationTypeCd;
+    }
+
+    public String getLocationObjId() {
+        return locationObjId;
+    }
+
+    public void setLocationObjId(String locationObjId) {
+        this.locationObjId = locationObjId;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
 }

+ 6 - 0
java110-db/db/HardwareAdapationService/create.sql

@@ -10,6 +10,9 @@ create table business_machine(
   auth_code varchar(64) not null comment '授权码',
   machine_ip varchar(64) comment '设备IP',
   machine_mac varchar(64) comment '设备mac',
+  location_type_cd varchar(12) not null default '1000' comment '位置类型,1000 东大门  1001 西大门 1002 北大门 1003 南大门 2000 单元门 3000 房屋门',
+  location_obj_id varchar(30) not null default '-1' comment '对象ID,大门时小区ID,单元门 时单元ID 房屋时房屋ID',
+  state varchar(12) not null default '1000' comment '设备状态,设备配置同步状态 1000 未同步 1100 同步中 1200 已同步',
   create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
   operate VARCHAR(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL'
 );
@@ -27,6 +30,9 @@ create table machine(
   auth_code varchar(64) not null comment '授权码',
   machine_ip varchar(64) comment '设备IP',
   machine_mac varchar(64) comment '设备mac',
+  location_type_cd varchar(12) not null default '1000' comment '位置类型,1000 东大门  1001 西大门 1002 北大门 1003 南大门 2000 单元门 3000 房屋门',
+  location_obj_id varchar(30) not null default '-1' comment '对象ID,大门时小区ID,单元门 时单元ID 房屋时房屋ID',
+  state varchar(12) not null default '1000' comment '设备状态,设备配置同步状态 1000 未同步 1100 同步中 1200 已同步',
   create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
   status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
   UNIQUE KEY (machine_id)

+ 62 - 6
java110-db/src/main/resources/mapper/hardwareAdapation/MachineServiceDaoImplMapper.xml

@@ -7,9 +7,12 @@
     <!-- 保存设备信息 add by wuxw 2018-07-03 -->
     <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
+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
 ) values (
-#{machineMac},#{machineId},#{machineCode},#{authCode},#{operate},#{machineVersion},#{communityId},#{bId},#{machineName},#{machineTypeCd},#{machineIp}
+#{machineMac},#{machineId},#{machineCode},#{authCode},#{operate},#{machineVersion},
+#{communityId},#{bId},#{machineName},#{machineTypeCd},#{machineIp},
+#{locationTypeCd},#{locationObjId},#{state}
 )
        </insert>
 
@@ -19,7 +22,8 @@ machine_mac,machine_id,machine_code,auth_code,operate,machine_version,community_
         select t.machine_mac,t.machine_mac machineMac,t.machine_id,t.machine_id machineId,t.machine_code,t.machine_code
         machineCode,t.auth_code,t.auth_code authCode,t.operate,t.machine_version,t.machine_version
         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
+        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 locationTypeCd,t.location_obj_id locationObjId
         from business_machine t
         where 1 =1
         <if test="machineMac !=null and machineMac != ''">
@@ -56,15 +60,29 @@ machine_mac,machine_id,machine_code,auth_code,operate,machine_version,community_
             and t.machine_ip= #{machineIp}
         </if>
 
+        <if test="locationTypeCd !=null and locationTypeCd != ''">
+            and t.location_type_cd= #{locationTypeCd}
+        </if>
+        <if test="locationObjId !=null and locationObjId != ''">
+            and t.location_obj_id= #{locationObjId}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state = #{state}
+        </if>
+
     </select>
 
 
     <!-- 保存设备信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveMachineInfoInstance" parameterType="Map">
         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
+        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
         ) 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.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
         from business_machine t where 1=1
         <if test="machineMac !=null and machineMac != ''">
             and t.machine_mac= #{machineMac}
@@ -98,6 +116,16 @@ machine_mac,machine_id,machine_code,auth_code,operate,machine_version,community_
             and t.machine_ip= #{machineIp}
         </if>
 
+        <if test="locationTypeCd !=null and locationTypeCd != ''">
+            and t.location_type_cd= #{locationTypeCd}
+        </if>
+        <if test="locationObjId !=null and locationObjId != ''">
+            and t.location_obj_id= #{locationObjId}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state = #{state}
+        </if>
+
     </insert>
 
 
@@ -107,7 +135,8 @@ machine_mac,machine_id,machine_code,auth_code,operate,machine_version,community_
         machineCode,t.auth_code,t.auth_code authCode,t.machine_version,t.machine_version
         machineVersion,t.status_cd,t.status_cd statusCd,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,td.name machineTypeCdName
+        machineTypeCd,t.machine_ip,t.machine_ip machineIp,td.name machineTypeCdName,
+        t.state,t.location_type_cd locationTypeCd,t.location_obj_id locationObjId
         from machine t,t_dict td
         where 1 =1
         and t.machine_type_cd=td.status_cd
@@ -146,6 +175,15 @@ machine_mac,machine_id,machine_code,auth_code,operate,machine_version,community_
         <if test="machineIp !=null and machineIp != ''">
             and t.machine_ip= #{machineIp}
         </if>
+        <if test="locationTypeCd !=null and locationTypeCd != ''">
+            and t.location_type_cd= #{locationTypeCd}
+        </if>
+        <if test="locationObjId !=null and locationObjId != ''">
+            and t.location_obj_id= #{locationObjId}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state = #{state}
+        </if>
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
         </if>
@@ -183,6 +221,15 @@ machine_mac,machine_id,machine_code,auth_code,operate,machine_version,community_
         <if test="machineIp !=null and machineIp != ''">
             , t.machine_ip= #{machineIp}
         </if>
+        <if test="locationTypeCd !=null and locationTypeCd != ''">
+            , t.location_type_cd= #{locationTypeCd}
+        </if>
+        <if test="locationObjId !=null and locationObjId != ''">
+            , t.location_obj_id= #{locationObjId}
+        </if>
+        <if test="state !=null and state != ''">
+            , t.state = #{state}
+        </if>
         where 1=1
         <if test="machineId !=null and machineId != ''">
             and t.machine_id= #{machineId}
@@ -234,6 +281,15 @@ machine_mac,machine_id,machine_code,auth_code,operate,machine_version,community_
         <if test="machineIp !=null and machineIp != ''">
             and t.machine_ip= #{machineIp}
         </if>
+        <if test="locationTypeCd !=null and locationTypeCd != ''">
+            and t.location_type_cd= #{locationTypeCd}
+        </if>
+        <if test="locationObjId !=null and locationObjId != ''">
+            and t.location_obj_id= #{locationObjId}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state = #{state}
+        </if>
 
 
     </select>