package com.boying.dao; import com.boying.common.BaseDao; import com.boying.entity.EnterPark; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import java.util.Date; @Repository("enterParkDao") public interface EnterParkDao extends BaseDao{ @Query(value = "select count(id) from EnterPark where createTime>:startTime and createTime<:endTime") long count1(Date startTime, Date endTime); @Query(value = "from EnterPark where carNo=:carNo and id = (select max(id) from EnterPark)") EnterPark findByCarNo(String carNo); @Modifying @Query(value = "delete from EnterPark where carNo=:carNo and parkId=:parkId") void deleteByCarNo(String carNo,Long parkId); }