insert into business_workflow_step(
operate,step_id,b_id,type,community_id,store_id,flow_id,seq
) values (
#{operate},#{stepId},#{bId},#{type},#{communityId},#{storeId},#{flowId},#{seq}
)
insert into workflow_step(
step_id,status_cd,b_id,type,community_id,store_id,flow_id,seq
) select t.step_id,'0',t.b_id,t.type,t.community_id,t.store_id,t.flow_id,t.seq from business_workflow_step t
where 1=1
and t.operate= 'ADD'
and t.step_id= #{stepId}
and t.b_id= #{bId}
and t.type= #{type}
and t.community_id= #{communityId}
and t.store_id= #{storeId}
and t.flow_id= #{flowId}
and t.seq= #{seq}
update workflow_step t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.step_id= #{stepId}
, t.type= #{type}
, t.community_id= #{communityId}
, t.store_id= #{storeId}
, t.seq= #{seq}
where 1=1
and t.b_id= #{bId}
and t.flow_id= #{flowId}