|
@@ -238,18 +238,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
fs_user.nick_name as nickname,
|
|
fs_user.nick_name as nickname,
|
|
|
fs_user.phone,
|
|
fs_user.phone,
|
|
|
case when fs_user.app_open_id is null then 2 else 1 end as isAppUser,
|
|
case when fs_user.app_open_id is null then 2 else 1 end as isAppUser,
|
|
|
- fs_user_course_count.id,
|
|
|
|
|
- fs_user_course_count.watch_course_count,
|
|
|
|
|
--- fs_course_watch_log.watch_course_count,
|
|
|
|
|
- fs_user_course_count.miss_course_count,
|
|
|
|
|
- fs_user_course_count.miss_course_status,
|
|
|
|
|
- fs_user_course_count.course_ids,
|
|
|
|
|
- fs_user_course_count.part_course_count,
|
|
|
|
|
--- fs_course_watch_log.part_course_count,
|
|
|
|
|
- fs_user_course_count.last_watch_date,
|
|
|
|
|
- fs_user_course_count.STATUS AS courseCountStatus,
|
|
|
|
|
- fs_user_course_count.stop_watch_days,
|
|
|
|
|
- fs_user_course_count.complete_watch_date,
|
|
|
|
|
|
|
+ fcc.id,
|
|
|
|
|
+ fcc.watch_course_count,
|
|
|
|
|
+ fcc.miss_course_count,
|
|
|
|
|
+ fcc.miss_course_status,
|
|
|
|
|
+ fcc.course_ids,
|
|
|
|
|
+ fcc.part_course_count,
|
|
|
|
|
+ fcc.last_watch_date,
|
|
|
|
|
+ fcc.STATUS AS courseCountStatus,
|
|
|
|
|
+ fcc.stop_watch_days,
|
|
|
|
|
+ fcc.complete_watch_date,
|
|
|
GROUP_CONCAT(DISTINCT company_tag.tag) AS tag,
|
|
GROUP_CONCAT(DISTINCT company_tag.tag) AS tag,
|
|
|
GROUP_CONCAT(DISTINCT company_tag.tag_id) AS tagIds,
|
|
GROUP_CONCAT(DISTINCT company_tag.tag_id) AS tagIds,
|
|
|
company_user.nick_name as companyUserNickName,
|
|
company_user.nick_name as companyUserNickName,
|
|
@@ -262,7 +260,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
FROM
|
|
FROM
|
|
|
fs_user
|
|
fs_user
|
|
|
INNER JOIN fs_user_company_user ON fs_user_company_user.user_id = fs_user.user_id
|
|
INNER JOIN fs_user_company_user ON fs_user_company_user.user_id = fs_user.user_id
|
|
|
- LEFT JOIN fs_user_course_count ON fs_user_company_user.user_id = fs_user_course_count.user_id and fs_user_company_user.project_id = fs_user_course_count.project_id
|
|
|
|
|
|
|
+ LEFT JOIN fs_user_course_count fcc ON fcc.id = (
|
|
|
|
|
+ SELECT MAX(fcc2.id)
|
|
|
|
|
+ FROM fs_user_course_count fcc2
|
|
|
|
|
+ WHERE fcc2.user_id = fs_user_company_user.user_id
|
|
|
|
|
+ AND fcc2.project_id = fs_user_company_user.project_id
|
|
|
|
|
+ )
|
|
|
left join fs_user_project_tag upt ON upt.user_company_user_id = fs_user_company_user.id
|
|
left join fs_user_project_tag upt ON upt.user_company_user_id = fs_user_company_user.id
|
|
|
LEFT JOIN company_tag ON company_tag.tag_id = upt.tag_id
|
|
LEFT JOIN company_tag ON company_tag.tag_id = upt.tag_id
|
|
|
LEFT JOIN company_user ON company_user.user_id = fs_user_company_user.company_user_id
|
|
LEFT JOIN company_user ON company_user.user_id = fs_user_company_user.company_user_id
|
|
@@ -321,33 +324,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND fs_user_company_user.create_time >= CURDATE() AND fs_user_company_user.create_time < CURDATE() + INTERVAL 1 DAY
|
|
AND fs_user_company_user.create_time >= CURDATE() AND fs_user_company_user.create_time < CURDATE() + INTERVAL 1 DAY
|
|
|
</when>
|
|
</when>
|
|
|
<when test = "tabValue == 2">
|
|
<when test = "tabValue == 2">
|
|
|
- AND fs_user_course_count.complete_watch_date >= CURDATE() AND fs_user_course_count.complete_watch_date < CURDATE() + INTERVAL 1 DAY
|
|
|
|
|
|
|
+ AND fcc.complete_watch_date >= CURDATE() AND fcc.complete_watch_date < CURDATE() + INTERVAL 1 DAY
|
|
|
</when>
|
|
</when>
|
|
|
<when test = "tabValue == 3">
|
|
<when test = "tabValue == 3">
|
|
|
- AND (fs_user_course_count.status = 3 or fs_user_course_count.status is null)
|
|
|
|
|
|
|
+ AND (fcc.status = 3 or fcc.status is null)
|
|
|
</when>
|
|
</when>
|
|
|
</choose>
|
|
</choose>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="watchCourseType != null and watchCourseType !='' ">
|
|
<if test="watchCourseType != null and watchCourseType !='' ">
|
|
|
<choose>
|
|
<choose>
|
|
|
<when test = "watchCourseType == 1">
|
|
<when test = "watchCourseType == 1">
|
|
|
- AND (fs_user_course_count.status = 3 or fs_user_course_count.status is null)
|
|
|
|
|
|
|
+ AND (fcc.status = 3 or fcc.status is null)
|
|
|
</when>
|
|
</when>
|
|
|
<when test = "watchCourseType == 2">
|
|
<when test = "watchCourseType == 2">
|
|
|
- AND fs_user_course_count.status = 1
|
|
|
|
|
|
|
+ AND fcc.status = 1
|
|
|
</when>
|
|
</when>
|
|
|
<when test = "watchCourseType == 3">
|
|
<when test = "watchCourseType == 3">
|
|
|
- AND fs_user_course_count.status = 2
|
|
|
|
|
|
|
+ AND fcc.status = 2
|
|
|
</when>
|
|
</when>
|
|
|
</choose>
|
|
</choose>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="missCourseStatus != null and missCourseStatus !='' ">
|
|
<if test="missCourseStatus != null and missCourseStatus !='' ">
|
|
|
<choose>
|
|
<choose>
|
|
|
<when test = "missCourseStatus == 1">
|
|
<when test = "missCourseStatus == 1">
|
|
|
- AND fs_user_course_count.miss_course_status = 1
|
|
|
|
|
|
|
+ AND fcc.miss_course_status = 1
|
|
|
</when>
|
|
</when>
|
|
|
<when test = "missCourseStatus == 2">
|
|
<when test = "missCourseStatus == 2">
|
|
|
- AND (fs_user_course_count.miss_course_status = 2 or fs_user_course_count.miss_course_status is null )
|
|
|
|
|
|
|
+ AND (fcc.miss_course_status = 2 or fcc.miss_course_status is null )
|
|
|
</when>
|
|
</when>
|
|
|
</choose>
|
|
</choose>
|
|
|
</if>
|
|
</if>
|
|
@@ -357,13 +360,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
order by
|
|
order by
|
|
|
<choose>
|
|
<choose>
|
|
|
<when test = "continueMissCourseSort != null and continueMissCourseSort == 0">
|
|
<when test = "continueMissCourseSort != null and continueMissCourseSort == 0">
|
|
|
- fs_user_company_user.create_time desc,fs_user.user_id desc
|
|
|
|
|
|
|
+ fs_user_company_user.create_time desc,fs_user_company_user.user_id desc
|
|
|
</when>
|
|
</when>
|
|
|
<when test = "continueMissCourseSort != null and continueMissCourseSort == 1">
|
|
<when test = "continueMissCourseSort != null and continueMissCourseSort == 1">
|
|
|
- fs_user.nick_name asc,fs_user.user_id desc
|
|
|
|
|
|
|
+ fs_user.nick_name asc,fs_user_company_user.user_id desc
|
|
|
</when>
|
|
</when>
|
|
|
<otherwise>
|
|
<otherwise>
|
|
|
- fs_user.user_id desc, fs_user_company_user.project_id
|
|
|
|
|
|
|
+ fs_user_company_user.user_id desc, fs_user_company_user.project_id
|
|
|
</otherwise>
|
|
</otherwise>
|
|
|
</choose>
|
|
</choose>
|
|
|
</select>
|
|
</select>
|