package com.YuyeTech.TPlat.service.impl;

import com.YuyeTech.TPlat.dataobject.FcCategoryReference;
import com.YuyeTech.TPlat.dataobject.FcInfo;
import com.YuyeTech.TPlat.dataobject.OtaInfo;
import com.YuyeTech.TPlat.dto.FcDTO;
import com.YuyeTech.TPlat.repository.FcCategoryReferenceRepository;
import com.YuyeTech.TPlat.repository.FcInfoRepository;
import com.YuyeTech.TPlat.repository.OtaInfoRepository;
import com.YuyeTech.TPlat.service.FavoritesService;
import com.YuyeTech.TPlat.service.FcInfoService;
import com.YuyeTech.TPlat.service.OtaInfoService;
import com.YuyeTech.TPlat.utils.AliyunOSSUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;

import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author:slambb
 * @date:2020/1/10
 */
@Service
public class OtaInfoServiceImpl implements OtaInfoService {
    @Autowired
    private OtaInfoRepository otaInfoRepository;

    @Override
    public OtaInfo findOTAByBLETypeAndStatus(Integer bleType, Integer otaStatus) {
        return otaInfoRepository.findByBleTypeAndOtaStatus(bleType,otaStatus).orElse(null);
    }
}
