Bladeren bron

优化 小区ID没有传的问题

wuxw 6 jaren geleden
bovenliggende
commit
6799fbeb2a
14 gewijzigde bestanden met toevoegingen van 261 en 234 verwijderingen
  1. 1 0
      Api/src/main/java/com/java110/api/listener/applicationKey/DeleteApplicationKeyListener.java
  2. 3 0
      Api/src/main/java/com/java110/api/listener/applicationKey/ListApplicationKeysListener.java
  3. 1 0
      Api/src/main/java/com/java110/api/listener/applicationKey/SaveApplicationKeyListener.java
  4. 1 0
      Api/src/main/java/com/java110/api/listener/applicationKey/UpdateApplicationKeyListener.java
  5. 4 0
      HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/listener/applicationKey/AbstractApplicationKeyBusinessServiceDataFlowListener.java
  6. 1 0
      WebService/src/main/java/com/java110/web/smo/applicationKey/impl/AddApplicationKeySMOImpl.java
  7. 1 0
      WebService/src/main/java/com/java110/web/smo/applicationKey/impl/DeleteApplicationKeySMOImpl.java
  8. 2 0
      WebService/src/main/java/com/java110/web/smo/applicationKey/impl/EditApplicationKeySMOImpl.java
  9. 2 0
      WebService/src/main/java/com/java110/web/smo/applicationKey/impl/ListApplicationKeysSMOImpl.java
  10. 2 6
      WebService/src/main/resources/components/applicationKeyPackage/add-applicationKeyView/addApplicationKey.js
  11. 1 0
      WebService/src/main/resources/components/applicationKeyPackage/applicationKey-manage/applicationKeyManage.js
  12. 1 6
      WebService/src/main/resources/components/applicationKeyPackage/edit-applicationKey/editApplicationKey.js
  13. 1 0
      java110-code-generator/src/main/java/com/java110/ApplicationKeyGeneratorApplication.java
  14. 240 222
      java110-db/src/main/resources/mapper/hardwareAdapation/ApplicationKeyServiceDaoImplMapper.xml

+ 1 - 0
Api/src/main/java/com/java110/api/listener/applicationKey/DeleteApplicationKeyListener.java

@@ -26,6 +26,7 @@ public class DeleteApplicationKeyListener extends AbstractServiceApiListener {
     @Override
     protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
         //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+        Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区");
 
         Assert.hasKeyAndValue(reqJson, "applicationKeyId", "钥匙申请ID不能为空");
 

+ 3 - 0
Api/src/main/java/com/java110/api/listener/applicationKey/ListApplicationKeysListener.java

@@ -8,6 +8,7 @@ import com.java110.core.smo.hardwareAdapation.IApplicationKeyInnerServiceSMO;
 import com.java110.dto.hardwareAdapation.ApplicationKeyDto;
 import com.java110.event.service.api.ServiceDataFlowEvent;
 import com.java110.utils.constant.ServiceCodeApplicationKeyConstant;
+import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.vo.api.applicationKey.ApiApplicationKeyDataVo;
 import com.java110.vo.api.applicationKey.ApiApplicationKeyVo;
@@ -56,6 +57,8 @@ public class ListApplicationKeysListener extends AbstractServiceApiListener {
 
     @Override
     protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区");
+
         super.validatePageInfo(reqJson);
     }
 

+ 1 - 0
Api/src/main/java/com/java110/api/listener/applicationKey/SaveApplicationKeyListener.java

@@ -38,6 +38,7 @@ public class SaveApplicationKeyListener extends AbstractServiceApiListener {
         //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
 
         Assert.hasKeyAndValue(reqJson, "name", "必填,请填写姓名");
+        Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区");
         Assert.hasKeyAndValue(reqJson, "tel", "必填,请填写手机号");
         Assert.hasKeyAndValue(reqJson, "typeCd", "必填,请选择用户类型");
         Assert.hasKeyAndValue(reqJson, "sex", "必填,请选择性别");

+ 1 - 0
Api/src/main/java/com/java110/api/listener/applicationKey/UpdateApplicationKeyListener.java

@@ -34,6 +34,7 @@ public class UpdateApplicationKeyListener extends AbstractServiceApiListener {
     protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
 
         Assert.hasKeyAndValue(reqJson, "applicationKeyId", "钥匙申请ID不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区");
         Assert.hasKeyAndValue(reqJson, "name", "必填,请填写姓名");
         Assert.hasKeyAndValue(reqJson, "tel", "必填,请填写手机号");
         Assert.hasKeyAndValue(reqJson, "typeCd", "必填,请选择用户类型");

+ 4 - 0
HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/listener/applicationKey/AbstractApplicationKeyBusinessServiceDataFlowListener.java

@@ -49,6 +49,8 @@ public abstract class AbstractApplicationKeyBusinessServiceDataFlowListener exte
         businessApplicationKeyInfo.put("startTime", businessApplicationKeyInfo.get("start_time"));
         businessApplicationKeyInfo.put("state", businessApplicationKeyInfo.get("state"));
         businessApplicationKeyInfo.put("age", businessApplicationKeyInfo.get("age"));
+        businessApplicationKeyInfo.put("communityId", businessApplicationKeyInfo.get("community_id"));
+
         businessApplicationKeyInfo.remove("bId");
         businessApplicationKeyInfo.put("statusCd", statusCd);
     }
@@ -85,6 +87,8 @@ public abstract class AbstractApplicationKeyBusinessServiceDataFlowListener exte
         currentApplicationKeyInfo.put("startTime", currentApplicationKeyInfo.get("start_time"));
         currentApplicationKeyInfo.put("state", currentApplicationKeyInfo.get("state"));
         currentApplicationKeyInfo.put("age", currentApplicationKeyInfo.get("age"));
+        currentApplicationKeyInfo.put("communityId", currentApplicationKeyInfo.get("community_id"));
+
 
 
         currentApplicationKeyInfo.put("operate", StatusConstant.OPERATE_DEL);

+ 1 - 0
WebService/src/main/java/com/java110/web/smo/applicationKey/impl/AddApplicationKeySMOImpl.java

@@ -32,6 +32,7 @@ public class AddApplicationKeySMOImpl extends AbstractComponentSMO implements IA
 
         //Assert.hasKeyAndValue(paramIn, "xxx", "xxx");
         Assert.hasKeyAndValue(paramIn, "name", "必填,请填写姓名");
+        Assert.hasKeyAndValue(paramIn, "communityId", "必填,请填写小区ID");
         Assert.hasKeyAndValue(paramIn, "tel", "必填,请填写手机号");
         Assert.hasKeyAndValue(paramIn, "typeCd", "必填,请选择用户类型");
         Assert.hasKeyAndValue(paramIn, "sex", "必填,请选择性别");

+ 1 - 0
WebService/src/main/java/com/java110/web/smo/applicationKey/impl/DeleteApplicationKeySMOImpl.java

@@ -32,6 +32,7 @@ public class DeleteApplicationKeySMOImpl extends AbstractComponentSMO implements
 
         //Assert.hasKeyAndValue(paramIn, "xxx", "xxx");
         Assert.hasKeyAndValue(paramIn, "applicationKeyId", "钥匙申请ID不能为空");
+        Assert.hasKeyAndValue(paramIn, "communityId", "必填,请填写小区ID");
 
 
         super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.LIST_APPLICATION_KEY);

+ 2 - 0
WebService/src/main/java/com/java110/web/smo/applicationKey/impl/EditApplicationKeySMOImpl.java

@@ -29,6 +29,8 @@ public class EditApplicationKeySMOImpl extends AbstractComponentSMO implements I
         //super.validatePageInfo(pd);
 
         Assert.hasKeyAndValue(paramIn, "applicationKeyId", "钥匙申请ID不能为空");
+        Assert.hasKeyAndValue(paramIn, "communityId", "必填,请填写小区ID");
+
         Assert.hasKeyAndValue(paramIn, "name", "必填,请填写姓名");
         Assert.hasKeyAndValue(paramIn, "tel", "必填,请填写手机号");
         Assert.hasKeyAndValue(paramIn, "typeCd", "必填,请选择用户类型");

+ 2 - 0
WebService/src/main/java/com/java110/web/smo/applicationKey/impl/ListApplicationKeysSMOImpl.java

@@ -7,6 +7,7 @@ import com.java110.entity.component.ComponentValidateResult;
 import com.java110.utils.constant.PrivilegeCodeConstant;
 import com.java110.utils.constant.ServiceConstant;
 import com.java110.utils.exception.SMOException;
+import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.web.smo.applicationKey.IListApplicationKeysSMO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,6 +34,7 @@ public class ListApplicationKeysSMOImpl extends AbstractComponentSMO implements
 
     @Override
     protected void validate(IPageData pd, JSONObject paramIn) {
+        Assert.hasKeyAndValue(paramIn, "communityId", "必填,请填写小区ID");
 
         super.validatePageInfo(pd);
 

+ 2 - 6
WebService/src/main/resources/components/applicationKeyPackage/add-applicationKeyView/addApplicationKey.js

@@ -125,12 +125,8 @@
                             limit: "required",
                             param: "",
                             errInfo: "性别不能为空"
-                        },
-                        {
-                            limit: "num",
-                            param: "",
-                            errInfo: "性别格式错误"
-                        },
+                        }
+
                     ],
                     'addApplicationKeyInfo.age': [
                         {

+ 1 - 0
WebService/src/main/resources/components/applicationKeyPackage/applicationKey-manage/applicationKeyManage.js

@@ -39,6 +39,7 @@
                 vc.component.applicationKeyManageInfo.showComponent = 'applicationKeyManage';
                 vc.component.applicationKeyManageInfo.conditions.page = _page;
                 vc.component.applicationKeyManageInfo.conditions.row = _rows;
+                vc.component.applicationKeyManageInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
                 var param = {
                     params: vc.component.applicationKeyManageInfo.conditions
                 };

+ 1 - 6
WebService/src/main/resources/components/applicationKeyPackage/edit-applicationKey/editApplicationKey.js

@@ -126,12 +126,7 @@
                             limit: "required",
                             param: "",
                             errInfo: "性别不能为空"
-                        },
-                        {
-                            limit: "num",
-                            param: "",
-                            errInfo: "性别格式错误"
-                        },
+                        }
                     ],
                     'editApplicationKeyInfo.age': [
                         {

+ 1 - 0
java110-code-generator/src/main/java/com/java110/ApplicationKeyGeneratorApplication.java

@@ -49,6 +49,7 @@ public class ApplicationKeyGeneratorApplication {
         param.put("state", "state");
         param.put("startTime", "start_time");
         param.put("entTime", "end_time");
+        param.put("communityId", "community_id");
         param.put("statusCd", "status_cd");
         param.put("operate", "operate");
         param.put("bId", "b_id");

+ 240 - 222
java110-db/src/main/resources/mapper/hardwareAdapation/ApplicationKeyServiceDaoImplMapper.xml

@@ -5,257 +5,275 @@
 <mapper namespace="applicationKeyServiceDaoImpl">
 
     <!-- 保存钥匙申请信息 add by wuxw 2018-07-03 -->
-       <insert id="saveBusinessApplicationKeyInfo" parameterType="Map">
+    <insert id="saveBusinessApplicationKeyInfo" parameterType="Map">
            insert into business_application_key(
-application_key_id,id_card,sex,end_time,machine_id,operate,type_cd,name,tel,start_time,state,b_id,age
+application_key_id,id_card,sex,end_time,machine_id,operate,type_cd,name,tel,start_time,state,community_id,b_id,age
 ) values (
-#{applicationKeyId},#{idCard},#{sex},#{entTime},#{machineId},#{operate},#{typeCd},#{name},#{tel},#{startTime},#{state},#{bId},#{age}
+#{applicationKeyId},#{idCard},#{sex},#{entTime},#{machineId},#{operate},#{typeCd},#{name},#{tel},#{startTime},#{state},#{communityId},#{bId},#{age}
 )
        </insert>
 
 
-       <!-- 查询钥匙申请信息(Business) add by wuxw 2018-07-03 -->
-       <select id="getBusinessApplicationKeyInfo" parameterType="Map" resultType="Map">
-           select  t.application_key_id,t.application_key_id applicationKeyId,t.id_card,t.id_card idCard,t.sex,t.end_time,t.end_time entTime,t.machine_id,t.machine_id machineId,t.operate,t.type_cd,t.type_cd typeCd,t.name,t.tel,t.start_time,t.start_time startTime,t.state,t.b_id,t.b_id bId,t.age 
-from business_application_key t 
-where 1 =1 
-<if test="applicationKeyId !=null and applicationKeyId != ''">
-   and t.application_key_id= #{applicationKeyId}
-</if> 
-<if test="idCard !=null and idCard != ''">
-   and t.id_card= #{idCard}
-</if> 
-<if test="sex !=null and sex != ''">
-   and t.sex= #{sex}
-</if> 
-<if test="entTime !=null and entTime != ''">
-   and t.end_time= #{entTime}
-</if> 
-<if test="machineId !=null and machineId != ''">
-   and t.machine_id= #{machineId}
-</if> 
-<if test="operate !=null and operate != ''">
-   and t.operate= #{operate}
-</if> 
-<if test="typeCd !=null and typeCd != ''">
-   and t.type_cd= #{typeCd}
-</if> 
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="tel !=null and tel != ''">
-   and t.tel= #{tel}
-</if> 
-<if test="startTime !=null and startTime != ''">
-   and t.start_time= #{startTime}
-</if> 
-<if test="state !=null and state != ''">
-   and t.state= #{state}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="age !=null and age != ''">
-   and t.age= #{age}
-</if> 
-
-       </select>
-
-
+    <!-- 查询钥匙申请信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessApplicationKeyInfo" parameterType="Map" resultType="Map">
+        select t.application_key_id,t.application_key_id applicationKeyId,t.id_card,t.id_card
+        idCard,t.sex,t.end_time,t.end_time entTime,t.machine_id,t.machine_id machineId,t.operate,t.type_cd,t.type_cd
+        typeCd,t.name,t.tel,t.start_time,t.start_time startTime,t.state,t.community_id,t.community_id
+        communityId,t.b_id,t.b_id bId,t.age
+        from business_application_key t
+        where 1 =1
+        <if test="applicationKeyId !=null and applicationKeyId != ''">
+            and t.application_key_id= #{applicationKeyId}
+        </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card= #{idCard}
+        </if>
+        <if test="sex !=null and sex != ''">
+            and t.sex= #{sex}
+        </if>
+        <if test="entTime !=null and entTime != ''">
+            and t.end_time= #{entTime}
+        </if>
+        <if test="machineId !=null and machineId != ''">
+            and t.machine_id= #{machineId}
+        </if>
+        <if test="operate !=null and operate != ''">
+            and t.operate= #{operate}
+        </if>
+        <if test="typeCd !=null and typeCd != ''">
+            and t.type_cd= #{typeCd}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="age !=null and age != ''">
+            and t.age= #{age}
+        </if>
 
+    </select>
 
 
     <!-- 保存钥匙申请信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveApplicationKeyInfoInstance" parameterType="Map">
         insert into application_key(
-application_key_id,id_card,sex,status_cd,end_time,machine_id,type_cd,name,tel,start_time,state,b_id,age
-) select t.application_key_id,t.id_card,t.sex,'0',t.end_time,t.machine_id,t.type_cd,t.name,t.tel,t.start_time,t.state,t.b_id,t.age from business_application_key t where 1=1
-<if test="applicationKeyId !=null and applicationKeyId != ''">
-   and t.application_key_id= #{applicationKeyId}
-</if> 
-<if test="idCard !=null and idCard != ''">
-   and t.id_card= #{idCard}
-</if> 
-<if test="sex !=null and sex != ''">
-   and t.sex= #{sex}
-</if> 
-<if test="entTime !=null and entTime != ''">
-   and t.end_time= #{entTime}
-</if> 
-<if test="machineId !=null and machineId != ''">
-   and t.machine_id= #{machineId}
-</if> 
-   and t.operate= 'ADD'
-<if test="typeCd !=null and typeCd != ''">
-   and t.type_cd= #{typeCd}
-</if> 
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="tel !=null and tel != ''">
-   and t.tel= #{tel}
-</if> 
-<if test="startTime !=null and startTime != ''">
-   and t.start_time= #{startTime}
-</if> 
-<if test="state !=null and state != ''">
-   and t.state= #{state}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="age !=null and age != ''">
-   and t.age= #{age}
-</if> 
+        application_key_id,id_card,sex,status_cd,end_time,machine_id,type_cd,name,tel,start_time,state,community_id,b_id,age
+        ) select
+        t.application_key_id,t.id_card,t.sex,'0',t.end_time,t.machine_id,t.type_cd,t.name,t.tel,t.start_time,t.state,t.community_id,t.b_id,t.age
+        from business_application_key t where 1=1
+        <if test="applicationKeyId !=null and applicationKeyId != ''">
+            and t.application_key_id= #{applicationKeyId}
+        </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card= #{idCard}
+        </if>
+        <if test="sex !=null and sex != ''">
+            and t.sex= #{sex}
+        </if>
+        <if test="entTime !=null and entTime != ''">
+            and t.end_time= #{entTime}
+        </if>
+        <if test="machineId !=null and machineId != ''">
+            and t.machine_id= #{machineId}
+        </if>
+        and t.operate= 'ADD'
+        <if test="typeCd !=null and typeCd != ''">
+            and t.type_cd= #{typeCd}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="age !=null and age != ''">
+            and t.age= #{age}
+        </if>
 
     </insert>
 
 
-
     <!-- 查询钥匙申请信息 add by wuxw 2018-07-03 -->
     <select id="getApplicationKeyInfo" parameterType="Map" resultType="Map">
-        select  t.application_key_id,t.application_key_id applicationKeyId,t.id_card,t.id_card idCard,t.sex,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time entTime,t.machine_id,t.machine_id machineId,t.type_cd,t.type_cd typeCd,t.name,t.tel,t.start_time,t.start_time startTime,t.state,t.b_id,t.b_id bId,t.age 
-from application_key t 
-where 1 =1 
-<if test="applicationKeyId !=null and applicationKeyId != ''">
-   and t.application_key_id= #{applicationKeyId}
-</if> 
-<if test="idCard !=null and idCard != ''">
-   and t.id_card= #{idCard}
-</if> 
-<if test="sex !=null and sex != ''">
-   and t.sex= #{sex}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="entTime !=null and entTime != ''">
-   and t.end_time= #{entTime}
-</if> 
-<if test="machineId !=null and machineId != ''">
-   and t.machine_id= #{machineId}
-</if> 
-<if test="typeCd !=null and typeCd != ''">
-   and t.type_cd= #{typeCd}
-</if> 
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="tel !=null and tel != ''">
-   and t.tel= #{tel}
-</if> 
-<if test="startTime !=null and startTime != ''">
-   and t.start_time= #{startTime}
-</if> 
-<if test="state !=null and state != ''">
-   and t.state= #{state}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="age !=null and age != ''">
-   and t.age= #{age}
-</if> 
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.application_key_id,t.application_key_id applicationKeyId,t.id_card,t.id_card
+        idCard,t.sex,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time entTime,t.machine_id,t.machine_id
+        machineId,t.type_cd,t.type_cd typeCd,t.name,t.tel,t.start_time,t.start_time
+        startTime,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.age
+        from application_key t
+        where 1 =1
+        <if test="applicationKeyId !=null and applicationKeyId != ''">
+            and t.application_key_id= #{applicationKeyId}
+        </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card= #{idCard}
+        </if>
+        <if test="sex !=null and sex != ''">
+            and t.sex= #{sex}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="entTime !=null and entTime != ''">
+            and t.end_time= #{entTime}
+        </if>
+        <if test="machineId !=null and machineId != ''">
+            and t.machine_id= #{machineId}
+        </if>
+        <if test="typeCd !=null and typeCd != ''">
+            and t.type_cd= #{typeCd}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="age !=null and age != ''">
+            and t.age= #{age}
+        </if>
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
 
     </select>
 
 
-
-
     <!-- 修改钥匙申请信息 add by wuxw 2018-07-03 -->
     <update id="updateApplicationKeyInfoInstance" parameterType="Map">
-        update  application_key t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="idCard !=null and idCard != ''">
-, t.id_card= #{idCard}
-</if> 
-<if test="sex !=null and sex != ''">
-, t.sex= #{sex}
-</if> 
-<if test="entTime !=null and entTime != ''">
-, t.end_time= #{entTime}
-</if> 
-<if test="machineId !=null and machineId != ''">
-, t.machine_id= #{machineId}
-</if> 
-<if test="typeCd !=null and typeCd != ''">
-, t.type_cd= #{typeCd}
-</if> 
-<if test="name !=null and name != ''">
-, t.name= #{name}
-</if> 
-<if test="tel !=null and tel != ''">
-, t.tel= #{tel}
-</if> 
-<if test="startTime !=null and startTime != ''">
-, t.start_time= #{startTime}
-</if> 
-<if test="state !=null and state != ''">
-, t.state= #{state}
-</if> 
-<if test="age !=null and age != ''">
-, t.age= #{age}
-</if> 
- where 1=1 <if test="applicationKeyId !=null and applicationKeyId != ''">
-and t.application_key_id= #{applicationKeyId}
-</if> 
-<if test="bId !=null and bId != ''">
-and t.b_id= #{bId}
-</if> 
+        update application_key t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="idCard !=null and idCard != ''">
+            , t.id_card= #{idCard}
+        </if>
+        <if test="sex !=null and sex != ''">
+            , t.sex= #{sex}
+        </if>
+        <if test="entTime !=null and entTime != ''">
+            , t.end_time= #{entTime}
+        </if>
+        <if test="machineId !=null and machineId != ''">
+            , t.machine_id= #{machineId}
+        </if>
+        <if test="typeCd !=null and typeCd != ''">
+            , t.type_cd= #{typeCd}
+        </if>
+        <if test="name !=null and name != ''">
+            , t.name= #{name}
+        </if>
+        <if test="tel !=null and tel != ''">
+            , t.tel= #{tel}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            , t.start_time= #{startTime}
+        </if>
+        <if test="state !=null and state != ''">
+            , t.state= #{state}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="age !=null and age != ''">
+            , t.age= #{age}
+        </if>
+        where 1=1
+        <if test="applicationKeyId !=null and applicationKeyId != ''">
+            and t.application_key_id= #{applicationKeyId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
 
     </update>
 
     <!-- 查询钥匙申请数量 add by wuxw 2018-07-03 -->
-     <select id="queryApplicationKeysCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from application_key t 
-where 1 =1 
-<if test="applicationKeyId !=null and applicationKeyId != ''">
-   and t.application_key_id= #{applicationKeyId}
-</if> 
-<if test="idCard !=null and idCard != ''">
-   and t.id_card= #{idCard}
-</if> 
-<if test="sex !=null and sex != ''">
-   and t.sex= #{sex}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="entTime !=null and entTime != ''">
-   and t.end_time= #{entTime}
-</if> 
-<if test="machineId !=null and machineId != ''">
-   and t.machine_id= #{machineId}
-</if> 
-<if test="typeCd !=null and typeCd != ''">
-   and t.type_cd= #{typeCd}
-</if> 
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="tel !=null and tel != ''">
-   and t.tel= #{tel}
-</if> 
-<if test="startTime !=null and startTime != ''">
-   and t.start_time= #{startTime}
-</if> 
-<if test="state !=null and state != ''">
-   and t.state= #{state}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="age !=null and age != ''">
-   and t.age= #{age}
-</if> 
+    <select id="queryApplicationKeysCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from application_key t
+        where 1 =1
+        <if test="applicationKeyId !=null and applicationKeyId != ''">
+            and t.application_key_id= #{applicationKeyId}
+        </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card= #{idCard}
+        </if>
+        <if test="sex !=null and sex != ''">
+            and t.sex= #{sex}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="entTime !=null and entTime != ''">
+            and t.end_time= #{entTime}
+        </if>
+        <if test="machineId !=null and machineId != ''">
+            and t.machine_id= #{machineId}
+        </if>
+        <if test="typeCd !=null and typeCd != ''">
+            and t.type_cd= #{typeCd}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="age !=null and age != ''">
+            and t.age= #{age}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>