insert into business_building_owner_attr(
attr_id,operate,create_time,spec_cd,b_id,community_id,value,member_id
) values (
#{attrId},#{operate},#{createTime},#{specCd},#{bId},#{communityId},#{value},#{memberId}
)
insert into building_owner_attr(
attr_id,create_time,spec_cd,status_cd,b_id,community_id,value,member_id
) select t.attr_id,t.create_time,t.spec_cd,'0',t.b_id,t.community_id,t.value,t.member_id from
business_building_owner_attr t where 1=1
and t.attr_id= #{attrId}
and t.operate= 'ADD'
and t.create_time= #{createTime}
and t.spec_cd= #{specCd}
and t.b_id= #{bId}
and t.community_id= #{communityId}
and t.value= #{value}
and t.member_id= #{memberId}
update building_owner_attr t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.create_time= #{createTime}
, t.spec_cd= #{specCd}
, t.community_id= #{communityId}
, t.value= #{value}
, t.member_id= #{memberId}
where 1=1
and t.attr_id= #{attrId}
and t.b_id= #{bId}