package com.yeejoin.amos.maintenance.business.dao.repository;

import com.yeejoin.amos.maintenance.dao.entity.RoutePointItem;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface IRoutePointItemDao extends BaseDao<RoutePointItem, Long> {

    @Modifying
    @Transactional
    @Query(value = "delete from p_route_point_item WHERE route_point_id = ?1", nativeQuery = true)
    void delRoutePointItem(Long routePointId);

    @Modifying
    @Transactional
    @Query(value = "DELETE FROM p_route_point_item WHERE point_input_item_id IN (?1)", nativeQuery = true)
    void delRoutePointItemByItemId(List<Long> pItemIds);

    @Modifying
    @Transactional
    @Query(value = "delete from p_route_point_item WHERE id in (?1)", nativeQuery = true)
    void deleteByRoutePointItemId(List<Long> delRoutePointItemIds);
}
