|
|
@@ -19,6 +19,9 @@
|
|
|
LEFT JOIN COURSE_INFO ci ON ci.COURSE_ID =cop.COURSE_ID AND ci.DELETE_FLAG='NOT_DELETE'
|
|
|
LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
|
|
|
WHERE cop.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ <if test="param.courseId!=null and param.courseId != ''">
|
|
|
+ and ci.COURSE_ID=#{param.courseId}
|
|
|
+ </if>
|
|
|
GROUP BY cop.COURSE_ID
|
|
|
)t1 ON ci.COURSE_ID =t1.courseId
|
|
|
LEFT JOIN (
|
|
|
@@ -27,6 +30,9 @@
|
|
|
sum(ci.VIEW_COUNT) AS viewCount
|
|
|
FROM COURSE_INFO ci
|
|
|
WHERE ci.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ <if test="param.courseId!=null and param.courseId != ''">
|
|
|
+ and ci.COURSE_ID=#{param.courseId}
|
|
|
+ </if>
|
|
|
GROUP BY ci.COURSE_ID
|
|
|
)t2 ON ci.COURSE_ID =t2.courseId
|
|
|
LEFT JOIN (
|
|
|
@@ -36,9 +42,13 @@
|
|
|
FROM COURSE_STUDENT_BURIALPOINT csb
|
|
|
LEFT JOIN COURSE_CLASSHOUR cch ON cch.ID=csb.HOUR_ID AND cch.DELETE_FLAG ='NOT_DELETE'
|
|
|
LEFT JOIN COURSE_CHAPTER cc ON cc.ID=cch.CHAPTER_ID AND cc.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ LEFT JOIN COURSE_INFO ci ON ci.COURSE_ID =cc.COURSE_ID AND ci.DELETE_FLAG ='NOT_DELETE'
|
|
|
WHERE csb.DELETE_FLAG ='NOT_DELETE'
|
|
|
AND csb.FUNC_TYPE='1'
|
|
|
AND csb.TYPE='1'
|
|
|
+ <if test="param.courseId!=null and param.courseId != ''">
|
|
|
+ and ci.COURSE_ID=#{param.courseId}
|
|
|
+ </if>
|
|
|
GROUP BY cc.COURSE_ID
|
|
|
)t3 ON ci.COURSE_ID =t3.courseId
|
|
|
LEFT JOIN (
|
|
|
@@ -48,11 +58,19 @@
|
|
|
FROM COURSE_STUDENT_BURIALPOINT csb
|
|
|
LEFT JOIN COURSE_CLASSHOUR cch ON cch.ID=csb.HOUR_ID AND cch.DELETE_FLAG ='NOT_DELETE'
|
|
|
LEFT JOIN COURSE_CHAPTER cc ON cc.ID=cch.CHAPTER_ID AND cc.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ LEFT JOIN COURSE_INFO ci ON ci.COURSE_ID =cc.COURSE_ID AND ci.DELETE_FLAG ='NOT_DELETE'
|
|
|
WHERE csb.DELETE_FLAG ='NOT_DELETE'
|
|
|
AND csb.FUNC_TYPE='2'
|
|
|
AND csb.TYPE='1'
|
|
|
+ <if test="param.courseId!=null and param.courseId != ''">
|
|
|
+ and ci.COURSE_ID=#{param.courseId}
|
|
|
+ </if>
|
|
|
GROUP BY cc.COURSE_ID
|
|
|
)t4 ON ci.COURSE_ID =t4.courseId
|
|
|
+ WHERE ci.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ <if test="courseId!=null and courseId != ''">
|
|
|
+ and ci.COURSE_ID=#{courseId}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getCourseOpenStuNum" resultType="java.lang.String">
|
|
|
@@ -62,12 +80,30 @@
|
|
|
LEFT JOIN COURSE_INFO ci ON ci.COURSE_ID =cop.COURSE_ID AND ci.DELETE_FLAG='NOT_DELETE'
|
|
|
LEFT JOIN SYS_USER stu ON stu.GRADES_ID =cop.GRADES_ID AND stu.DELETE_FLAG='NOT_DELETE'
|
|
|
WHERE cop.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ <if test="courseId!=null and courseId != ''">
|
|
|
+ and cop.COURSE_ID=#{courseId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime!=null and startTime != ''">
|
|
|
+ and cop.CREATE_TIME >=#{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime!=null and endTime != ''">
|
|
|
+ and cop.CREATE_TIME <=#{endTime}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="getCourseViewNum" resultType="java.lang.String">
|
|
|
SELECT
|
|
|
IFNULL(sum(ci.VIEW_COUNT),0) AS courseViewNum
|
|
|
FROM COURSE_INFO ci
|
|
|
WHERE ci.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ <if test="courseId!=null and courseId != ''">
|
|
|
+ and ci.COURSE_ID=#{courseId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime!=null and startTime != ''">
|
|
|
+ and ci.CREATE_TIME >=#{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime!=null and endTime != ''">
|
|
|
+ and ci.CREATE_TIME <=#{endTime}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="getViewTendencyNum" resultType="java.lang.String">
|
|
|
SELECT
|
|
|
@@ -86,7 +122,7 @@
|
|
|
</select>
|
|
|
<select id="getPaperSubmitNum" resultType="java.lang.String">
|
|
|
SELECT
|
|
|
- count(tepa.id) AS paperSubmitNum
|
|
|
+ IFNULL(count(tepa.id),0) AS paperSubmitNum
|
|
|
FROM "t_exam_paper_answer" tepa
|
|
|
LEFT JOIN "t_exam_paper" tep ON tepa.exam_paper_id=tep.id AND tep.deleted='0'
|
|
|
LEFT JOIN COURSE_RELATE cr ON cr.RELATE_ID=CAST(tep.id AS VARCHAR) AND cr.DELETE_FLAG ='NOT_DELETE' AND cr.CHAPTERHOUR_TYPE='1' AND cr.INFO_TYPE='0' AND (cr.FUNC_TYPE='4' OR cr.FUNC_TYPE='5')
|
|
|
@@ -94,10 +130,19 @@
|
|
|
LEFT JOIN COURSE_CHAPTER cc ON cch.CHAPTER_ID=cc.ID AND cc.DELETE_FLAG ='NOT_DELETE'
|
|
|
LEFT JOIN COURSE_INFO ci ON ci.COURSE_ID =cc.COURSE_ID AND ci.DELETE_FLAG ='NOT_DELETE'
|
|
|
WHERE (tep.id IS NOT NULL AND cch.ID IS NOT NULL AND ci.COURSE_ID IS NOT NULL)
|
|
|
+ <if test="courseId!=null and courseId != ''">
|
|
|
+ and ci.COURSE_ID=#{courseId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime!=null and startTime != ''">
|
|
|
+ and tepa.create_time >=#{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime!=null and endTime != ''">
|
|
|
+ and tepa.create_time <=#{endTime}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="paperSubmeitTendency" resultType="java.lang.String">
|
|
|
SELECT
|
|
|
- count(tepa.id) AS paperSubmitNum
|
|
|
+ IFNULL(count(tepa.id),0) AS paperSubmitNum
|
|
|
FROM "t_exam_paper_answer" tepa
|
|
|
LEFT JOIN "t_exam_paper" tep ON tepa.exam_paper_id=tep.id AND tep.deleted='0'
|
|
|
LEFT JOIN COURSE_RELATE cr ON cr.RELATE_ID=CAST(tep.id AS VARCHAR) AND cr.DELETE_FLAG ='NOT_DELETE' AND cr.CHAPTERHOUR_TYPE='1' AND cr.INFO_TYPE='0' AND (cr.FUNC_TYPE='4' OR cr.FUNC_TYPE='5')
|