package com.ssj.dao.sys.fx.dao;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.ssj.bean.sys.fx.domain.Device;
import com.ssj.bean.sys.fx.domain.DeviceParts;

@Repository
public interface DevicePartsDao extends JpaRepository<DeviceParts, String> {
	
	public Page<DeviceParts> findAll(Specification<Device> specification, Pageable page);
	
	
	@Query(nativeQuery = true, value = " SELECT * from fx_device_parts t where t.parts_id=?1 and t.pos_code=?2 LIMIT 1 ")
	public DeviceParts getDevicePartsByPartsId(String partsId, String posCode);
	
}