wuxw пре 6 година
родитељ
комит
7fa84cbdd2

+ 48 - 1
Api/src/main/java/com/java110/api/listener/owner/AppUserBindingOwnerListener.java

@@ -11,8 +11,11 @@ import com.java110.core.smo.community.ICommunityInnerServiceSMO;
 import com.java110.core.smo.file.IFileInnerServiceSMO;
 import com.java110.core.smo.owner.IOwnerAppUserInnerServiceSMO;
 import com.java110.core.smo.owner.IOwnerInnerServiceSMO;
+import com.java110.core.smo.user.IUserInnerServiceSMO;
+import com.java110.dto.UserDto;
 import com.java110.dto.community.CommunityDto;
 import com.java110.dto.file.FileDto;
+import com.java110.dto.owner.OwnerAppUserDto;
 import com.java110.dto.owner.OwnerDto;
 import com.java110.entity.center.AppService;
 import com.java110.event.service.api.ServiceDataFlowEvent;
@@ -29,6 +32,7 @@ import org.springframework.http.HttpMethod;
 import org.springframework.http.ResponseEntity;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @ClassName AppUserBindingOwnerListener
@@ -57,6 +61,9 @@ public class AppUserBindingOwnerListener extends AbstractServiceApiListener {
     @Autowired
     private IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMOImpl;
 
+    @Autowired
+    private IUserInnerServiceSMO userInnerServiceSMOImpl;
+
     private static Logger logger = LoggerFactory.getLogger(AppUserBindingOwnerListener.class);
 
     @Override
@@ -76,15 +83,39 @@ public class AppUserBindingOwnerListener extends AbstractServiceApiListener {
         Assert.hasKeyAndValue(reqJson, "appUserName", "未包含用户名称");
         Assert.hasKeyAndValue(reqJson, "idCard", "未包含身份证号");
         Assert.hasKeyAndValue(reqJson, "link", "未包含联系电话");
+        //判断是否有用户ID
+        Map<String, String> headers = event.getDataFlowContext().getRequestCurrentHeaders();
+
+        Assert.hasKeyAndValue(headers, "user_id", "请求头中未包含用户信息");
     }
 
     @Override
     protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
 
         logger.debug("ServiceDataFlowEvent : {}", event);
+        //判断是否有用户ID
+        Map<String, String> headers = event.getDataFlowContext().getRequestCurrentHeaders();
+
+        String userId = headers.get("user_id");
+        UserDto userDto = new UserDto();
+        userDto.setUserId(userId);
+        List<UserDto> userDtos = userInnerServiceSMOImpl.getUsers(userDto);
 
+        Assert.listOnlyOne(userDtos, "未找到相应用户信息,或查询到多条");
 
+        String openId = userDtos.get(0).getOpenId();
 
+        Assert.hasLength(openId, "该用户不是能力开放用户");
+
+        OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto();
+        ownerAppUserDto.setStates(new String[]{"10000","12000"});
+
+        List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
+
+        //Assert.listOnlyOne(ownerAppUserDtos, "已经申请过入驻小区");
+        if(ownerAppUserDtos !=null && ownerAppUserDtos.size()>0){
+            throw new IllegalArgumentException("已经申请过入驻小区");
+        }
 
         //查询小区是否存在
         CommunityDto communityDto = new CommunityDto();
@@ -154,7 +185,7 @@ public class AppUserBindingOwnerListener extends AbstractServiceApiListener {
         businessOwnerAppUser.put("communityId", communityDto.getCommunityId());
         businessOwnerAppUser.put("appUserName", ownerDto.getName());
         businessOwnerAppUser.put("idCard", ownerDto.getIdCard());
-        businessOwnerAppUser.put("link",ownerDto.getLink());
+        businessOwnerAppUser.put("link", ownerDto.getLink());
         business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessOwnerAppUser", businessOwnerAppUser);
         return business;
     }
@@ -191,4 +222,20 @@ public class AppUserBindingOwnerListener extends AbstractServiceApiListener {
     public void setOwnerInnerServiceSMOImpl(IOwnerInnerServiceSMO ownerInnerServiceSMOImpl) {
         this.ownerInnerServiceSMOImpl = ownerInnerServiceSMOImpl;
     }
+
+    public IOwnerAppUserInnerServiceSMO getOwnerAppUserInnerServiceSMOImpl() {
+        return ownerAppUserInnerServiceSMOImpl;
+    }
+
+    public void setOwnerAppUserInnerServiceSMOImpl(IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMOImpl) {
+        this.ownerAppUserInnerServiceSMOImpl = ownerAppUserInnerServiceSMOImpl;
+    }
+
+    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
+        return userInnerServiceSMOImpl;
+    }
+
+    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
+        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
+    }
 }

+ 22 - 3
AppFrontService/src/main/java/com/java110/app/rest/RestAppApi.java

@@ -19,11 +19,11 @@ import java.util.Map;
 
 /**
  * 微信小程序api处理类
- *
+ * <p>
  * 主要用于透传api 直接提供出来的接口
- *
+ * <p>
  * 方便快速开发
- *
+ * <p>
  * add by wuxw 2019-11-19
  */
 @RestController
@@ -170,12 +170,31 @@ public class RestAppApi extends BaseController {
         try {
             super.initHeadParam(request, headers);
             super.initUrlParam(request, headers);
+            this.getUserInfo(request, headers);
+
         } catch (Exception e) {
             logger.error("加载头信息失败", e);
             throw e;
         }
     }
 
+
+    private void getUserInfo(HttpServletRequest request, Map headers) throws Exception {
+        Object claimsObj = request.getAttribute("claims");
+        if (claimsObj == null) {
+            return;
+        }
+        Map<String, String> claims = (Map<String, String>) claimsObj;
+
+        for (String key : claims.keySet()) {
+
+            if("userId".equals(key)){
+                headers.put("user_id", claims.get(key));
+            }
+            headers.put(key, claims.get(key));
+        }
+    }
+
     public IApiSMO getApiSMOImpl() {
         return apiSMOImpl;
     }

+ 1 - 0
AppFrontService/src/main/java/com/java110/app/smo/wxLogin/impl/WxLoginSMOImpl.java

@@ -138,6 +138,7 @@ public class WxLoginSMOImpl extends AppAbstractComponentSMO implements IWxLoginS
         try {
             Map userMap = new HashMap();
             userMap.put(CommonConstant.LOGIN_USER_ID, userInfo.getString("userId"));
+            userMap.put(CommonConstant.LOGIN_USER_NAME, userInfo.getString("name"));
             String token = AuthenticationFactory.createAndSaveToken(userMap);
             JSONObject paramOut = new JSONObject();
             paramOut.put("result", 0);

+ 71 - 0
docs/document/api/owner/appUserBindingOwner.md

@@ -0,0 +1,71 @@
+
+
+**1\. app用户绑定业主信息**
+###### 接口功能
+> 用户通过app用户绑定业主信息
+
+###### URL
+> [http://api.java110.com:8008/api/owner.appUserBindingOwner](http://api.java110.com:8008/api/owner.appUserBindingOwner)
+
+###### 支持格式
+> JSON
+
+###### HTTP请求方式
+> GET
+
+###### 请求参数(header部分)
+|参数名称|约束|类型|长度|描述|取值说明|
+| :-: | :-: | :-: | :-: | :-: | :-:|
+|app_id|1|String|30|应用ID|Api服务分配                      |
+|transaction_id|1|String|30|请求流水号|不能重复 1000000000+YYYYMMDDhhmmss+6位序列 |
+|sign|1|String|-|签名|请参考签名说明|
+|req_time|1|String|-|请求时间|YYYYMMDDhhmmss|
+|userId|1|String|30|用户ID|-|
+
+###### 请求参数
+|参数名称|约束|类型|长度|描述|取值说明|
+| :-: | :-: | :-: | :-: | :-: | :-: |
+|communityName|1|String|60|小区名称|-|
+|areaCode|1|String|12|地区编码|-|
+|appUserName|1|String|100|业主名称|-|
+|idCard|1|String|20|身份证号码|-|
+|link|1|String|11|手机号|-|
+|remark|?|String|200|备注|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+成功
+
+
+###### 举例
+> 地址:[http://api.java110.com:8008/api/owner.appUserBindingOwner](http://api.java110.com:8008/api/owner.appUserBindingOwner)
+
+``` javascript
+请求头信息:
+Content-Type:application/json
+USER_ID:1234
+APP_ID:8000418002
+TRANSACTION_ID:10029082726
+REQ_TIME:20181113225612
+SIGN:aabdncdhdbd878sbdudn898
+请求报文:
+
+{
+    "sex":"填写具体值",
+            "name":"填写具体值",
+            "link":"填写具体值",
+            "remark":"填写具体值",
+            "userId":"填写具体值",
+            "ownerTypeCd":"1001",
+            "age":"填写具体值"
+}
+
+返回报文:
+成功
+
+```

+ 10 - 0
java110-bean/src/main/java/com/java110/dto/owner/OwnerAppUserDto.java

@@ -27,6 +27,8 @@ public class OwnerAppUserDto extends PageDto implements Serializable {
     private String appTypeCd;
     private String memberId;
 
+    private String[] states;
+
 
     private Date createTime;
 
@@ -137,4 +139,12 @@ public class OwnerAppUserDto extends PageDto implements Serializable {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+    public String[] getStates() {
+        return states;
+    }
+
+    public void setStates(String[] states) {
+        this.states = states;
+    }
 }

+ 236 - 226
java110-db/src/main/resources/mapper/user/OwnerAppUserServiceDaoImplMapper.xml

@@ -5,257 +5,267 @@
 <mapper namespace="ownerAppUserServiceDaoImpl">
 
     <!-- 保存绑定业主信息 add by wuxw 2018-07-03 -->
-       <insert id="saveBusinessOwnerAppUserInfo" parameterType="Map">
-           insert into business_owner_app_user(
-id_card,open_id,link,remark,operate,app_user_name,community_name,state,app_user_id,community_id,app_type_cd,b_id,member_id
-) values (
-#{idCard},#{openId},#{link},#{remark},#{operate},#{appUserName},#{communityName},#{state},#{appUserId},#{communityId},#{appTypeCd},#{bId},#{memberId}
-)
-       </insert>
-
-
-       <!-- 查询绑定业主信息(Business) add by wuxw 2018-07-03 -->
-       <select id="getBusinessOwnerAppUserInfo" parameterType="Map" resultType="Map">
-           select  t.id_card,t.id_card idCard,t.open_id,t.open_id openId,t.link,t.remark,t.operate,t.app_user_name,t.app_user_name appUserName,t.community_name,t.community_name communityName,t.state,t.app_user_id,t.app_user_id appUserId,t.community_id,t.community_id communityId,t.app_type_cd,t.app_type_cd appTypeCd,t.b_id,t.b_id bId,t.member_id,t.member_id memberId 
-from business_owner_app_user t 
-where 1 =1 
-<if test="idCard !=null and idCard != ''">
-   and t.id_card= #{idCard}
-</if> 
-<if test="openId !=null and openId != ''">
-   and t.open_id= #{openId}
-</if> 
-<if test="link !=null and link != ''">
-   and t.link= #{link}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</if> 
-<if test="operate !=null and operate != ''">
-   and t.operate= #{operate}
-</if> 
-<if test="appUserName !=null and appUserName != ''">
-   and t.app_user_name= #{appUserName}
-</if> 
-<if test="communityName !=null and communityName != ''">
-   and t.community_name= #{communityName}
-</if> 
-<if test="state !=null and state != ''">
-   and t.state= #{state}
-</if> 
-<if test="appUserId !=null and appUserId != ''">
-   and t.app_user_id= #{appUserId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="appTypeCd !=null and appTypeCd != ''">
-   and t.app_type_cd= #{appTypeCd}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="memberId !=null and memberId != ''">
-   and t.member_id= #{memberId}
-</if> 
-
-       </select>
+    <insert id="saveBusinessOwnerAppUserInfo" parameterType="Map">
+        insert into business_owner_app_user(
+        id_card,open_id,link,remark,operate,app_user_name,community_name,state,app_user_id,community_id,app_type_cd,b_id,member_id
+        ) values (
+        #{idCard},#{openId},#{link},#{remark},#{operate},#{appUserName},#{communityName},#{state},#{appUserId},#{communityId},#{appTypeCd},#{bId},#{memberId}
+        )
+    </insert>
 
 
+    <!-- 查询绑定业主信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessOwnerAppUserInfo" parameterType="Map" resultType="Map">
+        select t.id_card,t.id_card idCard,t.open_id,t.open_id
+        openId,t.link,t.remark,t.operate,t.app_user_name,t.app_user_name appUserName,t.community_name,t.community_name
+        communityName,t.state,t.app_user_id,t.app_user_id appUserId,t.community_id,t.community_id
+        communityId,t.app_type_cd,t.app_type_cd appTypeCd,t.b_id,t.b_id bId,t.member_id,t.member_id memberId
+        from business_owner_app_user t
+        where 1 =1
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card= #{idCard}
+        </if>
+        <if test="openId !=null and openId != ''">
+            and t.open_id= #{openId}
+        </if>
+        <if test="link !=null and link != ''">
+            and t.link= #{link}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="operate !=null and operate != ''">
+            and t.operate= #{operate}
+        </if>
+        <if test="appUserName !=null and appUserName != ''">
+            and t.app_user_name= #{appUserName}
+        </if>
+        <if test="communityName !=null and communityName != ''">
+            and t.community_name= #{communityName}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="appUserId !=null and appUserId != ''">
+            and t.app_user_id= #{appUserId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="appTypeCd !=null and appTypeCd != ''">
+            and t.app_type_cd= #{appTypeCd}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="memberId !=null and memberId != ''">
+            and t.member_id= #{memberId}
+        </if>
 
+    </select>
 
 
     <!-- 保存绑定业主信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveOwnerAppUserInfoInstance" parameterType="Map">
         insert into owner_app_user(
-id_card,open_id,link,remark,status_cd,app_user_name,community_name,state,app_user_id,community_id,app_type_cd,b_id,member_id
-) select t.id_card,t.open_id,t.link,t.remark,'0',t.app_user_name,t.community_name,t.state,t.app_user_id,t.community_id,t.app_type_cd,t.b_id,t.member_id from business_owner_app_user t where 1=1
-<if test="idCard !=null and idCard != ''">
-   and t.id_card= #{idCard}
-</if> 
-<if test="openId !=null and openId != ''">
-   and t.open_id= #{openId}
-</if> 
-<if test="link !=null and link != ''">
-   and t.link= #{link}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</if> 
-   and t.operate= 'ADD'
-<if test="appUserName !=null and appUserName != ''">
-   and t.app_user_name= #{appUserName}
-</if> 
-<if test="communityName !=null and communityName != ''">
-   and t.community_name= #{communityName}
-</if> 
-<if test="state !=null and state != ''">
-   and t.state= #{state}
-</if> 
-<if test="appUserId !=null and appUserId != ''">
-   and t.app_user_id= #{appUserId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="appTypeCd !=null and appTypeCd != ''">
-   and t.app_type_cd= #{appTypeCd}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="memberId !=null and memberId != ''">
-   and t.member_id= #{memberId}
-</if> 
+        id_card,open_id,link,remark,status_cd,app_user_name,community_name,state,app_user_id,community_id,app_type_cd,b_id,member_id
+        ) select
+        t.id_card,t.open_id,t.link,t.remark,'0',t.app_user_name,t.community_name,t.state,t.app_user_id,t.community_id,t.app_type_cd,t.b_id,t.member_id
+        from business_owner_app_user t where 1=1
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card= #{idCard}
+        </if>
+        <if test="openId !=null and openId != ''">
+            and t.open_id= #{openId}
+        </if>
+        <if test="link !=null and link != ''">
+            and t.link= #{link}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        and t.operate= 'ADD'
+        <if test="appUserName !=null and appUserName != ''">
+            and t.app_user_name= #{appUserName}
+        </if>
+        <if test="communityName !=null and communityName != ''">
+            and t.community_name= #{communityName}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="appUserId !=null and appUserId != ''">
+            and t.app_user_id= #{appUserId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="appTypeCd !=null and appTypeCd != ''">
+            and t.app_type_cd= #{appTypeCd}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="memberId !=null and memberId != ''">
+            and t.member_id= #{memberId}
+        </if>
 
     </insert>
 
 
-
     <!-- 查询绑定业主信息 add by wuxw 2018-07-03 -->
     <select id="getOwnerAppUserInfo" parameterType="Map" resultType="Map">
-        select  t.id_card,t.id_card idCard,t.open_id,t.open_id openId,t.link,t.remark,t.status_cd,t.status_cd statusCd,t.app_user_name,t.app_user_name appUserName,t.community_name,t.community_name communityName,t.state,t.app_user_id,t.app_user_id appUserId,t.community_id,t.community_id communityId,t.app_type_cd,t.app_type_cd appTypeCd,t.b_id,t.b_id bId,t.member_id,t.member_id memberId 
-from owner_app_user t 
-where 1 =1 
-<if test="idCard !=null and idCard != ''">
-   and t.id_card= #{idCard}
-</if> 
-<if test="openId !=null and openId != ''">
-   and t.open_id= #{openId}
-</if> 
-<if test="link !=null and link != ''">
-   and t.link= #{link}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="appUserName !=null and appUserName != ''">
-   and t.app_user_name= #{appUserName}
-</if> 
-<if test="communityName !=null and communityName != ''">
-   and t.community_name= #{communityName}
-</if> 
-<if test="state !=null and state != ''">
-   and t.state= #{state}
-</if> 
-<if test="appUserId !=null and appUserId != ''">
-   and t.app_user_id= #{appUserId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="appTypeCd !=null and appTypeCd != ''">
-   and t.app_type_cd= #{appTypeCd}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="memberId !=null and memberId != ''">
-   and t.member_id= #{memberId}
-</if> 
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
-
-    </select>
+        select t.id_card,t.id_card idCard,t.open_id,t.open_id openId,t.link,t.remark,t.status_cd,t.status_cd
+        statusCd,t.app_user_name,t.app_user_name appUserName,t.community_name,t.community_name
+        communityName,t.state,t.app_user_id,t.app_user_id appUserId,t.community_id,t.community_id
+        communityId,t.app_type_cd,t.app_type_cd appTypeCd,t.b_id,t.b_id bId,t.member_id,t.member_id memberId
+        from owner_app_user t
+        where 1 =1
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card= #{idCard}
+        </if>
+        <if test="openId !=null and openId != ''">
+            and t.open_id= #{openId}
+        </if>
+        <if test="link !=null and link != ''">
+            and t.link= #{link}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="appUserName !=null and appUserName != ''">
+            and t.app_user_name= #{appUserName}
+        </if>
+        <if test="communityName !=null and communityName != ''">
+            and t.community_name= #{communityName}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="states !=null">
+            and t.state in
+            <foreach collection="states" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
 
+        <if test="appUserId !=null and appUserId != ''">
+            and t.app_user_id= #{appUserId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="appTypeCd !=null and appTypeCd != ''">
+            and t.app_type_cd= #{appTypeCd}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="memberId !=null and memberId != ''">
+            and t.member_id= #{memberId}
+        </if>
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
 
+    </select>
 
 
     <!-- 修改绑定业主信息 add by wuxw 2018-07-03 -->
     <update id="updateOwnerAppUserInfoInstance" parameterType="Map">
-        update  owner_app_user 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="openId !=null and openId != ''">
-, t.open_id= #{openId}
-</if> 
-<if test="link !=null and link != ''">
-, t.link= #{link}
-</if> 
-<if test="remark !=null and remark != ''">
-, t.remark= #{remark}
-</if> 
-<if test="appUserName !=null and appUserName != ''">
-, t.app_user_name= #{appUserName}
-</if> 
-<if test="communityName !=null and communityName != ''">
-, t.community_name= #{communityName}
-</if> 
-<if test="state !=null and state != ''">
-, t.state= #{state}
-</if> 
-<if test="communityId !=null and communityId != ''">
-, t.community_id= #{communityId}
-</if> 
-<if test="appTypeCd !=null and appTypeCd != ''">
-, t.app_type_cd= #{appTypeCd}
-</if> 
-<if test="memberId !=null and memberId != ''">
-, t.member_id= #{memberId}
-</if> 
- where 1=1 <if test="appUserId !=null and appUserId != ''">
-and t.app_user_id= #{appUserId}
-</if> 
-<if test="bId !=null and bId != ''">
-and t.b_id= #{bId}
-</if> 
+        update owner_app_user 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="openId !=null and openId != ''">
+            , t.open_id= #{openId}
+        </if>
+        <if test="link !=null and link != ''">
+            , t.link= #{link}
+        </if>
+        <if test="remark !=null and remark != ''">
+            , t.remark= #{remark}
+        </if>
+        <if test="appUserName !=null and appUserName != ''">
+            , t.app_user_name= #{appUserName}
+        </if>
+        <if test="communityName !=null and communityName != ''">
+            , t.community_name= #{communityName}
+        </if>
+        <if test="state !=null and state != ''">
+            , t.state= #{state}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="appTypeCd !=null and appTypeCd != ''">
+            , t.app_type_cd= #{appTypeCd}
+        </if>
+        <if test="memberId !=null and memberId != ''">
+            , t.member_id= #{memberId}
+        </if>
+        where 1=1
+        <if test="appUserId !=null and appUserId != ''">
+            and t.app_user_id= #{appUserId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
 
     </update>
 
     <!-- 查询绑定业主数量 add by wuxw 2018-07-03 -->
-     <select id="queryOwnerAppUsersCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from owner_app_user t 
-where 1 =1 
-<if test="idCard !=null and idCard != ''">
-   and t.id_card= #{idCard}
-</if> 
-<if test="openId !=null and openId != ''">
-   and t.open_id= #{openId}
-</if> 
-<if test="link !=null and link != ''">
-   and t.link= #{link}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="appUserName !=null and appUserName != ''">
-   and t.app_user_name= #{appUserName}
-</if> 
-<if test="communityName !=null and communityName != ''">
-   and t.community_name= #{communityName}
-</if> 
-<if test="state !=null and state != ''">
-   and t.state= #{state}
-</if> 
-<if test="appUserId !=null and appUserId != ''">
-   and t.app_user_id= #{appUserId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="appTypeCd !=null and appTypeCd != ''">
-   and t.app_type_cd= #{appTypeCd}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="memberId !=null and memberId != ''">
-   and t.member_id= #{memberId}
-</if> 
+    <select id="queryOwnerAppUsersCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from owner_app_user t
+        where 1 =1
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card= #{idCard}
+        </if>
+        <if test="openId !=null and openId != ''">
+            and t.open_id= #{openId}
+        </if>
+        <if test="link !=null and link != ''">
+            and t.link= #{link}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="appUserName !=null and appUserName != ''">
+            and t.app_user_name= #{appUserName}
+        </if>
+        <if test="communityName !=null and communityName != ''">
+            and t.community_name= #{communityName}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="appUserId !=null and appUserId != ''">
+            and t.app_user_id= #{appUserId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="appTypeCd !=null and appTypeCd != ''">
+            and t.app_type_cd= #{appTypeCd}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="memberId !=null and memberId != ''">
+            and t.member_id= #{memberId}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>