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
25
package com.boying.dao;
 
import com.boying.common.BaseDao;
import com.boying.entity.TicketBlack;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
 
import java.util.Date;
import java.util.List;
 
@Repository("ticketBlackDao")
public interface TicketBlackDao extends BaseDao<TicketBlack, Long>{
 
    @Query(nativeQuery = true,value = "update TicketBlack set blackType=1 where createTime<:dateLessMonth and status=0")
    void updateType(Date dateLessMonth);
 
    @Query(value = "select count(id) from TicketBlack where blackType=1")
    long count1();
 
    @Query(value = "select count(id) from TicketBlack where blackType=1 and createTime>:startTime and createTime<:endTime")
    long count2(Date startTime,Date endTime);
 
    @Query(value = "from TicketBlack where createTime<:dateLessMonth and status=0 and blackType=0")
    List<TicketBlack> findAll1(Date dateLessMonth);
}