完成Register && Gird
This commit is contained in:
@@ -19,9 +19,9 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface BookRepo extends JpaRepository<Book, Long> {
|
||||
|
||||
List<Book> findByUserId(long userId);
|
||||
List<Book> findByUserIdOrderByCreateTimeDesc(long userId);
|
||||
|
||||
@Modifying
|
||||
@Modifying(clearAutomatically = true)
|
||||
@Query(value = "update t_bill_books set total_amount = (select sum(amount) from t_bill_items where book_id = ?1) where id = ?1",nativeQuery = true)
|
||||
void sumAmount(long bookId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user