Commit 6f873d3f authored by lisong's avatar lisong

添加删除路线已经绑定的点接口

parent f6ae1d35
......@@ -870,6 +870,26 @@ public class RouteController extends AbstractBaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "删除线路点", notes = "删除线路点")
@PostMapping(value = "/delRoutePoint", produces = "application/json;charset=UTF-8")
public CommonResponse delRoutePoint( @RequestParam("pointIds") List<Long> pointIds,
@RequestParam("routeId") String routeId) {
try {
for (Long pointId : pointIds) {
// 删除点的检查项
routePointItemMapper.delRoutePointItem(routeId, pointId);
// 删除路线绑定点关系
routePointItemMapper.delRoutePoint(routeId, pointId);
}
return CommonResponseUtil.success();
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure("删除线路点失败");
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询企业类型", notes = "查询企业类型")
@GetMapping(value = "/getEnterpriseType", produces = "application/json;charset=UTF-8")
public CommonResponse getEnterpriseType() {
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.patrol.business.dao.mapper;
import com.yeejoin.amos.patrol.dao.entity.RoutePointItem;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
......@@ -13,6 +14,9 @@ public interface RoutePointItemMapper extends BaseMapper {
int delRoutePointItemByRouteId(Long routeId);
int delRoutePointItemByPointId(Long pointId);
int delRoutePointItem(@Param("routeId") String routeId, @Param("pointId") Long pointId);
int delRoutePoint(@Param("routeId") String routeId, @Param("pointId") Long pointId);
public void insertRoutePointItem(RoutePointItem pointItem);
/**
......
......@@ -58,6 +58,23 @@
point_id = #{pointId}
)
</delete>
<delete id="delRoutePointItem">
DELETE
FROM
p_route_point_item
WHERE
route_point_id IN (
SELECT
id
FROM
p_route_point prp
WHERE
point_id = #{pointId} and route_id = #{routeId}
)
</delete>
<delete id="delRoutePoint">
delete from p_route_point WHERE point_id = #{pointId} and route_id = #{routeId}
</delete>
<insert id="insertRoutePointItem">
insert into p_route_point_item
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment