public interface FactoryExtDao{
List<BenchmarkingFactoryDto> getBenchmarkingFactory(List factoryIds);
}
public class FactoryExtDaoImpl implements FactoryExtDao {
@Autowired
EntityManager entityManager;
@Override
public List<BenchmarkingFactoryDto> getBenchmarkingFactory(List factoryIds) {
String jql = "select f.id factoryId,f.name factoryName, fd.device_id factoryDeviceId, f.max_cod MaxCOD, " +
"f.daily_handling_capacity dailyHandlingCapacity from factory f, factory_device fd where " +
"f.id = fd.factory_id and f.id in :factoryIds";
if (CollectionUtils.isEmpty(factoryIds)) {
return Lists.newArrayList();
}
Query query = entityManager.createNativeQuery(jql);
query.setParameter("factoryIds", factoryIds);
query.unwrap(S