用户列表 按注册时间倒叙

This commit is contained in:
2024-05-17 15:34:03 +08:00
parent c8756d1104
commit 7701f0423f

View File

@@ -42,7 +42,8 @@ public interface TbShopUserRepository extends JpaRepository<TbShopUser, Integer>
"on su.userId = CAST(u.id AS string) " +
"WHERE su.isVip = IFNULL(:isVip, su.isVip)" +
"AND (u.telephone = IFNULL(:phone, u.telephone))" +
"AND su.shopId = :shopId")
"AND su.shopId = :shopId " +
"order by su.createdAt desc ")
Page<ShopUserInfoVo> findShopUserJoinUserInfo(String shopId,Integer isVip,String phone, Pageable pageable);
@Query("SELECT NEW cn.ysk.cashier.vo.ShopUserInfoVo(su.id, u.headImg, u.nickName, u.sex, u.amount, u.totalScore, u.telephone, u.birthDay, u.isVip, su.createdAt, u.lastLogInAt) " +
@@ -50,7 +51,8 @@ public interface TbShopUserRepository extends JpaRepository<TbShopUser, Integer>
"LEFT JOIN TbUserInfo u " +
"on su.userId = CAST(u.id AS string) " +
"WHERE su.isVip = IFNULL(:isVip, su.isVip)" +
"AND (u.telephone = IFNULL(:phone, u.telephone))")
"AND (u.telephone = IFNULL(:phone, u.telephone))" +
"order by su.createdAt desc ")
Page<ShopUserInfoVo> findAllShopUserJoinUserInfo(Integer isVip,String phone, Pageable pageable);
@Query("SELECT count(0) from TbShopUser user where user.shopId = :shopId")