|
@@ -2,6 +2,7 @@ package com.fs.his.mapper;
|
|
|
|
|
|
|
|
import com.fs.common.annotation.DataSource;
|
|
import com.fs.common.annotation.DataSource;
|
|
|
import com.fs.common.enums.DataSourceType;
|
|
import com.fs.common.enums.DataSourceType;
|
|
|
|
|
+import com.fs.his.domain.FsIntegralCount;
|
|
|
import com.fs.his.domain.FsUserIntegralLogs;
|
|
import com.fs.his.domain.FsUserIntegralLogs;
|
|
|
import com.fs.his.param.FsUserIntegralLogsListUParam;
|
|
import com.fs.his.param.FsUserIntegralLogsListUParam;
|
|
|
import com.fs.his.param.FsUserIntegralLogsParam;
|
|
import com.fs.his.param.FsUserIntegralLogsParam;
|
|
@@ -162,4 +163,14 @@ public interface FsUserIntegralLogsMapper
|
|
|
*/
|
|
*/
|
|
|
@Select("select * from fs_user_integral_logs where user_id = #{userId} and log_type = #{logType} order by create_time desc limit 1")
|
|
@Select("select * from fs_user_integral_logs where user_id = #{userId} and log_type = #{logType} order by create_time desc limit 1")
|
|
|
FsUserIntegralLogs getLast1LogByUserIdAndLogType(@Param("userId") Long userId, @Param("logType") Integer logType);
|
|
FsUserIntegralLogs getLast1LogByUserIdAndLogType(@Param("userId") Long userId, @Param("logType") Integer logType);
|
|
|
|
|
+
|
|
|
|
|
+ @Select("SELECT log_type, " +
|
|
|
|
|
+ "SUM(CASE WHEN integral > 0 THEN integral ELSE 0 END) AS integral_consume, " +
|
|
|
|
|
+ "SUM(CASE WHEN integral < 0 THEN ABS(integral) ELSE 0 END) AS integral_refund, " +
|
|
|
|
|
+ "DATE(create_time) AS consumption_date " +
|
|
|
|
|
+ "FROM fs_user_integral_logs " +
|
|
|
|
|
+ "WHERE log_type != 17 " +
|
|
|
|
|
+ "AND DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY) " +
|
|
|
|
|
+ "GROUP BY log_type, DATE(create_time)")
|
|
|
|
|
+ List<FsIntegralCount> selectYesterdayIntegralGroupByLogType();
|
|
|
}
|
|
}
|