insert into business_inspection_route_point_rel(
inspection_id,operate,inspection_route_id,irp_rel_id,community_id,b_id,point_start_time,point_end_time,sort_number
) values (
#{inspectionId},#{operate},#{inspectionRouteId},#{irpRelId},#{communityId},#{bId},#{pointStartTime},#{pointEndTime},#{sortNumber}
)
insert into inspection_route_point_rel(
inspection_id,inspection_route_id,irp_rel_id,status_cd,community_id,b_id,point_start_time,point_end_time,sort_number
) select t.inspection_id,t.inspection_route_id,t.irp_rel_id,'0',t.community_id,t.b_id,t.point_start_time,t.point_end_time,t.sort_number 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}
, t.point_start_time= #{pointStartTime}
, t.point_end_time= #{pointEndTime}
, t.sort_number= #{sortNumber}
where 1=1
and t.irp_rel_id= #{irpRelId}
and t.b_id= #{bId}