kongdeqiang
2022-09-19 a9862e81851bbe037edc6bb1c7f562c1e55c0d7f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;
import java.util.List;
 
@Repository("enterParkDao")
public interface EnterParkDao extends BaseDao<EnterPark, Long>{
 
    @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 order by  createTime desc")
    List<EnterPark> findByCarNo(String carNo);
 
    @Modifying
    @Query(value = "delete from EnterPark where carNo=:carNo and parkId=:parkId")
    void deleteByCarNo(String carNo,Long parkId);
}