insert into business_building_owner(operate, sex, name, link, remark, owner_id, b_id, user_id, age, member_id,
owner_type_cd, community_id, id_card, state, owner_flag, address)
values (#{operate}, #{sex}, #{name}, #{link}, #{remark}, #{ownerId}, #{bId}, #{userId}, #{age}, #{memberId},
#{ownerTypeCd}, #{communityId}, #{idCard}, #{state}, #{ownerFlag}, #{address})
insert into building_owner(
sex,name,link,status_cd,remark,owner_id,b_id,user_id,age,member_id,owner_type_cd,community_id,id_card,state,owner_flag,address
) select t.sex,t.name,t.link,'0',t.remark,t.owner_id,t.b_id,t.user_id,t.age,t.member_id,t.owner_type_cd,
t.community_id communityId,t.id_card,state,t.owner_flag,t.address
from business_building_owner t where 1=1
and t.operate= 'ADD'
and t.sex= #{sex}
and t.name= #{name}
and t.link= #{link}
and t.remark= #{remark}
and t.owner_id= #{ownerId}
and t.community_id= #{communityId}
and t.id_card = #{idCard}
and t.b_id= #{bId}
and t.user_id= #{userId}
and t.age= #{age}
and t.member_id= #{memberId}
and t.owner_type_cd= #{ownerTypeCd}
and t.state= #{state}
and t.address= #{address}
update building_owner t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.sex= #{sex}
, t.name= #{name}
, t.link= #{link}
, t.address= #{address}
, t.remark= #{remark}
, t.owner_id= #{ownerId}
, t.user_id= #{userId}
, t.age= #{age}
, t.state= #{state}
, t.id_card = #{idCard}
where 1=1
and t.b_id= #{bId}
and t.community_id= #{communityId}
and t.member_id= #{memberId}