insert into business_inspection_route(
operate,inspection_routeId,check_quantity,machine_quantity,remark,community_id,b_id,Route_name
) values (
#{operate},#{inspectionRouteId},#{checkQuantity},#{machineQuantity},#{remark},#{communityId},#{bId},#{routeName}
)
insert into inspection_route(
inspection_routeId,check_quantity,machine_quantity,remark,status_cd,community_id,b_id,Route_name
) select
t.inspection_route_Id,t.check_quantity,t.machine_quantity,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.check_quantity= #{checkQuantity}
and t.machine_quantity= #{machineQuantity}
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.check_quantity= #{checkQuantity}
, t.machine_quantity= #{machineQuantity}
, 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}