Browse Source

解决ip验证字段不能添加进数据库bug

master
ssl 2 years ago
parent
commit
a47ee15647
  1. 5
      vote/src/main/java/com/votesystem/ssl/dao/ActivityDAO.java

5
vote/src/main/java/com/votesystem/ssl/dao/ActivityDAO.java

@ -57,8 +57,9 @@ public interface ActivityDAO extends JpaRepository<Activity,String>, JpaSpecific
//分页列出案例
@Query(value = " select * from tb_activity a where a.state = '2'",nativeQuery = true)
List<Activity> findByState(Pageable pageable);
//这个不对
@Query(value = "SELECT * FROM tb_activity WHERE state != '-1' ",nativeQuery = true)
//这个不对 sql上的author呢? 你没有,肯定查所有啊 这段就是我当时不会的那句 yy
@Query(value = "SELECT * FROM tb_activity WHERE state != '-1' and author = ?",nativeQuery = true)
Page<Activity> findAllByAuthor(String author ,Pageable pageable);

Loading…
Cancel
Save