|
@@ -935,10 +935,6 @@
|
|
|
) as courseCompleteNum
|
|
|
</select>
|
|
|
|
|
|
- <select id="countUserCourseNew" resultType="Map">
|
|
|
-
|
|
|
- </select>
|
|
|
-
|
|
|
<select id="countUserAnswer" resultType="Map">
|
|
|
SELECT
|
|
|
(
|
|
@@ -1764,40 +1760,50 @@
|
|
|
and company_user_id = #{companyUserId}
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
<select id="countUserCourse2" resultType="java.util.Map">
|
|
|
SELECT
|
|
|
(
|
|
|
SELECT
|
|
|
- count(1)
|
|
|
+ count(DISTINCT l.user_id)
|
|
|
FROM
|
|
|
fs_course_watch_log l
|
|
|
+ LEFT JOIN fs_user on fs_user.user_id = l.user_id
|
|
|
LEFT JOIN company_user ON l.company_user_id = company_user.user_id
|
|
|
where
|
|
|
- l.log_type != 3 and send_type = 1
|
|
|
- <if test="userId != null and userId != 0 ">
|
|
|
- and (l.company_user_id = #{userId} OR company_user.parent_id = #{userId} )
|
|
|
- </if>
|
|
|
- <if test="userId != null and userId == 0 ">
|
|
|
- and l.company_id = #{companyId}
|
|
|
- </if>
|
|
|
- <if test="periodId != null and periodId != ''">
|
|
|
- AND l.period_id = #{periodId}
|
|
|
- </if>
|
|
|
- <if test="videoId != null and videoId != ''">
|
|
|
- AND l.video_id = #{videoId}
|
|
|
- </if>
|
|
|
- <if test="companyUserId != null and companyUserId != ''">
|
|
|
- AND l.user_id = #{companyUserId}
|
|
|
- </if>
|
|
|
+ l.log_type != 3 and send_type = 1 AND fs_user.is_del = 0 AND fs_user.`status` = 1
|
|
|
+ <if test="userId != null and userId != 0 ">
|
|
|
+ and (l.company_user_id = #{userId} OR company_user.parent_id = #{userId} )
|
|
|
+ </if>
|
|
|
+ <if test="userId != null and userId == 0 ">
|
|
|
+ and l.company_id = #{companyId}
|
|
|
+ </if>
|
|
|
+ <if test="periodId != null and periodId != ''">
|
|
|
+ AND l.period_id = #{periodId}
|
|
|
+ </if>
|
|
|
+ <if test="videoId != null and videoId != ''">
|
|
|
+ AND l.video_id = #{videoId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null and startTime !='' ">
|
|
|
+ and l.create_time >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and l.create_time <= #{endTime}
|
|
|
+ </if>
|
|
|
+ -- 单独通过销售id查询
|
|
|
+ <if test="companyUserId != null and companyUserId != ''">
|
|
|
+ AND l.company_user_id = #{companyUserId}
|
|
|
+ </if>
|
|
|
) as courseWatchNum,
|
|
|
(
|
|
|
SELECT
|
|
|
- count(1)
|
|
|
+ count(DISTINCT l.user_id)
|
|
|
FROM
|
|
|
fs_course_watch_log l
|
|
|
+ LEFT JOIN fs_user on fs_user.user_id = l.user_id
|
|
|
LEFT JOIN company_user ON l.company_user_id = company_user.user_id
|
|
|
where
|
|
|
- l.log_type = 2 and send_type = 1
|
|
|
+ l.log_type = 2 and send_type = 1 AND fs_user.is_del = 0 AND fs_user.`status` = 1
|
|
|
<if test="userId != null and userId != 0 ">
|
|
|
and (l.company_user_id = #{userId} OR company_user.parent_id = #{userId} )
|
|
|
</if>
|
|
@@ -1810,11 +1816,48 @@
|
|
|
<if test="videoId != null and videoId != ''">
|
|
|
AND l.video_id = #{videoId}
|
|
|
</if>
|
|
|
+ <if test="startTime != null and startTime !='' ">
|
|
|
+ and l.create_time >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and l.create_time <= #{endTime}
|
|
|
+ </if>
|
|
|
-- 单独通过销售id查询
|
|
|
<if test="companyUserId != null and companyUserId != ''">
|
|
|
- AND l.user_id = #{companyUserId}
|
|
|
+ AND l.company_user_id = #{companyUserId}
|
|
|
</if>
|
|
|
) as courseCompleteNum
|
|
|
</select>
|
|
|
|
|
|
+ <select id="countCourseDetailsNew" resultType="Map">
|
|
|
+ SELECT
|
|
|
+ count( DISTINCT l.period_id ) as courseNum,
|
|
|
+ count( DISTINCT l.video_id ) as videoNum,
|
|
|
+ count( DISTINCT l.user_id ) as courseUserNum
|
|
|
+ FROM
|
|
|
+ fs_course_watch_log l
|
|
|
+ left join fs_user on fs_user.user_id = l.user_id
|
|
|
+ LEFT JOIN company_user ON l.company_user_id = company_user.user_id
|
|
|
+ WHERE
|
|
|
+ l.log_type != 3
|
|
|
+ AND send_type = 1
|
|
|
+ AND fs_user.is_del = 0 AND fs_user.`status` = 1
|
|
|
+ <if test="userId != null and userId != 0 ">
|
|
|
+ AND l.company_user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null and userId == 0 ">
|
|
|
+ and l.company_id = #{companyId}
|
|
|
+ </if>
|
|
|
+ <if test="periodId != null and periodId != ''">
|
|
|
+ AND l.period_id = #{periodId}
|
|
|
+ </if>
|
|
|
+ <if test="videoId != null and videoId != ''">
|
|
|
+ AND l.video_id = #{videoId}
|
|
|
+ </if>
|
|
|
+ -- 单独通过销售id查询
|
|
|
+ <if test="companyUserId != null and companyUserId != ''">
|
|
|
+ AND l.company_user_id = #{companyUserId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|