|
@@ -12,16 +12,16 @@ public interface UserPointsRecordMapper extends BaseMapper<UserPointsRecord> {
|
|
|
@Update("update user set active_points = active_points + #{points} where id = #{userId}")
|
|
@Update("update user set active_points = active_points + #{points} where id = #{userId}")
|
|
|
void updateUserPoints(@Param("userId") Long userId, @Param("points") Integer points);
|
|
void updateUserPoints(@Param("userId") Long userId, @Param("points") Integer points);
|
|
|
|
|
|
|
|
- @Select("select sum(points) from user_points_record ur where created_time between #{yesZeroDate} and #{thisZeroDate} and points > 0")
|
|
|
|
|
|
|
+ @Select("select ifnull(sum(points),0) from user_points_record ur where created_time between #{yesZeroDate} and #{thisZeroDate} and points > 0")
|
|
|
Integer getTodayNumOfPoints(@Param("yesZeroDate") Date yesZeroDate, @Param("thisZeroDate") Date thisZeroDate);
|
|
Integer getTodayNumOfPoints(@Param("yesZeroDate") Date yesZeroDate, @Param("thisZeroDate") Date thisZeroDate);
|
|
|
|
|
|
|
|
- @Select("select sum(points) from user_points_record ur where points > 0")
|
|
|
|
|
|
|
+ @Select("select ifnull(sum(points),0) from user_points_record ur where points > 0")
|
|
|
Integer getSumOfPoints();
|
|
Integer getSumOfPoints();
|
|
|
|
|
|
|
|
- @Select("select sum(points) from user_points_record ur where created_time between #{yesZeroDate} and #{thisZeroDate} and points < 0")
|
|
|
|
|
|
|
+ @Select("select ifnull(sum(points),0) from user_points_record ur where created_time between #{yesZeroDate} and #{thisZeroDate} and points < 0")
|
|
|
Integer getTodayUseOfPoints(@Param("yesZeroDate") Date yesZeroDate, @Param("thisZeroDate") Date thisZeroDate);
|
|
Integer getTodayUseOfPoints(@Param("yesZeroDate") Date yesZeroDate, @Param("thisZeroDate") Date thisZeroDate);
|
|
|
|
|
|
|
|
- @Select("select sum(points) from user_points_record ur where points < 0")
|
|
|
|
|
|
|
+ @Select("select ifnull(sum(points),0) from user_points_record ur where points < 0")
|
|
|
Integer getSumUseOfPoints();
|
|
Integer getSumUseOfPoints();
|
|
|
|
|
|
|
|
@Select("select count(*) from user_points_record ur where created_time between #{yesZeroDate} and #{thisZeroDate} and points < 0 and remark = #{remark}")
|
|
@Select("select count(*) from user_points_record ur where created_time between #{yesZeroDate} and #{thisZeroDate} and points < 0 and remark = #{remark}")
|