package com.ssj.dao.conch.conch.dao;

import com.ssj.bean.conch.conch.domain.SconOtaManager;
import com.ssj.service.conch.conch.request.AddSconOtaManagerRequest;
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.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/** 
 * @author  ZhangCaibao 
 * @version 2018年4月11日 下午3:34:38 
 * 类说明   小塾数据访问接口
 */
@Repository
public interface SconOtaManagerDao extends JpaRepository<SconOtaManager, String> {

    @Query(nativeQuery = true, value = "select * from scon_ota_manager s where s.current_version = ?1 and s.is_using=1 and s.is_delete = 0 ")
    public SconOtaManager findByCurrentVersion(String currentVersion);

    Page<SconOtaManager> findAll(Specification<SconOtaManager> specification, Pageable page);
}