修复 sql

beetlsql3-dev
Mlxa0324 2 years ago
parent 438c2f15bd
commit 8564688095

@ -1610,7 +1610,7 @@ queryStudentLoginLogByCondition
END
) AS online_duration,
@// 是否在线规则: 登录次数 取余和1做对比
count( 1 ) % 2 = 1 AS is_on_line,
(count( 1 ) % 2 = 1 AND any_value(ta.create_time) >= CURDATE()) AS is_on_line,
@// 会从多个地方登录这里只是随机取一个IP确保单条唯一
any_value(ta.ip) as ip,
@// 登录次数
@ -1662,15 +1662,15 @@ queryStudentLoginLogByCondition
@if(!isEmpty(universitiesCollegesId)) {
and td.universities_colleges_id = #universitiesCollegesId#
@}
@if(!isEmpty(isOnLine)) {
and (count( 1 ) % 2 = 1) = #isOnLine#
@}
GROUP BY
tc.`code`,
tc.`name`,
td.universities_colleges_name,
td.universities_colleges_province,
td.class_name
@if(!isEmpty(isOnLine)) {
having (count( 1 ) % 2 = 1) = #isOnLine#
@}
) z
order by z.login_time desc

Loading…
Cancel
Save