|
|
@@ -1010,77 +1010,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
company_tag.tag_id
|
|
|
</select>
|
|
|
|
|
|
- <select id="countUserCourse" resultType="Map">
|
|
|
- SELECT
|
|
|
- (SELECT COUNT(*) FROM (
|
|
|
- SELECT 1
|
|
|
- FROM fs_user_course_count fcc
|
|
|
- JOIN fs_user ON fs_user.user_id = fcc.user_id
|
|
|
- JOIN fs_user_company_user ucu ON ucu.user_id = fs_user.user_id
|
|
|
- JOIN company_user ON ucu.company_user_id = company_user.user_id
|
|
|
- LEFT JOIN fs_user_course_period_days fcpd ON FIND_IN_SET(fcpd.period_id, fcc.course_ids) > 0
|
|
|
- <where>
|
|
|
- fcc.project_id = ucu.project_id
|
|
|
- <if test="userId != null and userId != 0 ">
|
|
|
- and (ucu.company_user_id = #{userId} OR company_user.parent_id = #{userId} )
|
|
|
- </if>
|
|
|
- <if test="userId != null and userId == 0 ">
|
|
|
- and ucu.company_id = #{companyId}
|
|
|
- </if>
|
|
|
- <if test="startTime != null and startTime !='' ">
|
|
|
- and fcc.create_time >= #{startTime}
|
|
|
- </if>
|
|
|
- <if test="endTime != null and endTime != ''">
|
|
|
- and fcc.create_time <= #{endTime}
|
|
|
- </if>
|
|
|
- <if test="periodId != null and periodId != ''">
|
|
|
- AND fcpd.period_id = #{periodId}
|
|
|
- </if>
|
|
|
- <if test="videoId != null and videoId != ''">
|
|
|
- AND fcpd.video_id = #{videoId}
|
|
|
- </if>
|
|
|
- -- 单独通过销售id查询
|
|
|
- <if test="companyUserId != null and companyUserId != ''">
|
|
|
- AND company_user.user_id = #{companyUserId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ) as courseWatchNum,
|
|
|
- (SELECT COUNT(*) FROM (
|
|
|
- SELECT 1
|
|
|
- FROM fs_user_course_count fcc
|
|
|
- JOIN fs_user ON fs_user.user_id = fcc.user_id
|
|
|
- JOIN fs_user_company_user ucu ON ucu.user_id = fs_user.user_id
|
|
|
- JOIN company_user ON ucu.company_user_id = company_user.user_id
|
|
|
- LEFT JOIN fs_user_course_period_days fcpd ON FIND_IN_SET(fcpd.period_id, fcc.course_ids) > 0
|
|
|
- <where>
|
|
|
- fcc.project_id = ucu.project_id
|
|
|
- <if test="userId != null and userId != 0 ">
|
|
|
- and (ucu.company_user_id = #{userId} OR company_user.parent_id = #{userId} )
|
|
|
- </if>
|
|
|
- <if test="userId != null and userId == 0 ">
|
|
|
- and ucu.company_id = #{companyId}
|
|
|
- </if>
|
|
|
- AND fcc.complete_watch_count > 0
|
|
|
- <if test="startTime != null and startTime !='' ">
|
|
|
- and fcc.create_time >= #{startTime}
|
|
|
- </if>
|
|
|
- <if test="endTime != null and endTime != ''">
|
|
|
- and fcc.create_time <= #{endTime}
|
|
|
- </if>
|
|
|
- <if test="periodId != null and periodId != ''">
|
|
|
- AND fcpd.period_id = #{periodId}
|
|
|
- </if>
|
|
|
- <if test="videoId != null and videoId != ''">
|
|
|
- AND fcpd.video_id = #{videoId}
|
|
|
- </if>
|
|
|
- -- 单独通过销售id查询
|
|
|
- <if test="companyUserId != null and companyUserId != ''">
|
|
|
- AND company_user.user_id = #{companyUserId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- GROUP BY fcc.user_id, ucu.project_id
|
|
|
- ) AS complete_counts ) as courseCompleteNum
|
|
|
- </select>
|
|
|
+<!-- <select id="countUserCourse" resultType="Map">-->
|
|
|
+<!-- SELECT-->
|
|
|
+<!-- (SELECT COUNT(*) FROM (-->
|
|
|
+<!-- SELECT 1-->
|
|
|
+<!-- FROM fs_user_course_count fcc-->
|
|
|
+<!-- JOIN fs_user ON fs_user.user_id = fcc.user_id-->
|
|
|
+<!-- JOIN fs_user_company_user ucu ON ucu.user_id = fs_user.user_id-->
|
|
|
+<!-- JOIN company_user ON ucu.company_user_id = company_user.user_id-->
|
|
|
+<!-- LEFT JOIN fs_user_course_period_days fcpd ON FIND_IN_SET(fcpd.period_id, fcc.course_ids) > 0-->
|
|
|
+<!-- <where>-->
|
|
|
+<!-- fcc.project_id = ucu.project_id-->
|
|
|
+<!-- <if test="userId != null and userId != 0 ">-->
|
|
|
+<!-- and (ucu.company_user_id = #{userId} OR company_user.parent_id = #{userId} )-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="userId != null and userId == 0 ">-->
|
|
|
+<!-- and ucu.company_id = #{companyId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="startTime != null and startTime !='' ">-->
|
|
|
+<!-- and fcc.create_time >= #{startTime}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="endTime != null and endTime != ''">-->
|
|
|
+<!-- and fcc.create_time <= #{endTime}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="periodId != null and periodId != ''">-->
|
|
|
+<!-- AND fcpd.period_id = #{periodId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="videoId != null and videoId != ''">-->
|
|
|
+<!-- AND fcpd.video_id = #{videoId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- -- 单独通过销售id查询-->
|
|
|
+<!-- <if test="companyUserId != null and companyUserId != ''">-->
|
|
|
+<!-- AND company_user.user_id = #{companyUserId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- </where>-->
|
|
|
+<!-- ) as courseWatchNum,-->
|
|
|
+<!-- (SELECT COUNT(*) FROM (-->
|
|
|
+<!-- SELECT 1-->
|
|
|
+<!-- FROM fs_user_course_count fcc-->
|
|
|
+<!-- JOIN fs_user ON fs_user.user_id = fcc.user_id-->
|
|
|
+<!-- JOIN fs_user_company_user ucu ON ucu.user_id = fs_user.user_id-->
|
|
|
+<!-- JOIN company_user ON ucu.company_user_id = company_user.user_id-->
|
|
|
+<!-- LEFT JOIN fs_user_course_period_days fcpd ON FIND_IN_SET(fcpd.period_id, fcc.course_ids) > 0-->
|
|
|
+<!-- <where>-->
|
|
|
+<!-- fcc.project_id = ucu.project_id-->
|
|
|
+<!-- <if test="userId != null and userId != 0 ">-->
|
|
|
+<!-- and (ucu.company_user_id = #{userId} OR company_user.parent_id = #{userId} )-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="userId != null and userId == 0 ">-->
|
|
|
+<!-- and ucu.company_id = #{companyId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- AND fcc.complete_watch_count > 0-->
|
|
|
+<!-- <if test="startTime != null and startTime !='' ">-->
|
|
|
+<!-- and fcc.create_time >= #{startTime}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="endTime != null and endTime != ''">-->
|
|
|
+<!-- and fcc.create_time <= #{endTime}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="periodId != null and periodId != ''">-->
|
|
|
+<!-- AND fcpd.period_id = #{periodId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="videoId != null and videoId != ''">-->
|
|
|
+<!-- AND fcpd.video_id = #{videoId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- -- 单独通过销售id查询-->
|
|
|
+<!-- <if test="companyUserId != null and companyUserId != ''">-->
|
|
|
+<!-- AND company_user.user_id = #{companyUserId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- </where>-->
|
|
|
+<!-- GROUP BY fcc.user_id, ucu.project_id-->
|
|
|
+<!-- ) AS complete_counts ) as courseCompleteNum-->
|
|
|
+<!-- </select>-->
|
|
|
<select id="countUserStats" resultType="Map">
|
|
|
SELECT
|
|
|
-- 观看人数
|
|
|
@@ -1450,82 +1450,82 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
) AS answerRightNum
|
|
|
</select>
|
|
|
|
|
|
- <select id="countCourseDetails" resultType="Map">
|
|
|
- select (SELECT
|
|
|
- count( DISTINCT fcpd.period_id )
|
|
|
- FROM
|
|
|
- fs_user_course_period_days fcpd
|
|
|
- LEFT JOIN fs_user_course_period fpd on fpd.period_id = fcpd.period_id
|
|
|
- LEFT JOIN fs_user_course_count fcc ON FIND_IN_SET( fcpd.period_id, fcc.course_ids ) > 0
|
|
|
- LEFT JOIN fs_user ON fs_user.user_id = fcc.user_id
|
|
|
- left join fs_user_company_user ucu on ucu.user_id = fs_user.user_id
|
|
|
- WHERE 1=1 and fcpd.del_flag =0 and fpd.del_flag =0
|
|
|
- AND FIND_IN_SET(#{companyId}, fpd.company_id)
|
|
|
- <if test="userId != null and userId != 0 ">
|
|
|
- AND ucu.company_user_id = #{userId}
|
|
|
- </if>
|
|
|
- <if test="userId != null and userId == 0 ">
|
|
|
- and ucu.company_id = #{companyId}
|
|
|
- </if>
|
|
|
- <if test="periodId != null and periodId != ''">
|
|
|
- AND fcpd.period_id = #{periodId}
|
|
|
- </if>
|
|
|
- -- 单独通过销售id查询
|
|
|
- <if test="companyUserId != null and companyUserId != ''">
|
|
|
- AND ucu.company_user_id = #{companyUserId}
|
|
|
- </if>
|
|
|
- ) as courseNum,
|
|
|
-
|
|
|
- (SELECT count(DISTINCT fcpd.video_id)
|
|
|
- FROM fs_user_course_period_days fcpd
|
|
|
- LEFT JOIN fs_user_course_period fpd on fpd.period_id = fcpd.period_id
|
|
|
- LEFT JOIN fs_user_course_count fcc ON FIND_IN_SET( fcpd.period_id, fcc.course_ids ) > 0
|
|
|
- LEFT JOIN fs_user ON fs_user.user_id = fcc.user_id
|
|
|
- left join fs_user_company_user ucu on ucu.user_id = fs_user.user_id
|
|
|
- WHERE 1=1 and fcpd.del_flag =0 and fpd.del_flag =0
|
|
|
- AND FIND_IN_SET(#{companyId}, fpd.company_id)
|
|
|
- <if test="userId != null and userId != 0 ">
|
|
|
- AND ucu.company_user_id = #{userId}
|
|
|
- </if>
|
|
|
- <if test="userId != null and userId == 0 ">
|
|
|
- and ucu.company_id = #{companyId}
|
|
|
- </if>
|
|
|
- <if test="periodId != null and periodId != ''">
|
|
|
- AND fcpd.period_id = #{periodId}
|
|
|
- </if>
|
|
|
- <if test="videoId != null and videoId != ''">
|
|
|
- AND fcpd.video_id = #{videoId}
|
|
|
- </if>
|
|
|
- -- 单独通过销售id查询
|
|
|
- <if test="companyUserId != null and companyUserId != ''">
|
|
|
- AND ucu.company_user_id = #{companyUserId}
|
|
|
- </if>
|
|
|
- ) as videoNum,
|
|
|
-
|
|
|
- ( SELECT count(DISTINCT fs_user.user_id ) FROM fs_user_course_count fcc
|
|
|
- LEFT JOIN fs_user_course_period_days fcpd ON FIND_IN_SET( fcpd.period_id, fcc.course_ids ) > 0
|
|
|
- LEFT JOIN fs_user ON fs_user.user_id = fcc.user_id
|
|
|
- left join fs_user_company_user ucu on ucu.user_id = fs_user.user_id
|
|
|
- <if test="periodId != null and periodId != ''">
|
|
|
- AND fcpd.period_id = #{periodId}
|
|
|
- </if>
|
|
|
- <if test="videoId != null and videoId != ''">
|
|
|
- AND fcpd.video_id = #{videoId}
|
|
|
- </if>
|
|
|
- -- 单独通过销售id查询
|
|
|
- <if test="companyUserId != null and companyUserId != ''">
|
|
|
- AND ucu.company_user_id = #{companyUserId}
|
|
|
- </if>
|
|
|
- <where>
|
|
|
- <if test="userId != null and userId != 0 ">
|
|
|
- AND ucu.company_user_id = #{userId}
|
|
|
- </if>
|
|
|
- <if test="userId != null and userId == 0 ">
|
|
|
- and ucu.company_id = #{companyId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ) as courseUserNum
|
|
|
- </select>
|
|
|
+<!-- <select id="countCourseDetails" resultType="Map">-->
|
|
|
+<!-- select (SELECT-->
|
|
|
+<!-- count( DISTINCT fcpd.period_id )-->
|
|
|
+<!-- FROM-->
|
|
|
+<!-- fs_user_course_period_days fcpd-->
|
|
|
+<!-- LEFT JOIN fs_user_course_period fpd on fpd.period_id = fcpd.period_id-->
|
|
|
+<!-- LEFT JOIN fs_user_course_count fcc ON FIND_IN_SET( fcpd.period_id, fcc.course_ids ) > 0-->
|
|
|
+<!-- LEFT JOIN fs_user ON fs_user.user_id = fcc.user_id-->
|
|
|
+<!-- left join fs_user_company_user ucu on ucu.user_id = fs_user.user_id-->
|
|
|
+<!-- WHERE 1=1 and fcpd.del_flag =0 and fpd.del_flag =0-->
|
|
|
+<!-- AND FIND_IN_SET(#{companyId}, fpd.company_id)-->
|
|
|
+<!-- <if test="userId != null and userId != 0 ">-->
|
|
|
+<!-- AND ucu.company_user_id = #{userId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="userId != null and userId == 0 ">-->
|
|
|
+<!-- and ucu.company_id = #{companyId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="periodId != null and periodId != ''">-->
|
|
|
+<!-- AND fcpd.period_id = #{periodId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- -- 单独通过销售id查询-->
|
|
|
+<!-- <if test="companyUserId != null and companyUserId != ''">-->
|
|
|
+<!-- AND ucu.company_user_id = #{companyUserId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- ) as courseNum,-->
|
|
|
+
|
|
|
+<!-- (SELECT count(DISTINCT fcpd.video_id)-->
|
|
|
+<!-- FROM fs_user_course_period_days fcpd-->
|
|
|
+<!-- LEFT JOIN fs_user_course_period fpd on fpd.period_id = fcpd.period_id-->
|
|
|
+<!-- LEFT JOIN fs_user_course_count fcc ON FIND_IN_SET( fcpd.period_id, fcc.course_ids ) > 0-->
|
|
|
+<!-- LEFT JOIN fs_user ON fs_user.user_id = fcc.user_id-->
|
|
|
+<!-- left join fs_user_company_user ucu on ucu.user_id = fs_user.user_id-->
|
|
|
+<!-- WHERE 1=1 and fcpd.del_flag =0 and fpd.del_flag =0-->
|
|
|
+<!-- AND FIND_IN_SET(#{companyId}, fpd.company_id)-->
|
|
|
+<!-- <if test="userId != null and userId != 0 ">-->
|
|
|
+<!-- AND ucu.company_user_id = #{userId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="userId != null and userId == 0 ">-->
|
|
|
+<!-- and ucu.company_id = #{companyId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="periodId != null and periodId != ''">-->
|
|
|
+<!-- AND fcpd.period_id = #{periodId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="videoId != null and videoId != ''">-->
|
|
|
+<!-- AND fcpd.video_id = #{videoId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- -- 单独通过销售id查询-->
|
|
|
+<!-- <if test="companyUserId != null and companyUserId != ''">-->
|
|
|
+<!-- AND ucu.company_user_id = #{companyUserId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- ) as videoNum,-->
|
|
|
+
|
|
|
+<!-- ( SELECT count(DISTINCT fs_user.user_id ) FROM fs_user_course_count fcc-->
|
|
|
+<!-- LEFT JOIN fs_user_course_period_days fcpd ON FIND_IN_SET( fcpd.period_id, fcc.course_ids ) > 0-->
|
|
|
+<!-- LEFT JOIN fs_user ON fs_user.user_id = fcc.user_id-->
|
|
|
+<!-- left join fs_user_company_user ucu on ucu.user_id = fs_user.user_id-->
|
|
|
+<!-- <if test="periodId != null and periodId != ''">-->
|
|
|
+<!-- AND fcpd.period_id = #{periodId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="videoId != null and videoId != ''">-->
|
|
|
+<!-- AND fcpd.video_id = #{videoId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- -- 单独通过销售id查询-->
|
|
|
+<!-- <if test="companyUserId != null and companyUserId != ''">-->
|
|
|
+<!-- AND ucu.company_user_id = #{companyUserId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <where>-->
|
|
|
+<!-- <if test="userId != null and userId != 0 ">-->
|
|
|
+<!-- AND ucu.company_user_id = #{userId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="userId != null and userId == 0 ">-->
|
|
|
+<!-- and ucu.company_id = #{companyId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- </where>-->
|
|
|
+<!-- ) as courseUserNum-->
|
|
|
+<!-- </select>-->
|
|
|
|
|
|
<select id="countUserRankingByComplete" resultType="com.fs.store.vo.h5.FsUserRankingVO">
|
|
|
SELECT
|