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 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 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} 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.community_id= #{communityId} , t.app_type_cd= #{appTypeCd} , t.member_id= #{memberId} where 1=1 and t.app_user_id= #{appUserId} and t.b_id= #{bId}