提交 f6fcf31f authored 作者: Whispa's avatar Whispa

commit

上级 2b470c0c
...@@ -49,13 +49,13 @@ public class BonusController extends Controller { ...@@ -49,13 +49,13 @@ public class BonusController extends Controller {
@GetMapping(value = "/list/bonus/{userId}") @GetMapping(value = "/list/bonus/{userId}")
//@PreAuthorize("hasAuthority('ADMIN_USER') or hasAuthority('STANDARD_USER')") //@PreAuthorize("hasAuthority('ADMIN_USER') or hasAuthority('STANDARD_USER')")
public List<Bonus> getListByUser(@PathVariable("userId") String id, @RequestParam(value = "pageNo") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize) { public List<Bonus> getListByUser(@PathVariable("userId") String id, @RequestParam(value = "pageNo") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize) {
return repository.findAllByUserInfo_UserIdOrderByIdDesc(id, PageRequest.of(pageNo, pageSize)).toList(); return repository.findAllByUserInfo_UserIdOrderByCreateDateDesc(id, PageRequest.of(pageNo, pageSize)).toList();
} }
@GetMapping(value = "/list") @GetMapping(value = "/list")
//@PreAuthorize("hasAuthority('ADMIN_USER') or hasAuthority('STANDARD_USER')") //@PreAuthorize("hasAuthority('ADMIN_USER') or hasAuthority('STANDARD_USER')")
public List<Bonus> getListByUser(@RequestParam(value = "pageNo") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize) { public List<Bonus> getListByUser(@RequestParam(value = "pageNo") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize) {
return repository.findAllByUserInfo_UserIdOrderByIdDesc(user.userId(), PageRequest.of(pageNo, pageSize)).toList(); return repository.findAllByUserInfo_UserIdOrderByCreateDateDesc(user.userId(), PageRequest.of(pageNo, pageSize)).toList();
} }
@GetMapping(value = "/list/currentMonth") @GetMapping(value = "/list/currentMonth")
......
...@@ -11,10 +11,10 @@ import org.springframework.data.repository.query.Param; ...@@ -11,10 +11,10 @@ import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
public interface BonusRepository extends JpaRepository<Bonus,String> { public interface BonusRepository extends JpaRepository<Bonus,String> {
Page<Bonus> findAllByUserInfo_UserIdOrderByIdDesc(String id, Pageable pageable); Page<Bonus> findAllByUserInfo_UserIdOrderByCreateDateDesc(String id, Pageable pageable);
@Query(value = "select a from #{#entityName} a WHERE month(a.createDate) = :month and year(a.createDate) = :year and a.userInfo=:id order by a.id desc") @Query(value = "select a from #{#entityName} a WHERE month(a.createDate) = :month and year(a.createDate) = :year and a.userInfo=:id order by a.createDate desc")
Page<Bonus> findAllByUser_IdAndCreateDateMonthAndCreateDateYear(TbCfUserInfo id, int month, int year, Pageable pageable); Page<Bonus> findAllByUser_IdAndCreateDateMonthAndCreateDateYear(TbCfUserInfo id, int month, int year, Pageable pageable);
@Query(value = "select a from #{#entityName} a WHERE dayofyear(a.createDate) = :day and year(a.createDate) = :year and a.userInfo=:id order by a.id desc") @Query(value = "select a from #{#entityName} a WHERE dayofyear(a.createDate) = :day and year(a.createDate) = :year and a.userInfo=:id order by a.createDate desc")
Page<Bonus> findAllByUser_IdAndCreateDate(TbCfUserInfo id, int day, int year, Pageable pageable); Page<Bonus> findAllByUser_IdAndCreateDate(TbCfUserInfo id, int day, int year, Pageable pageable);
Page<Bonus> findAllByUserInfo_UserIdAndWithdraw(String id, boolean withdraw, Pageable pageable); Page<Bonus> findAllByUserInfo_UserIdAndWithdraw(String id, boolean withdraw, Pageable pageable);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论