insert into business_advert( classify,ad_name,location_type_cd,ad_type_cd,advert_id,operate,start_time,state,end_time,community_id,b_id,location_obj_id,seq ) values ( #{classify},#{adName},#{locationTypeCd},#{adTypeCd},#{advertId},#{operate},#{startTime},#{state},#{endTime},#{communityId},#{bId},#{locationObjId},#{seq} ) insert into advert( classify,ad_name,location_type_cd,status_cd,ad_type_cd,advert_id,start_time,state,end_time,community_id,b_id,location_obj_id,seq ) select t.classify,t.ad_name,t.location_type_cd,'0',t.ad_type_cd,t.advert_id,t.start_time,t.state,t.end_time,t.community_id,t.b_id,t.location_obj_id,t.seq from business_advert t where 1=1 and t.classify= #{classify} and t.ad_name= #{adName} and t.location_type_cd= #{locationTypeCd} and t.ad_type_cd= #{adTypeCd} and t.advert_id= #{advertId} and t.operate= 'ADD' and t.start_time= #{startTime} and t.state= #{state} and t.end_time= #{endTime} and t.community_id= #{communityId} and t.b_id= #{bId} and t.location_obj_id= #{locationObjId} and t.seq= #{seq} update advert t set t.status_cd = #{statusCd} ,t.b_id = #{newBId} , t.classify= #{classify} , t.ad_name= #{adName} , t.location_type_cd= #{locationTypeCd} , t.ad_type_cd= #{adTypeCd} , t.start_time= #{startTime} , t.state= #{state} , t.end_time= #{endTime} , t.community_id= #{communityId} , t.location_obj_id= #{locationObjId} , t.seq= #{seq} where 1=1 and t.advert_id= #{advertId} and t.b_id= #{bId}