insert into business_workflow( skip_level,operate,describle,b_id,community_id,store_id,flow_id,flow_name,flow_type ) values ( #{skipLevel},#{operate},#{describle},#{bId},#{communityId},#{storeId},#{flowId},#{flowName},#{flowType} ) insert into workflow( skip_level,describle,status_cd,b_id,community_id,store_id,flow_id,flow_name,flow_type ) select t.skip_level,t.describle,'0',t.b_id,t.community_id,t.store_id,t.flow_id,t.flow_name,t.flow_type from business_workflow t where 1=1 and t.skip_level= #{skipLevel} and t.operate= 'ADD' and t.describle= #{describle} and t.b_id= #{bId} and t.community_id= #{communityId} and t.store_id= #{storeId} and t.flow_id= #{flowId} and t.flow_name= #{flowName} and t.flow_type= #{flowType} update workflow t set t.status_cd = #{statusCd} ,t.b_id = #{newBId} , t.skip_level= #{skipLevel} , t.describle= #{describle} , t.community_id= #{communityId} , t.store_id= #{storeId} , t.flow_name= #{flowName} , t.flow_type= #{flowType} where 1=1 and t.b_id= #{bId} and t.flow_id= #{flowId}