insert into business_inspection_route_point_rel(
inspection_id,operate,inspection_route_id,irp_rel_id,community_id,b_id
) values (
#{inspectionId},#{operate},#{inspectionRouteId},#{irpRelId},#{communityId},#{bId}
)
insert into inspection_route_point_rel(
inspection_id,inspection_route_id,irp_rel_id,status_cd,community_id,b_id
) select t.inspection_id,t.inspection_route_id,t.irp_rel_id,'0',t.community_id,t.b_id from
business_inspection_route_point_rel t where 1=1
and t.inspection_id= #{inspectionId}
and t.operate= 'ADD'
and t.inspection_route_id= #{inspectionRouteId}
and t.irp_rel_id= #{irpRelId}
and t.community_id= #{communityId}
and t.b_id= #{bId}
update inspection_route_point_rel t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.inspection_id= #{inspectionId}
, t.inspection_route_id= #{inspectionRouteId}
, t.community_id= #{communityId}
where 1=1
and t.irp_rel_id= #{irpRelId}
and t.b_id= #{bId}