insert into business_org_community(
org_name,operate,community_name,community_id,store_id,b_id,org_id,org_community_id
) values (
#{orgName},#{operate},#{communityName},#{communityId},#{storeId},#{bId},#{orgId},#{orgCommunityId}
)
insert into u_org_community(
org_name,community_name,status_cd,community_id,store_id,b_id,org_id,org_community_id
) select t.org_name,t.community_name,'0',t.community_id,t.store_id,t.b_id,t.org_id,t.org_community_id from business_org_community t where 1=1
and t.org_name= #{orgName}
and t.operate= 'ADD'
and t.community_name= #{communityName}
and t.community_id= #{communityId}
and t.store_id= #{storeId}
and t.b_id= #{bId}
and t.org_id= #{orgId}
and t.org_community_id= #{orgCommunityId}
update u_org_community t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.org_name= #{orgName}
, t.community_name= #{communityName}
, t.community_id= #{communityId}
, t.store_id= #{storeId}
, t.org_id= #{orgId}
where 1=1
and t.b_id= #{bId}
and t.org_community_id= #{orgCommunityId}