班级实验实现

hehai
mzh820631607 4 years ago
parent 0ee0777934
commit 769d0968a6
  1. 2
      src/main/java/com/msdw/tms/api/ClassTeachingApi.java
  2. 5
      src/main/java/com/msdw/tms/controller/ClassTeachingController.java
  3. 4
      src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java
  4. 2
      src/main/resources/mapper/tms/ClassTeachingDao.xml

@ -14,7 +14,7 @@ public interface ClassTeachingApi {
@ApiOperation(value = "查询班级实验列表信息",notes = "查询班级实验列表信息")
R queryTestRecord(Integer page, Integer size, Integer month, String startTime, String endTime,
String condition, Integer status, Integer isCode);
String condition, Integer status, Integer isCode,Integer isUserId);
@ApiOperation(value = "查看成绩",notes = "查看成绩")
R queryAchievement();

@ -33,9 +33,8 @@ public class ClassTeachingController implements ClassTeachingApi {
@Override
@GetMapping("userRecord")
public R queryTestRecord(@RequestParam Integer page, @RequestParam Integer size, Integer month,@RequestParam String startTime,@RequestParam String endTime,
String condition, @RequestParam Integer status,@RequestParam Integer isCode){
String condition, @RequestParam Integer status,@RequestParam Integer isCode,@RequestParam Integer isUserId){
ProjectRecordVo recordVo = new ProjectRecordVo();
ExperimentalTeachingEntity entity = new ExperimentalTeachingEntity();
if (isCode==0){
if (status!=0) {//不限定实验状态
recordVo.setStatus(status);
@ -53,7 +52,7 @@ public class ClassTeachingController implements ClassTeachingApi {
recordVo.setEndTime(endTime);
}
}
recordVo.setIsCode(isCode);
recordVo.setIsCode(isCode).setUserId(isUserId);
PageUtils page1 = classTeachingService.queryClassRecord(page,size,recordVo);
return R.ok().put("page", page1);
}else if (isCode==1){

@ -71,6 +71,10 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable
* 是否启用邀请码
*/
private Integer isCode;
/**
* 绑定用户id
*/
private Integer userId;
// /**
// * 班级实验状态,0 不限,1 未发布,2 进行中,3 已完成

@ -21,9 +21,11 @@
WHERE
`status` = #{cla.status}
and is_code = #{cla.isCode}
and user_id = #{cla.userId}
<if test="cla.condition!=null">and ( project_name like concat('%',#{cla.condition},'%') or experimental_class_name like concat('%',#{cla.condition},'%') )</if>
<if test="cla.startTime!=null and cla.endTime!=null">and stop_time between #{cla.endTime} and #{cla.startTime}</if>
<if test="cla.month!=null">and DATE_SUB(CURDATE(), INTERVAL #{cla.month} month ) &lt;= date(stop_time)</if>
</select>
<!-- <if test="cla.condition!=null">and ( project_name like concat('%',#{cla.condition},'%') or experimental_class_name like concat('%',#{cla.condition},'%') )</if>-->
</mapper>
Loading…
Cancel
Save