Skip to content

Commit

Permalink
fix the sql
Browse files Browse the repository at this point in the history
  • Loading branch information
liberhe committed Dec 25, 2023
1 parent e112e9a commit de670e2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ public interface RedPacketRepository extends JpaRepository<RedPacket, String>,
List<RedPacket> findByClaimedPacket(@Param("address") String address, @Param("chainId") String chainId);


@Query(value = "select * from red_packet where address_list like ?1 and claimed_address not like ?1 and expire_time < UNIX_TIMESTAMP(current_timestamp()) and chain_id = ?2) ", nativeQuery = true)
@Query(value = "select * from red_packet where address_list like ?1 and claimed_address not like ?1 and expire_time < UNIX_TIMESTAMP(current_timestamp()) and chain_id = ?2 ", nativeQuery = true)
List<RedPacket> findByUnclaimedTimeOutPacket(@Param("address") String address, @Param("chainId") String chainId );

// @Query(value = "select * from red_packet where address_list like ?1 and claimed_address not like ?1 and status = ?2 and expire_time > UNIX_TIMESTAMP(current_timestamp()) ", nativeQuery = true)
@Query(value = "select * from red_packet where address_list like ?1 and claimed_address not like ?1 and status = ?2 and expire_time > UNIX_TIMESTAMP(current_timestamp()) and chain_id = ?3) ", nativeQuery = true)
@Query(value = "select * from red_packet where address_list like ?1 and claimed_address not like ?1 and status = ?2 and expire_time > UNIX_TIMESTAMP(current_timestamp()) and chain_id = ?3 ", nativeQuery = true)
List<RedPacket> findByUnclaimedPacket(@Param("address") String address, @Param("status") Integer status, @Param("chainId") String chainId);


Expand Down

0 comments on commit de670e2

Please sign in to comment.