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,user_id,app_type,nickname,headimgurl ) values ( #{idCard},#{openId},#{link},#{remark},#{operate},#{appUserName},#{communityName},#{state},#{appUserId},#{communityId}, #{appTypeCd},#{bId},#{memberId},#{userId},#{appType},#{nickName},#{headImgUrl} ) 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,user_id, app_type,nickname,headimgurl ) 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,t.user_id,t.app_type,t.nickname,t.headimgurl from business_owner_app_user t where 1=1 and t.id_card= #{idCard} and t.open_id= #{openId} and t.link= #{link} and t.remark= #{remark} and t.operate= 'ADD' and t.app_user_name= #{appUserName} and t.community_name= #{communityName} and t.state= #{state} and t.app_user_id= #{appUserId} and t.community_id= #{communityId} and t.app_type_cd= #{appTypeCd} and t.b_id= #{bId} and t.member_id= #{memberId} and t.user_id= #{userId} and t.nickname= #{nickName} and t.headimgurl= #{headImgUrl} update owner_app_user t set t.status_cd = #{statusCd} ,t.b_id = #{newBId} , t.id_card= #{idCard} , t.open_id= #{openId} , t.link= #{link} , t.remark= #{remark} , t.app_user_name= #{appUserName} , t.community_name= #{communityName} , t.state= #{state} , t.app_type_cd= #{appTypeCd} , t.member_id= #{memberId} , t.user_id= #{userId} , t.app_type = #{appType} , t.nickname= #{nickName} , t.headimgurl= #{headImgUrl} where 1=1 and t.app_user_id= #{appUserId} and t.member_id= #{memberId} and t.community_id= #{communityId} and t.b_id= #{bId}