上传代码

hehai
zhiyong.ning 4 years ago
parent a800fc3da8
commit e514449751
  1. 9
      src/main/java/com/msdw/tms/api/ExperimentalTeachingControllerApi.java
  2. 29
      src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java
  3. 2
      src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java
  4. 5
      src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java
  5. 2
      src/main/resources/mapper/tms/ClassTeachingDao.xml
  6. 24
      src/main/resources/mapper/tms/ExperimentalTeachingDao.xml

@ -14,7 +14,12 @@ public interface ExperimentalTeachingControllerApi {
@ApiOperation(value = "实验教学列表",notes = "实验教学列表查询")
R list(@ApiParam(name = "page", value = "页码", required = true) Integer page,
@ApiParam(name = "size", value = "每页显示的数据条数", required = true) Integer size,
ExperimentalTeachingEntityVO request);
@ApiParam(name = "month", value = "月份", required = false) Integer month,
@ApiParam(name = "type", value = "类型", required = false) Integer type,
@ApiParam(name = "status", value = "状态", required = false) Integer status,
@ApiParam(name = "startTime", value = "开始时间", required = false) String startTime,
@ApiParam(name = "stopTime", value = "结束时间", required = false) String stopTime,
@ApiParam(name = "searchContent", value = "搜索内容", required = false) String searchContent);
@ApiOperation(value = "添加实验教学",notes = "添加实验教学")
R save(ExperimentalTeachingEntity experimentalTeachingEntity);
@ -23,5 +28,5 @@ public interface ExperimentalTeachingControllerApi {
R update(ExperimentalTeachingEntity experimentalTeachingEntity);
@ApiOperation(value = "删除用户个人档案",notes = "删除用户个人档案")
R delete(Long[] ids);
R delete(Integer[] ids);
}

@ -41,8 +41,27 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
@GetMapping("/list")
public R list(@RequestParam Integer page,
@RequestParam Integer size,
ExperimentalTeachingEntityVO request){
PageUtils list = experimentalTeachingService.queryExperimentalTeaching(page,size,request);
Integer month, Integer type, Integer status, String startTime, String stopTime, String searchContent){
ExperimentalTeachingEntityVO vo = new ExperimentalTeachingEntityVO();
if (month!=null){
vo.setMonth(month);
}
if (type!=null){
vo.setType(type);
}
if (status!=null){
vo.setStatus(status);
}
if (startTime!=null&&startTime!=""){
vo.setStartTime(startTime);
}
if (stopTime!=null&&startTime!=""){
vo.setStopTime(stopTime);
}
if (searchContent!=null&&searchContent!=""){
vo.setSearchContent(searchContent);
}
PageUtils list = experimentalTeachingService.queryExperimentalTeaching(page,size,vo);
return R.ok().put("list",list);
}
/**
@ -57,7 +76,7 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
/**
* 修改
*/
@PutMapping("/update")
@PostMapping("/update")
public R update(@RequestBody ExperimentalTeachingEntity experimentalTeachingEntity){
experimentalTeachingService.updateById(experimentalTeachingEntity);
@ -67,8 +86,8 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
/**
* 删除
*/
@DeleteMapping("/delete")
public R delete(@RequestBody Long[] ids){
@PostMapping("/delete")
public R delete(@RequestBody Integer[] ids){
experimentalTeachingService.removeByIds(Arrays.asList(ids));
return R.ok();

@ -13,7 +13,7 @@ import java.util.Map;
public interface ExperimentalTeachingService extends IService<ExperimentalTeachingEntity> {
PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingEntityVO request);
PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingEntityVO vo);
// PageUtils queryPage(Map<String, Object> params);

@ -37,11 +37,10 @@ public class ExperimentalTeachingServiceImpl extends ServiceImpl<ExperimentalTea
// }
@Override
public PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingEntityVO request) {
public PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingEntityVO vo) {
Page<T> page1 = new Page<>(page, size);
ExperimentalTeachingDao userDao = this.getBaseMapper();
// PageUtils vo = userDao.queryExperimentalTeaching(page1,request);
IPage<ExperimentalTeachingEntity> list = userDao.queryExperimentalTeaching(page1, request);
IPage<ExperimentalTeachingEntity> list = userDao.queryExperimentalTeaching(page1, vo);
PageUtils pageUtils = new PageUtils(list);
return pageUtils;
}

@ -24,7 +24,7 @@
<if test="cla.status!=null">and `status` = #{cla.status}</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.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(creation_time)</if>
</select>
<update id="updateSurplusTime" parameterType="com.msdw.tms.entity.ExperimentalTeachingEntity">

@ -25,23 +25,29 @@
WHERE
is_del = 0
<if test="exp.type!=null">
AND type=#{exp.type,jdbcType=INTEGER}
AND `type`=#{exp.type,jdbcType=INTEGER}
</if>
<if test='exp.month==1'>
AND creation_time>DATE_SUB(CURDATE(), INTERVAL 1 MONTH)
</if>
<if test='exp.month==3'>
AND creation_time>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
</if>
<if test='exp.month==6'>
AND creation_time>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)
<if test="exp.status!=null">
AND `status`=#{exp.status,jdbcType=INTEGER}
</if>
<!-- <if test='exp.month==1'>-->
<!-- AND creation_time>DATE_SUB(CURDATE(), INTERVAL 1 MONTH)-->
<!-- </if>-->
<!-- <if test='exp.month==3'>-->
<!-- AND creation_time>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)-->
<!-- </if>-->
<!-- <if test='exp.month==6'>-->
<!-- AND creation_time>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)-->
<!-- </if>-->
<if test='exp.startTime!=null and exp.stopTime!=null'>
AND creation_time between #{exp.startTime} and #{exp.stopTime}
</if>
<if test="exp.searchContent!=null">
AND (project_name like concat('%',#{exp.searchContent},'%') or experimental_class_name like concat('%',#{exp.searchContent},'%') )
</if>
<if test="exp.month!=null">
AND DATE_SUB(CURDATE(), INTERVAL #{exp.month} month ) &lt;= date(creation_time)
</if>
</select>
</mapper>
Loading…
Cancel
Save