package com.sw.mes.yb.deviceCheck.dao;

import com.sw.mes.core.base.BaseDao;
import com.sw.mes.yb.deviceCheck.entity.SpotCheckItem;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SpotCheckItemDAO extends BaseDao<SpotCheckItem, Long> {

    @Query(value = "SELECT * FROM zhxx_operate_spot_check_item WHERE parent_id=?1 ", nativeQuery = true)
    List<SpotCheckItem> findByParentId(Integer parentId);

    @Query(value = "SELECT * FROM zhxx_operate_spot_check_item ORDER BY priority ASC ", nativeQuery = true)
    List<SpotCheckItem> findAllOrderByPriority();

    void deleteByParentId(Integer parentId);
}
