|
|
@@ -276,17 +276,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</choose>
|
|
|
|
|
|
</select>
|
|
|
- <select id="selectFsCourseRedPacketLogByQwUserIdList" resultType="com.fs.course.vo.FsCourseWatchLogStatisticsListVO">
|
|
|
- select qw_user_id qwUserId, sum(amount) as redAmount,date_format(create_time,'%Y-%m-%d') createTime from fs_course_red_packet_log
|
|
|
+ <select id="selectFsCourseRedPacketLogByQwUserIdList"
|
|
|
+ resultType="com.fs.course.vo.FsCourseWatchLogStatisticsListVO">
|
|
|
+ select f1.qw_user_id qwUserId,f1.video_id videoId,f1.course_id courseId,f1.user_id userId,sum(f1.amount) as redAmount,
|
|
|
+ date_format(f1.create_time,'%Y-%m-%d') createTime from fs_course_red_packet_log f1
|
|
|
+ left join fs_course_watch_log f2 on f1.user_id = f2.user_id and f1.video_id = f2.video_id
|
|
|
<where>
|
|
|
<if test="param.companyId != null">
|
|
|
- and company_id = #{param.companyId}
|
|
|
+ and f1.company_id = #{param.companyId}
|
|
|
</if>
|
|
|
<if test=" param.sTime != null and param.eTime != null">
|
|
|
- AND date_format(create_time,'%Y-%m-%d') >= date_format(#{param.sTime},'%Y-%m-%d') and date_format(create_time,'%Y-%m-%d') <= date_format(#{param.eTime},'%Y-%m-%d')
|
|
|
+ AND date_format(f1.create_time,'%Y-%m-%d') >= date_format(#{param.sTime},'%Y-%m-%d') and date_format(f1.create_time,'%Y-%m-%d') <= date_format(#{param.eTime},'%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ <if test ='param.courseId !=null'>
|
|
|
+ and f1.course_id = #{param.courseId}
|
|
|
+ </if>
|
|
|
+ <if test ='param.qwSopId !=null and param.qwSopId!=""'>
|
|
|
+ and f2.sop_id = #{param.qwSopId}
|
|
|
+ </if>
|
|
|
+ <if test ='param.videoId !=null'>
|
|
|
+ and f1.video_id = #{param.videoId}
|
|
|
</if>
|
|
|
</where>
|
|
|
- group by qw_user_id,date_format(create_time,'%Y-%m-%d')
|
|
|
+ group by f1.qw_user_id,f1.video_id,f1.course_id,date_format(f1.create_time,'%Y-%m-%d')
|
|
|
</select>
|
|
|
|
|
|
|