@@ -1217,11 +1217,13 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest
if (userType == "学生")
if (userType == "学生")
{
{
sql = @"SELECT
sql = @"SELECT
b.LessonNo,b.AcademicYearNo as AcademicYear,b.LessonName,b.LessonTime,b.LessonDate,b.Empname EmpName,b.EmpNo,c.ClassroomName,b.Semester,b.ClassroomNo as ClassRoomNo,b.LessonSortNo,d.ClassName,e.EnName from StuSelectLessonList a
b.LessonNo,b.AcademicYearNo as AcademicYear,b.LessonName,b.LessonTime,b.LessonDate,b.Empname EmpName,b.EmpNo,c.ClassroomName,b.Semester,b.ClassroomNo as ClassRoomNo,b.LessonSortNo,d.ClassName,e.EnName,sa.AttendOrNo,sa.Sort
from StuSelectLessonList a
left join ArrangeLessonTerm b on b.TeachClassNo=RTRIM(a.LessonName) + RTRIM(a.PartCode) + RTRIM(a.TeachClassNo)
left join ArrangeLessonTerm b on b.TeachClassNo=RTRIM(a.LessonName) + RTRIM(a.PartCode) + RTRIM(a.TeachClassNo)
left join ClassroomInfo c on c.ClassroomNo=b.classroomNo
left join ClassroomInfo c on c.ClassroomNo=b.classroomNo
left join ClassInfo d on replace(b.TeachClassNo,b.LessonName,'')=d.ClassNo
left join ClassInfo d on replace(b.TeachClassNo,b.LessonName,'')=d.ClassNo
left join LessonInfo e on a.LessonNo=e.LessonNo
left join LessonInfo e on a.LessonNo=e.LessonNo
left join StuAttendance sa on b.ALTId=sa.ALTId and sa.StuNo=@userAccount
where a.StuNo=@userAccount and a.AcademicYearNo=@strAcademicYear and a.Semester=@strSemester
where a.StuNo=@userAccount and a.AcademicYearNo=@strAcademicYear and a.Semester=@strSemester
and b.AcademicYearNo=@strAcademicYear and b.Semester=@strSemester
and b.AcademicYearNo=@strAcademicYear and b.Semester=@strSemester
and b.LessonDate>=@startDate and b.LessonDate<=@endDate and b.CheckMark=1";
and b.LessonDate>=@startDate and b.LessonDate<=@endDate and b.CheckMark=1";
@@ -2242,6 +2244,14 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les
// and a.AcademicYearNo=@strAcademicYear and a.Semester=@strSemester
// and a.AcademicYearNo=@strAcademicYear and a.Semester=@strSemester
// and a.LessonDate >= @startDate and a.LessonDate <=@endDate
// and a.LessonDate >= @startDate and a.LessonDate <=@endDate
// and a.CheckMark='1'";
// and a.CheckMark='1'";
sql = @" select e.EnName,a.LessonDate,a.AcademicYearNo as AcademicYear,a.Semester,a.LessonNo,e.LessonName,a.LessonSection as LessonTime,a.EmpNo,emp.EmpName,cr.ClassroomName,a.ClassRoomNo,a.LessonSortNo,ccc.olpoeid as OLPEId
sql = @" select e.EnName,a.LessonDate,a.AcademicYearNo as AcademicYear,a.Semester,a.LessonNo,e.LessonName,a.LessonSection as LessonTime,a.EmpNo,emp.EmpName,cr.ClassroomName,a.ClassRoomNo,a.LessonSortNo,ccc.olpoeid as OLPEId,sa.AttendOrNo,sa.Sort
from
from
(select olpoeid from ElectiveMergeItem
(select olpoeid from ElectiveMergeItem
where emid in (select emid from ElectiveMergeItem aa left
where emid in (select emid from ElectiveMergeItem aa left
ArrangeLessonTermOfElective a on ccc.olpoeid = a.PaiKeId
ArrangeLessonTermOfElective a on ccc.olpoeid = a.PaiKeId
left join LessonInfo e on a.LessonNo=e.LessonNo
left join LessonInfo e on a.LessonNo=e.LessonNo
left join EmpInfo emp on a.EmpNo=emp.EmpNo
left join EmpInfo emp on a.EmpNo=emp.EmpNo
left join ClassroomInfo cr on a.ClassRoomNo=cr.ClassroomNo
left join ClassroomInfo cr on a.ClassRoomNo=cr.ClassroomNo
left join StuAttendance sa on a.Id=sa.ALTOEId and sa.StuNo=@userAccount
where
where
a.AcademicYearNo = @strAcademicYear and a.Semester = @strSemester
a.AcademicYearNo = @strAcademicYear and a.Semester = @strSemester
and a.LessonDate >= @startDate and a.LessonDate <=@endDate
and a.LessonDate >= @startDate and a.LessonDate <=@endDate
and a.CheckMark = '1'
and a.CheckMark = '1'
union
union
select e.EnName,a.LessonDate,a.AcademicYearNo as AcademicYear,a.Semester,a.LessonNo,e.LessonName,a.LessonSection as LessonTime,a.EmpNo,emp.EmpName,cr.ClassroomName,a.ClassRoomNo,a.LessonSortNo,b.OLPEId
select e.EnName,a.LessonDate,a.AcademicYearNo as AcademicYear,a.Semester,a.LessonNo,e.LessonName,a.LessonSection as LessonTime,a.EmpNo,emp.EmpName,cr.ClassroomName,a.ClassRoomNo,a.LessonSortNo,b.OLPEId,sa.AttendOrNo,sa.Sort
from StuSelectLessonListOfElective b
from StuSelectLessonListOfElective b
left join ArrangeLessonTermOfElective a on b.OLPEId=a.PaiKeId
left join ArrangeLessonTermOfElective a on b.OLPEId=a.PaiKeId
left join LessonInfo e on a.LessonNo=e.LessonNo
left join LessonInfo e on a.LessonNo=e.LessonNo
left join EmpInfo emp on a.EmpNo=emp.EmpNo
left join EmpInfo emp on a.EmpNo=emp.EmpNo
left join ClassroomInfo cr on a.ClassRoomNo=cr.ClassroomNo
left join ClassroomInfo cr on a.ClassRoomNo=cr.ClassroomNo
left join StuAttendance sa on a.Id=sa.ALTOEId and sa.StuNo=@userAccount
where b.StuNo=@userAccount and b.Status=2
where b.StuNo=@userAccount and b.Status=2
and b.AcademicYearNo=@strAcademicYear and b.Semester=@strSemester
and b.AcademicYearNo=@strAcademicYear and b.Semester=@strSemester
and a.AcademicYearNo=@strAcademicYear and a.Semester=@strSemester
and a.AcademicYearNo=@strAcademicYear and a.Semester=@strSemester