-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAgentRepo.java
More file actions
27 lines (20 loc) · 1009 Bytes
/
Copy pathAgentRepo.java
File metadata and controls
27 lines (20 loc) · 1009 Bytes
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
26
27
package deep.zero.repo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import deep.zero.bean.Agent;
import deep.zero.bean.Player;
@Repository
public interface AgentRepo extends JpaRepository<Agent, Long>{
//验证agent
@Query(value="select case when count(a)>0 then true else false end from Agent a where a.code=?1 and a.password=?2")
boolean validate(String code, String password);
//@Query(value="update Agent a set a.id=?1")
@Query(value="update Agent a set a.freezen=true where a.id=?1")
void setFreezen(Long id);
@Query(value="select a from Agent a where a.code=?1")
Agent getByCode(String code);
//@Modifying(clearAutomatically = true)
//@Query("update RssFeedEntry feedEntry set feedEntry.read =:isRead where feedEntry.id =:entryId")
//void markEntryAsRead(@Param("entryId") Long rssFeedEntryId, @Param("isRead") boolean isRead);
}