|
|
|
@ -251,6 +251,31 @@ deleteById1
|
|
|
|
|
===
|
|
|
|
|
delete from core_user where ID = #userId#
|
|
|
|
|
|
|
|
|
|
getUsersBySchoolId
|
|
|
|
|
getUserInfoByUsername
|
|
|
|
|
===
|
|
|
|
|
select
|
|
|
|
|
select cu.CODE as username,
|
|
|
|
|
cu.PASSWORD as password,
|
|
|
|
|
cu.NAME as name,
|
|
|
|
|
cu.old_id as userId,
|
|
|
|
|
if(cur.ROLE_ID = 192, 4, 3) as roleId,
|
|
|
|
|
uc.old_school_id as schoolId,
|
|
|
|
|
uc.universities_colleges_name as schoolName,
|
|
|
|
|
sc.old_class_id as classId,
|
|
|
|
|
sc.class_name as className,
|
|
|
|
|
IF(s.student_mobile IS NULL, t.teacher_mobile, s.student_mobile) as phone,
|
|
|
|
|
IF(uf.old_id is null, uf1.old_id, uf.old_id) as collegeId,
|
|
|
|
|
IF(uf.university_faculty_name is null, uf1.university_faculty_name, uf.university_faculty_name) as collegeName,
|
|
|
|
|
IF(us.old_id is null, us1.old_id, us.old_id) as majorId,
|
|
|
|
|
IF(us.university_system_name is null, us1.university_system_name, us.university_system_name) as majorName
|
|
|
|
|
from core_user cu
|
|
|
|
|
join universities_colleges uc on cu.ORG_ID = uc.org_id
|
|
|
|
|
left join student s on cu.ID = s.user_id
|
|
|
|
|
left join teacher t on cu.ID = t.user_id
|
|
|
|
|
left join school_class sc on s.class_id = sc.class_id
|
|
|
|
|
left join university_faculty uf on t.university_faculty_id = uf.university_faculty_id
|
|
|
|
|
left join university_faculty uf1 on sc.university_faculty_id = uf1.university_faculty_id
|
|
|
|
|
left join university_system us on t.university_system_id = us.university_system_id
|
|
|
|
|
left join university_system us1 on sc.university_system_id = us1.university_system_id
|
|
|
|
|
left join core_user_role cur on cu.ID = cur.USER_ID
|
|
|
|
|
where cu.CODE = #username#
|
|
|
|
|
and cur.ROLE_ID in (192, 194)
|