"SELECT a.id,a.assesmentName as assesmentName,a.assessmentSize as assessmentSize,p.projectName as projectName,a.timeSum as timeSum,GROUP_CONCAT(c.className) as className,"
+"a.releaseType as releaseType,a.creationTime as creationTime,a.endTime as endTime,a.assesmentState as assesmentState FROM "
+"(assessment a left join hr_project_management p on a.experimentId=p.projectId ) left join class c on FIND_IN_SET(c.classId,a.classId )>0 "
+"WHERE a.staffId=#{staffId} AND a.courseId=#{courseId} ",
" <if test='creationTime!=null and endTime!=null and endTime!=\"\" and creationTime!=\"\" '> and a.creationTime between #{creationTime} and #{endTime}</if>",
@Insert("insert into assessment (assesmentName,releaseType,creationTime,endTime,timesum,experimentId,classId,assesmentState,assessmentSize,experimentalClassId,staffId,courseId,assessmentNumber)"
@Update("update assessment set assesmentName=#{assesmentName},releaseType=#{releaseType},creationTime=#{creationTime},endTime=#{endTime},timesum=#{timesum},assessmentSize=#{assessmentSize},assessmentNumber=#{assessmentNumber}"
+"experimentId=#{experimentId},assesmentState=#{assesmentState},classId=#{classId},experimentalClassId=#{experimentalClassId} where id=#{id}")
voidupdateAssesment(Assesmentassesment);
/**
*添加考核记录
*/
@Insert({"<script>",
"insert into record (projectId,courseId,studentId,assesmentId) values"
@Select("SELECT stu.studentId as studentId,studentName as studentName FROM record re,student stu WHERE re.studentId=stu.studentId AND re.assesmentId=#{assesmentId}")
List<Student>queryStudent(IntegerassesmentId);
/**
*删除多余的记录信息
*@paramassesmentId
*@paramstudents
*/
@Delete({"<script>","delete from record where assesmentId=#{assesmentId} and studentId in",
@Select("select experimentalClassId,experimentalClassName from experimental_class_ning where isdel=0 and creationTime=#{creationTime} and schoolId = #{schoolId})")
@Select("SELECT ass.assesmentName as assesmentName ,ass.creationTime as creationTime,ass.endTime as endTime,ass.assessmentSize as assessmentSize,count(re.score) as actualNumber,st.staffName as staffName "
+" FROM (assessment ass left join staff st on ass.staffId=st.staffId) left join record re on ass.id=re.assesmentId WHERE ass.id=#{assesmentId} and re.score is not null")
AssesmentqueryAssesmentId(IntegerassesmentId);
/**
*实验班级
*@paramassesmentId
*@return
*/
@Select("SELECT ex.experimentalClassId as experimentalClassId,ex.experimentalClassName as experimentalClassName from assessment ass left join"
+" experimental_class_ning ex on ex.experimentalClassId=ass.experimentalClassId where ass.id=#{assesmentId}")
@Select("SELECT c.classId as classId,c.className as className from assessment ass left join class c on FIND_IN_SET(c.classId,ass.classId) where ass.id=#{assesmentId}")
List<SutdentClass>queryClass(IntegerassesmentId);
/**
*查询成绩(升序)
*@paramassesmentId
*@paramexperimentalClassId
*@paramclassId
*@return
*/
@Select({"<script>",
"select re.score FROM (record re left join assessment ass on ass.id=re.assesmentId) left join student stu on re.studentId=stu.studentId "
"select re.score as score,count(re.recordId) as number FROM (record re left join assessment ass on ass.id=re.assesmentId) left join student stu on re.studentId=stu.studentId "
+" where re.assesmentId=#{assesmentId} ",
" <if test=' experimentalClassId!=null '> and FIND_IN_SET(#{experimentalClassId},stu.experimentalClassId) </if>",
" <if test=' classId!=null '>"
+"<foreach collection='classId' item='id' open='and stu.classId in (' separator=',' close=')'>#{id}</foreach>"
@Select("select count(judgmentPointsId) from hr_judgment_points where FIND_IN_SET(#{projectId},projectId)")
IntegerqueryPointNumber(IntegerprojectId);
/**
*错误分布
*@paramassesmentId
*@paramexperimentalClassId
*@paramclassId
*@return
*/
@Select({"<script>",
"select judgmentPointsName,count(pr.judgmentPointsId) as number from PointRecord pr left join hr_judgment_points jp on pr.judgmentPointsId=jp.judgmentPointsId where rightAndWrong=-1 and assesmentId=#{assesmentId} ",
" <if test='experimentalClassId!=null '> and experimentalClassId=#{experimentalClassId}</if>",
" <if test='classId!=null '>"
+"<foreach collection='classId' item='id' open='and classId in (' separator=',' close=')'>#{id} </foreach>"
"select stu.studentName as studentName,re.score as score FROM (record re left join assessment ass on ass.id=re.assesmentId) left join student stu on re.studentId=stu.studentId "
"SELECT a.id,a.assesmentName as assesmentName,a.assessmentSize as assessmentSize,p.projectName as projectName,a.timeSum as timeSum,GROUP_CONCAT(c.className) as className,"
+"a.releaseType as releaseType,a.creationTime as creationTime,a.endTime as endTime,a.assesmentState as assesmentState FROM "
+"(assessment a left join hr_project_management p on a.experimentId=p.projectId ) left join class c on FIND_IN_SET(c.classId,a.classId )>0 "
+"WHERE a.staffId=#{staffId} AND a.courseId=#{courseId} ",
" <if test='creationTime!=null and endTime!=null and endTime!=\"\" and creationTime!=\"\" '> and a.creationTime between #{creationTime} and #{endTime}</if>",
@Insert("insert into assessment (assesmentName,releaseType,creationTime,endTime,timesum,experimentId,classId,assesmentState,assessmentSize,experimentalClassId,staffId,courseId,assessmentNumber)"
@Update("update assessment set assesmentName=#{assesmentName},releaseType=#{releaseType},creationTime=#{creationTime},endTime=#{endTime},timesum=#{timesum},assessmentSize=#{assessmentSize},assessmentNumber=#{assessmentNumber}"
+"experimentId=#{experimentId},assesmentState=#{assesmentState},classId=#{classId},experimentalClassId=#{experimentalClassId} where id=#{id}")
voidupdateAssesment(Assesmentassesment);
/**
*添加考核记录
*/
@Insert({"<script>",
"insert into record (projectId,courseId,studentId,assesmentId) values"
@Select("SELECT stu.studentId as studentId,studentName as studentName FROM record re,student stu WHERE re.studentId=stu.studentId AND re.assesmentId=#{assesmentId}")
List<Student>queryStudent(IntegerassesmentId);
/**
*删除多余的记录信息
*
*@paramassesmentId
*@paramstudents
*/
@Delete({"<script>","delete from record where assesmentId=#{assesmentId} and studentId in",
@Select("select creationTime from experimental_class_ning WHERE isdel=0 and founder=(select staffName from staff where staffId=#{staffId}) GROUP BY creationTime ORDER BY creationTime desc")
List<String>queryCreationTime(IntegerstaffId);
/**
*查询实验班级信息,及班级下的学生
*
*@paramcreationTime
*@return
*/
@Select("select experimentalClassId,experimentalClassName from experimental_class_ning where isdel=0 and creationTime=#{creationTime} and founder=(select staffName from staff where staffId=#{staffId})")
@Select("SELECT ass.assesmentName as assesmentName ,ass.creationTime as creationTime,ass.endTime as endTime,ass.assessmentSize as assessmentSize,count(re.score) as actualNumber,st.staffName as staffName "
+" FROM (assessment ass left join staff st on ass.staffId=st.staffId) left join record re on ass.id=re.assesmentId WHERE ass.id=#{assesmentId} and re.score is not null")
AssesmentqueryAssesmentId(IntegerassesmentId);
/**
*实验班级
*
*@paramassesmentId
*@return
*/
@Select("SELECT ex.experimentalClassId as experimentalClassId,ex.experimentalClassName as experimentalClassName from assessment ass left join"
+" experimental_class_ning ex on ex.experimentalClassId=ass.experimentalClassId where ass.id=#{assesmentId}")
@Select("SELECT c.classId as classId,c.className as className from assessment ass left join class c on FIND_IN_SET(c.classId,ass.classId) where ass.id=#{assesmentId}")
List<SutdentClass>queryClass(IntegerassesmentId);
/**
*查询成绩(升序)
*
*@paramassesmentId
*@paramexperimentalClassId
*@paramclassId
*@return
*/
@Select({"<script>",
"select re.score FROM (record re left join assessment ass on ass.id=re.assesmentId) left join student stu on re.studentId=stu.studentId "
"select re.score as score,count(re.recordId) as number FROM (record re left join assessment ass on ass.id=re.assesmentId) left join student stu on re.studentId=stu.studentId "
+" where re.assesmentId=#{assesmentId} ",
" <if test=' experimentalClassId!=null '> and FIND_IN_SET(#{experimentalClassId},stu.experimentalClassId) </if>",
" <if test=' classId!=null '>"
+"<foreach collection='classId' item='id' open='and stu.classId in (' separator=',' close=')'>#{id}</foreach>"
@Select("select count(judgmentPointsId) from hr_judgment_points where FIND_IN_SET(#{projectId},projectId)")
IntegerqueryPointNumber(IntegerprojectId);
/**
*错误分布
*
*@paramassesmentId
*@paramexperimentalClassId
*@paramclassId
*@return
*/
@Select({"<script>",
"select judgmentPointsName,count(pr.judgmentPointsId) as number from PointRecord pr left join hr_judgment_points jp on pr.judgmentPointsId=jp.judgmentPointsId where rightAndWrong=-1 and assesmentId=#{assesmentId} ",
" <if test='experimentalClassId!=null '> and experimentalClassId=#{experimentalClassId}</if>",
" <if test='classId!=null '>"
+"<foreach collection='classId' item='id' open='and classId in (' separator=',' close=')'>#{id} </foreach>"
"select stu.studentName as studentName,re.score as score FROM (record re left join assessment ass on ass.id=re.assesmentId) left join student stu on re.studentId=stu.studentId "