班级实验实现

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 = "查询班级实验列表信息") @ApiOperation(value = "查询班级实验列表信息",notes = "查询班级实验列表信息")
R queryTestRecord(Integer page, Integer size, Integer month, String startTime, String endTime, 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 = "查看成绩") @ApiOperation(value = "查看成绩",notes = "查看成绩")
R queryAchievement(); R queryAchievement();

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

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

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