|
|
@@ -600,5 +600,60 @@ where 1=1 "); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void Clean(string vid) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
var misdbname = BaseRepository("CollegeMIS").getDbConnection().Database; |
|
|
|
string sql = @" |
|
|
|
|
|
|
|
select aa.LessonNo,aa.EmpNo,aa.VID,aa.StuNo,bb.IScore,bb.UID,cc.EmpName,aa.LessonName,ee.StuName |
|
|
|
from |
|
|
|
( |
|
|
|
select a.LessonNo,a.LessonName,a.EmpNo,a.AcademicYearNo,a.Semester,b.VID,a.StuNo |
|
|
|
from "+ misdbname + @".dbo.StuSelectLessonList a |
|
|
|
left join Eval_Main b on a.AcademicYearNo=b.AcademicYearNo and a.Semester=b.Semester |
|
|
|
where b.Status=1 and b.VID='"+ vid + @"' |
|
|
|
and a.StuNo is not null and a.StuNo <> '' |
|
|
|
and a.StuNo not in (select StuNo from " + misdbname + @".dbo.StuInfoBasic where ChangeStatus=1) |
|
|
|
) aa |
|
|
|
left join |
|
|
|
( |
|
|
|
select sum(b.IScore) as IScore, a.EmpNo, a.LessonNo, a.UID |
|
|
|
from Eval_QuestionResult a |
|
|
|
left join Eval_QuestionItems b on a.IID = b.IID |
|
|
|
left join Eval_Question c on a.QID=c.QID |
|
|
|
where c.VID='"+ vid + @"' |
|
|
|
and a.EmpNo is not null and a.EmpNo <> '' and a.LessonNo is not null and a.LessonNo <> '' and a.UID is not null and a.UID <> '' |
|
|
|
group by a.EmpNo, a.LessonNo, a.UID |
|
|
|
) bb |
|
|
|
on aa.EmpNo=bb.EmpNo and aa.LessonNo=bb.LessonNo and aa.StuNo=bb.UID |
|
|
|
left join " + misdbname + @".dbo.EmpInfo cc on aa.EmpNo=cc.EmpNo |
|
|
|
left join " + misdbname + @".dbo.StuInfoBasic ee on aa.StuNo = ee.StuNo |
|
|
|
where 1=1 and iscore>100 order by IScore desc"; |
|
|
|
var list= this.BaseRepository().FindList<Eval_QuestionResultEntity>(sql); |
|
|
|
foreach (var item in list) |
|
|
|
{ |
|
|
|
var questionlist= this.BaseRepository().FindList<Eval_QuestionEntity>("select * from Eval_Question where vid='"+ vid + "'"); |
|
|
|
foreach (var questionEntity in questionlist) |
|
|
|
{ |
|
|
|
string sql2 = @"select b.* from Eval_Question a left join Eval_QuestionResult b on a.QID=b.QID |
|
|
|
where a.vid='"+ vid + "' and b.LessonNo='" + item.LessonNo + "'" + |
|
|
|
" and b.EmpNo='" + item.EmpNo + "' and b.uid='" + item.StuNo + "' and b.qid='"+questionEntity.QID+"'"; |
|
|
|
List<Eval_QuestionResultEntity> Eval_QuestionResultlist = this.BaseRepository().FindList<Eval_QuestionResultEntity>(sql2).ToList(); |
|
|
|
for (int i = 0; i < Eval_QuestionResultlist.Count()-1; i++) |
|
|
|
{ |
|
|
|
string rid = Eval_QuestionResultlist[i].RID; |
|
|
|
BaseRepository().Delete<Eval_QuestionResultEntity>(t=>t.RID== rid); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception e) |
|
|
|
{ |
|
|
|
Console.WriteLine(e); |
|
|
|
throw; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |