insert into business_inspection_route(
operate,inspection_route_id,seq,remark,community_id,b_id,route_name
) values (
#{operate},#{inspectionRouteId},#{seq},#{remark},#{communityId},#{bId},#{routeName}
)
insert into inspection_route(
inspection_route_id,seq,remark,status_cd,community_id,b_id,route_name
) select
t.inspection_route_id,t.seq,t.remark,'0',t.community_id,t.b_id,t.route_name from
business_inspection_route t where 1=1
and t.operate= 'ADD'
and t.inspection_route_id= #{inspectionRouteId}
and t.seq= #{seq}
and t.remark= #{remark}
and t.community_id= #{communityId}
and t.b_id= #{bId}
and t.route_name= #{routeName}
update inspection_route t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.seq= #{seq}
, t.remark= #{remark}
, t.community_id= #{communityId}
, t.route_name= #{routeName}
where 1=1
and t.inspection_route_id= #{inspectionRouteId}
and t.b_id= #{bId}