package cn.com.liandisys.ycjt.ggcx.publicBicycleSat.dao;

import java.util.List;

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.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import cn.com.liandisys.ycjt.ggcx.publicBicycleSat.model.PublicBicycleSatEntity;
import cn.com.liandisys.ycjt.ggcx.publicBicycleSat.vo.PublicBicycleSatVo;

public interface PublicBicycleSatDao
        extends JpaRepository<PublicBicycleSatEntity, String>, JpaSpecificationExecutor<PublicBicycleSatEntity> {

    public Page<PublicBicycleSatEntity> findAll(Specification<PublicBicycleSatEntity> spec, Pageable pageable);

    @Query("select sum(capacity) as capacity,sum(availbleBike) as availbleBike from PublicBicycleSatEntity a")
    public List<PublicBicycleSatVo> getStatisticInfo();

    public List<PublicBicycleSatEntity> findAll();

}