|
|
@@ -2273,22 +2273,19 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les |
|
|
|
var deptNo = queryParam["deptNo"] == null ? string.Empty : queryParam["deptNo"].ToString(); |
|
|
|
string starttime = queryParam["StartTime"].IsEmpty() ? DateTime.Now.Date.ToString() : queryParam["StartTime"].ToString(); |
|
|
|
string endtime = queryParam["EndTime"].IsEmpty() ? DateTime.Now.Date.ToString() : queryParam["EndTime"].ToString(); |
|
|
|
strSql.Append("select a.*,b.jobrank as zhiwu,b.F_DepartmentId as dept,b.feestandard,b.Weekcourses,ta.actcourses as monthactcourses,ta.actcourses-(" + weeks + "*b.Weekcourses) as zhesuan_monthactcourses, "); |
|
|
|
strSql.Append(" case when b.jobrank in(5,6) then (ta.actcourses-" + weeks + "*b.Weekcourses)*b.feestandard "); |
|
|
|
strSql.Append("select a.*,b.jobrank as zhiwu,b.ProfessionalTitle as zhicheng,b.F_DepartmentId as dept,b.feestandard,b.Weekcourses,ta.actcourses as monthactcourses,ta.actcourses-(" + weeks + "*b.Weekcourses) as zhesuan_monthactcourses, "); |
|
|
|
strSql.Append(" case when ta.actcourses is null then 0 when b.jobrank in(5,6) then (ta.actcourses-" + weeks + "*b.Weekcourses)*b.feestandard "); |
|
|
|
strSql.Append(" when b.jobrank in(1,2,3,4) then (case when ta.actcourses<=(" + weeks + "*b.weekcourses)/2 then ta.actcourses*b.feestandard else " + weeks + "*b.weekcourses*b.feestandard/2 end) "); |
|
|
|
strSql.Append(" else 0 end as actfeestandard "); |
|
|
|
strSql.Append("from "); |
|
|
|
if (string.IsNullOrWhiteSpace(deptNo)) |
|
|
|
{ |
|
|
|
strSql.Append("(select count(*) as courses,a.empno,a.empname from ArrangeLessonTerm a where lessondate between '" + starttime + "' and '" + endtime + "' group by a.empno,a.empname ) a "); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
strSql.Append("(select count(*) as courses,a.empno,a.empname from ArrangeLessonTerm a where DeptNo='" + deptNo + "' and lessondate between '" + starttime + "' and '" + endtime + "' group by a.empno,a.empname ) a "); |
|
|
|
} |
|
|
|
strSql.Append("(select count(*) as courses,a.empno,a.empname from ArrangeLessonTerm a where lessondate between '" + starttime + "' and '" + endtime + "' group by a.empno,a.empname ) a "); |
|
|
|
strSql.Append("left join (select count(*) as actcourses,EmpNo from (select ff.EmpNo,ff.LessonDate,ff.LessonTime from (select aall.* from (select EmpNo,ALTId from Teach_attendance where LessonSortNo='1' and clocktime between '" + starttime + "' and '" + endtime + "' group by EmpNo,ALTId) ee left join ArrangeLessonTerm aall on aall.ALTId=ee.ALTId) ff group by ff.EmpNo,ff.LessonDate,ff.LessonTime) gg group by gg.EmpNo ) ta on ta.empno=a.empno "); |
|
|
|
strSql.Append("left join empinfo b on a.empno=b.empno "); |
|
|
|
strSql.Append("where a.empno is not null "); |
|
|
|
strSql.Append("where a.empno is not null "); |
|
|
|
if (!string.IsNullOrEmpty(deptNo)) |
|
|
|
{ |
|
|
|
strSql.Append("and b.F_DepartmentId='" + deptNo + "' "); |
|
|
|
} |
|
|
|
return this.BaseRepository("CollegeMIS").FindList<LessonStatictisEntity>(strSql.ToString(), pagination); |
|
|
|
|
|
|
|
} |
|
|
|