|
@@ -262,4 +262,129 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+ <select id="setlectCourseCompleteNum" resultType="java.lang.Long">
|
|
|
+ select
|
|
|
+ count(watch.log_id)
|
|
|
+ from
|
|
|
+ fs_user_course_training_camp camp
|
|
|
+ left join fs_user_course_period period on
|
|
|
+ camp.training_camp_id = period.training_camp_id
|
|
|
+ left join fs_course_watch_log watch on
|
|
|
+ period.period_id = watch.period_id
|
|
|
+ <where>
|
|
|
+ `period`.del_flag = '0' and watch.log_type <> 3
|
|
|
+ <if test="trainingCampId != null">and camp.training_camp_id = #{trainingCampId}</if>
|
|
|
+ <if test="userId != null">and watch.user_id = #{userId}</if>
|
|
|
+ <if test="periodId != null">and `period`.period_id = #{periodId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="setlectCourseWatchNum" resultType="java.lang.Long">
|
|
|
+ select
|
|
|
+ sum(watch.duration)
|
|
|
+ from
|
|
|
+ fs_user_course_training_camp camp
|
|
|
+ left join fs_user_course_period period on
|
|
|
+ camp.training_camp_id = period.training_camp_id
|
|
|
+ left join fs_course_watch_log watch on
|
|
|
+ period.period_id = watch.period_id
|
|
|
+ <where>
|
|
|
+ `period`.del_flag = '0' and watch.log_type <> 3
|
|
|
+ <if test="trainingCampId != null">and camp.training_camp_id = #{trainingCampId}</if>
|
|
|
+ <if test="userId != null">and watch.user_id = #{userId}</if>
|
|
|
+ <if test="periodId != null">and `period`.period_id = #{periodId}</if>
|
|
|
+ </where>
|
|
|
+
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="setlectRedPacketCount" resultType="java.lang.Long">
|
|
|
+ select
|
|
|
+ count(packet.log_id)
|
|
|
+ from
|
|
|
+ fs_user_course_training_camp camp
|
|
|
+ left join fs_user_course_period period on
|
|
|
+ camp.training_camp_id = period.training_camp_id
|
|
|
+ left join fs_course_red_packet_log packet on
|
|
|
+ period.period_id = packet.period_id
|
|
|
+ <where>
|
|
|
+ `period`.del_flag = '0' and packet.status =1
|
|
|
+ <if test="trainingCampId != null">and camp.training_camp_id = #{trainingCampId}</if>
|
|
|
+ <if test="userId != null">and packet.user_id = #{userId}</if>
|
|
|
+ <if test="periodId != null">and `period`.period_id = #{periodId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="setlectRedPacketAmount" resultType="java.math.BigDecimal">
|
|
|
+ select
|
|
|
+ sum(packet.amount)
|
|
|
+ from
|
|
|
+ fs_user_course_training_camp camp
|
|
|
+ left join fs_user_course_period period on
|
|
|
+ camp.training_camp_id = period.training_camp_id
|
|
|
+ left join fs_course_red_packet_log packet on
|
|
|
+ period.period_id = packet.period_id
|
|
|
+ <where>
|
|
|
+ `period`.del_flag = '0' and packet.status =1
|
|
|
+ <if test="trainingCampId != null">and camp.training_camp_id = #{trainingCampId}</if>
|
|
|
+ <if test="userId != null">and packet.user_id = #{userId}</if>
|
|
|
+ <if test="periodId != null">and `period`.period_id = #{periodId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="setlectCorrectAnswerNum" resultType="java.lang.Long">
|
|
|
+ select
|
|
|
+ count(answer.log_id)
|
|
|
+ from
|
|
|
+ fs_user_course_training_camp camp
|
|
|
+ left join fs_user_course_period period on
|
|
|
+ camp.training_camp_id = period.training_camp_id
|
|
|
+ left join fs_course_answer_logs answer on
|
|
|
+ period.period_id = answer.period_id
|
|
|
+ <where>
|
|
|
+ `period`.del_flag = '0' and answer.is_right =1
|
|
|
+ <if test="trainingCampId != null">and camp.training_camp_id = #{trainingCampId}</if>
|
|
|
+ <if test="userId != null">and answer.user_id = #{userId}</if>
|
|
|
+ <if test="periodId != null">and `period`.period_id = #{periodId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectFsPeriodlist" resultMap="FsUserCoursePeriodResult">
|
|
|
+ select
|
|
|
+ period.period_id,
|
|
|
+ period.period_name,
|
|
|
+ period.company_id,
|
|
|
+ period.training_camp_id,
|
|
|
+ period.create_time,
|
|
|
+ period.update_time,
|
|
|
+ period.course_style,
|
|
|
+ period.live_room_style,
|
|
|
+ period.red_packet_grant_method,
|
|
|
+ period.period_type,
|
|
|
+ period.period_starting_time,
|
|
|
+ period.period_end_time,
|
|
|
+ period.period_status,
|
|
|
+ period.view_start_time,
|
|
|
+ period.view_end_time,
|
|
|
+ period.last_join_time,
|
|
|
+ period.max_view_num,
|
|
|
+ period.course_logo,
|
|
|
+ period.open_comment_status,
|
|
|
+ period.del_flag
|
|
|
+ from
|
|
|
+ fs_user_course_period period
|
|
|
+ left join fs_course_watch_log watch on
|
|
|
+ period.period_id = watch.period_id
|
|
|
+ <where>
|
|
|
+ `period`.del_flag = '0' and watch.log_type <> 3
|
|
|
+ <if test="trainingCampId != null">and `period`.training_camp_id = #{trainingCampId}</if>
|
|
|
+ <if test="userId != null">and watch.user_id = #{userId}</if>
|
|
|
+ <if test="periodId != null">and `period`.period_id = #{periodId}</if>
|
|
|
+ </where>
|
|
|
+ group by
|
|
|
+ `period`.period_id
|
|
|
+ </select>
|
|
|
</mapper>
|