insert into
business_store_attr(attr_id,operate,spec_cd,store_id,b_id,value,month)
values (#{attrId},#{operate},#{specCd},#{storeId},#{bId},#{value},#{month})
insert into s_store_attr(
attr_id,create_time,spec_cd,status_cd,store_id,bId,value
) select t.attr_id,t.create_time,t.spec_cd,'0',t.store_id,t.bId,t.value from business_store_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.store_id= #{storeId}
and t.bId= #{bId}
and t.value= #{value}
insert into
s_store_attr(attr_id,spec_cd,store_id,b_id,value)
values (#{attrId},#{specCd},#{storeId},'-1',#{value})
update s_store_attr t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.spec_cd= #{specCd}
, t.store_id= #{storeId}
, t.value= #{value}
where 1=1
and t.attr_id= #{attrId}
and t.bId= #{bId}