package com.tykj.dev.device.packing.repository;

import com.tykj.dev.device.packing.subject.domin.PackingLibrary;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * @author dengdiyi
 */
public interface PackingLibraryDao extends JpaRepository<PackingLibrary, Integer>, JpaSpecificationExecutor<PackingLibrary> {

    List<PackingLibrary> findAllByPartParentId(Integer id);

    List<PackingLibrary> findAllByPartParentIdAndPackingStatus(Integer id,Integer packingId);

    List<PackingLibrary> findAllByIdIn(List<Integer> ids);

    PackingLibrary findByShowOrder(Integer showOrder);

    List<PackingLibrary> findAllByIsRootAndPackingStatus(Integer isRoot,Integer packingStatus);

    List<PackingLibrary> findAllByPartParentIdAndMatchingRangeAndPackingStatusAndName(Integer partParentId,Integer matchingRange,Integer packingStatus,String name);

    List<PackingLibrary> findAllByDeleteTag(Integer deleteTag);
}
