PersonnelRepository.java 692 Bytes
package com.bsth.repository;

import java.util.List;

import com.bsth.entity.Personnel;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * Created by xu on 16/6/15.
 */
@Repository
public interface PersonnelRepository extends BaseRepository<Personnel, Integer> {
	
	@Query(value="select s from Personnel s where s.id in(select e.jsy.id from EmployeeConfigInfo e where e.xl.id = ?1) ")
	List<Personnel> findJsysByLineId(Integer lineId);
	
	@Query(value="select s from Personnel s where s.id in(select e.spy.id from EmployeeConfigInfo e where e.xl.id = ?1) ")
	List<Personnel> findSpysByLineId(Integer lineId);
}