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