活跃信息,学习时长,暂时假数据。

beetlsql3-dev
Mlxa0324 2 years ago
parent cc6dd37d63
commit 59a6df5c8b

@ -82,6 +82,6 @@ public interface StudentDao extends BaseMapper<Student>{
*/
Student getStudentByStudentEditPasswordDTO(StudentEditPasswordDTO dto);
StudentActiveInfo studentActiveInfo(Long studentId);
StudentActiveInfo studentActiveInfo(Long studentId, Long userId);
}

@ -18,11 +18,11 @@ public class StudentActiveInfo extends BaseEntity {
/**
*
*/
private String platformRankNo;
private Integer platformRankNo;
/**
*
*/
private String classRankNo;
private Integer classRankNo;
/**
*
*/

@ -227,7 +227,7 @@ public class ApiStudentService {
public StudentActiveInfo studentActiveInfo() {
Student student = getStudent();
Assert.notNull(student, "该接口只能学生查看!");
return studentDao.studentActiveInfo(student.getStudentId());
return studentDao.studentActiveInfo(student.getStudentId(), null);
}
public StudentUserCenterData userCenter() {

@ -1466,12 +1466,112 @@ getStudentByStudentEditPasswordDTO
studentActiveInfo
===
* 学生端-活跃度信息
select
'0天10小时2分钟' as study_duration,
230 as platform_rank_no,
10 as class_rank_no,
20 as login_days,
'该数据仅用于测试' as data_type
SELECT
student_id,
student_name,
student_sn,
'0天10小时2分钟' AS study_duration,
(
SELECT
zz.rk
FROM
(
SELECT
z.*,
\@platformRank := \@platformRank + 1 AS rk
FROM
(
SELECT
t.id,
t.`name`,
ta.class_id,
ta.class_name,
t.login_count,
t.last_login_time,
t.org_id
FROM
core_user t,
student tb,
school_class ta
WHERE
t.id != 1
AND ta.class_id = tb.class_id
AND tb.user_id = t.id
AND t.job_type1 = 'JT_S_03'
AND t.`state` = 'S1'
AND DEL_FLAG = 0
ORDER BY
login_count DESC,
last_login_time DESC
) z,
( SELECT \@platformRank := 0 ) AS rk
WHERE
1
@// 平台排序不需要给班级ID的条件 AND z.class_id = zxc.class_id
AND z.org_id = zxc.org_id
) zz
WHERE
1
AND zz.id = zxc.user_id
) AS platform_rank_no,
(
SELECT
zz.rk
FROM
(
SELECT
z.*,
\@classRank := \@classRank + 1 AS rk
FROM
(
SELECT
t.id,
t.`name`,
ta.class_id,
ta.class_name,
t.login_count,
t.last_login_time,
t.org_id
FROM
core_user t,
student tb,
school_class ta
WHERE
t.id != 1
AND ta.class_id = tb.class_id
AND tb.user_id = t.id
AND t.job_type1 = 'JT_S_03'
AND t.`state` = 'S1'
AND DEL_FLAG = 0
ORDER BY
login_count DESC,
last_login_time DESC
) z,
( SELECT \@classRank := 0 ) AS rk
WHERE
1
AND z.class_id = zxc.class_id
AND z.org_id = zxc.org_id
) zz
WHERE
1
AND zz.id = zxc.user_id
) AS class_rank_no,
( SELECT t.login_count FROM core_user t WHERE t.id = zxc.user_id LIMIT 1 ) AS login_days
FROM
( SELECT user_id, org_id, class_id, student_name, student_sn, student_id FROM student WHERE 1
@if(!isEmpty(userId)) {
and user_id = #userId#
@}
@if(!isEmpty(studentId)) {
and student_id = #studentId#
@}
@if(isEmpty(userId) && isEmpty(studentId)) {
and 1 != 1
@}
LIMIT 1 ) zxc
queryStudentLoginLogByCondition

@ -614,7 +614,7 @@ analysisOld
round( avg( SUM( CASE WHEN ta.student_score > 0 THEN 1 ELSE 0 END ) ), 2 ) AS avg_correct_count,
round( avg( SUM( CASE WHEN ta.student_score <= 0 THEN 1 ELSE 0 END ) ), 2 ) AS avg_wrong_count,
round( SUM( ifnull( ta.student_score, 0 )) / count( distinct( ta.student_id ) ) , 2 ) AS avg_student_score,
SUM( (SUM( t.student_score over(partition by )) ) > (SUM( t.question_score ) * ifnull(td.pass_rate, 0.6) ) ) / SUM( distinct( t.student_id ) ) * 100 AS pass_rate
SUM( (SUM( t.student_score over()) ) > (SUM( t.question_score ) * ifnull(td.pass_rate, 0.6) ) ) / SUM( distinct( t.student_id ) ) * 100 AS pass_rate
count(
DISTINCT ( tc.school_class_id )) total_school_class_count
FROM

Loading…
Cancel
Save