package cn.van.business.repository;

import cn.van.business.model.wx.WxUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;
import java.util.Optional;

@Repository
public interface WxUserRepository extends JpaRepository<WxUser, Integer> {

    // Find users by their wxid
    Optional<WxUser> findByWxid(String wxid);

    // Find users by their name
    List<WxUser> findByName(String name);

    // Find users by status
    List<WxUser> findByStatus(Integer status);

    // Optional: Find users by the range of total accumulated money
    List<WxUser> findByMoneyLeijiBetween(BigDecimal min, BigDecimal max);

    // Optional: Find users by the remaining money
    List<WxUser> findByMoneyShengyuLessThanEqual(BigDecimal amount);

    // Add more customized queries as needed based on your application requirements
}
