@ -382,14 +382,13 @@ getSchoolStartCourse
getTeacherOpenCourseMergeCourseInfo
getTeacherOpenCourseMergeCourseInfo
===
===
* 获取教师开课课程,以及授权课程
* 获取教师开课课程,以及授权课程
(
(
SELECT
SELECT
1 ` type` ,
1 type,
a.teacher_open_course_id,
a.teacher_open_course_id,
a.teacher_open_course_title ` course_name` ,
a.teacher_open_course_title course_name,
a.teacher_open_course_cover ` course_cover` ,
a.teacher_open_course_cover course_cover,
t.teacher_name ` name` ,
t.teacher_name name,
a.start_time
a.start_time
FROM teacher_open_course a
FROM teacher_open_course a
LEFT JOIN teacher_open_course_merge_teacher tocmt on a.teacher_open_course_id = tocmt.teacher_open_course_id
LEFT JOIN teacher_open_course_merge_teacher tocmt on a.teacher_open_course_id = tocmt.teacher_open_course_id
@ -401,39 +400,53 @@ getTeacherOpenCourseMergeCourseInfo
@if (!isEmpty(orgId)){
@if (!isEmpty(orgId)){
AND a.org_id = #orgId #
AND a.org_id = #orgId #
@}
@}
AND (
@if (!isEmpty(courseLabelId)){
@if (!isEmpty(courseLabelId)){
AND a.teacher_open_course_id in (
a.teacher_open_course_id in (
select teacher_open_course_id from teacher_open_course_merge_course_info c where c.course_label_id = #courseLabelId # and c.course_info_type = 1 and c.course_info_status = 1
select teacher_open_course_id
from teacher_open_course_merge_course_info c
where c.course_label_id = #courseLabelId #
and c.course_info_type = 1
and c.course_info_status = 1
)
)
@} else {
1 = 1 -- 当 courseLabelId 为空时不做限制
@}
@}
)
@if (!isEmpty(filterStartTime) && !isEmpty(filterEndTime)){
@if (!isEmpty(filterStartTime) && !isEmpty(filterEndTime)){
AND a.start_time BETWEEN #filterStartTime # AND #filterEndTime #
AND a.start_time BETWEEN #filterStartTime # AND #filterEndTime #
@}
@}
)
)
UNION ALL
UNION ALL
(
(
select
SELECT
2 ` type` ,
2 type,
ci.course_info_id ` teacher_open_course_id` ,
ci.course_info_id teacher_open_course_id,
ci.course_info_name ` course_name` ,
ci.course_info_name course_name,
ci.course_info_thumbnail ` course_cover` ,
ci.course_info_thumbnail course_cover,
'系统管理员' ` name` ,
'系统管理员' name,
ucjcr.use_start_time AS start_time
ucjcr.use_start_time AS start_time
from universities_colleges uc
FROM universities_colleges uc
LEFT JOIN universities_colleges_jurisdiction_curriculum_resources ucjcr ON ucjcr.universities_colleges_id = uc.universities_colleges_id
LEFT JOIN universities_colleges_jurisdiction_curriculum_resources ucjcr
LEFT JOIN course_info ci ON ci.course_info_id = ucjcr.course_info_id AND ci.course_info_type =1
ON ucjcr.universities_colleges_id = uc.universities_colleges_id
where 1 = 1
LEFT JOIN course_info ci
and uc.universities_colleges_status = 1
ON ci.course_info_id = ucjcr.course_info_id
and ci.course_info_status = 1
AND ci.course_info_type = 1
and ucjcr.use_type in (1,2)
WHERE 1 = 1
and now() between ucjcr.use_start_time and ucjcr.use_end_time
AND uc.universities_colleges_status = 1
AND ci.course_info_status = 1
AND ucjcr.use_type IN (1, 2)
AND NOW() BETWEEN ucjcr.use_start_time AND ucjcr.use_end_time
@if (!isEmpty(orgId)){
@if (!isEmpty(orgId)){
AND uc.org_id = #orgId #
AND uc.org_id = #orgId #
@}
@}
AND (
@if (!isEmpty(courseLabelId)){
@if (!isEmpty(courseLabelId)){
and ci.course_label_id = #courseLabelId #
ci.course_label_id = #courseLabelId #
@} else {
1 = 1 -- 当 courseLabelId 为空时不做限制
@}
@}
)
@if (!isEmpty(filterStartTime) && !isEmpty(filterEndTime)){
@if (!isEmpty(filterStartTime) && !isEmpty(filterEndTime)){
AND ucjcr.use_start_time BETWEEN #filterStartTime # AND #filterEndTime #
AND ucjcr.use_start_time BETWEEN #filterStartTime # AND #filterEndTime #
@}
@}