|
@ -17,6 +17,10 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
|
|
|
@Query("select count(a) from Message a where a.type =1 and a.read= 1 and a.receiver=?1 ")
|
|
|
int amountUnreadByReceiver(String doctor);
|
|
|
|
|
|
@Query("select count(a) from Message a where a.read = 0 and over ='0' and a.receiver=?1 and a.type=3 ")
|
|
|
int amountUnreadSystemByReceiver(String doctor);
|
|
|
|
|
|
|
|
|
@Query("select a from Message a where a.type =1 and a.read= 1 and a.receiver=?1 order by a.czrq desc")
|
|
|
Page<Message> amountUnreadLastByReceiver(String doctor, Pageable pageRequest);
|
|
|
|
|
@ -24,7 +28,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
|
|
|
int amountUnreadHealthByReceiver(String doctor);
|
|
|
|
|
|
@Query("select a from Message a where (a.type =2 ) and a.read= 1 and a.receiver=?1 order by a.czrq desc")
|
|
|
Page<Message> amountUnreadHealthLastByReceiver(String doctor,Pageable pageRequest);
|
|
|
Page<Message> amountUnreadHealthLastByReceiver(String doctor, Pageable pageRequest);
|
|
|
|
|
|
@Modifying
|
|
|
@Query("update Message a set a.read = 0,a.over='0' where a.id = ?1")
|
|
@ -37,7 +41,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
|
|
|
Message findAllByParams(String sender, String receiver, String signStatus);
|
|
|
|
|
|
@Query(" from Message a where a.read = 1 and over ='1' and a.sender = ?1 and a.receiver=?2 and a.signStatus='1'")
|
|
|
Message findByPatient(String patient,String doctor);
|
|
|
Message findByPatient(String patient, String doctor);
|
|
|
|
|
|
@Query("select count(a) from Message a where a.read = 0 and over ='0' and a.receiver=?1 and a.type=?2 ")
|
|
|
int findMessageNum(String doctor, Integer type);
|