package cn.gistack.sm.exam.controller; import java.util.Arrays; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import cn.gistack.sm.exam.entity.ExamPlan; import cn.gistack.sm.exam.entity.ExamRating; import cn.gistack.sm.exam.service.IExamRatingService; import cn.gistack.sm.exam.vo.ExamRatingVO; import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; /** * @Description: 考核评定 * @Author: jeecg-boot * @Date: 2022-11-09 * @Version: V1.0 */ @Slf4j @Api(tags="考核评定") @RestController @RequestMapping("/exam/examRating") @AllArgsConstructor public class ExamRatingController extends BladeController { private IExamRatingService examRatingService; /** * 分页列表查询 */ @ApiOperation(value="考核评定-分页列表查询", notes="考核评定-分页列表查询") @GetMapping(value = "/list") public R queryPageList(ExamRating examRating, Query query) { IPage pageList = examRatingService.page(Condition.getPage(query), Condition.getQueryWrapper(examRating)); return R.data(pageList); } /** * 自定义分页列表查询 * * @param examRating * @return */ @ApiOperation(value="考核评定-自定义分页列表查询", notes="考核评定-自定义分页列表查询") @GetMapping(value = "/page") public R page(ExamRatingVO examRating,Query query) { return R.data(examRatingService.selectExamRatingPage(Condition.getPage(query),examRating)); } /** * 获取全部 */ @ApiOperation(value="考核评定-获取全部", notes="考核评定-获取全部") @GetMapping(value = "/all") public R getAll(ExamRating examRating) { return R.data(examRatingService.list(Condition.getQueryWrapper(examRating))); } /** * 添加 * * @param examRating * @return */ @ApiOperation(value="考核评定-添加", notes="考核评定-添加") @PostMapping(value = "/add") public R add(@RequestBody ExamRating examRating) { return R.data(examRatingService.save(examRating)); } /** * 编辑 * * @param examRating * @return */ @ApiOperation(value="考核评定-编辑", notes="考核评定-编辑") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public R edit(@RequestBody ExamRating examRating) { return R.data(examRatingService.updateById(examRating)); } /** * 通过id删除 * * @param id * @return */ @ApiOperation(value="考核评定-通过id删除", notes="考核评定-通过id删除") @DeleteMapping(value = "/delete") public R delete(@RequestParam(name="id",required=true) String id) { return R.data(examRatingService.removeById(id)); } /** * 批量删除 * * @param ids * @return */ @ApiOperation(value="考核评定-批量删除", notes="考核评定-批量删除") @DeleteMapping(value = "/deleteBatch") public R deleteBatch(@RequestParam(name="ids",required=true) String ids) { return R.data(this.examRatingService.removeByIds(Arrays.asList(ids.split(",")))); } /** * 通过id查询 * * @param id * @return */ @ApiOperation(value="考核评定-通过id查询", notes="考核评定-通过id查询") @GetMapping(value = "/queryById") public R queryById(@RequestParam(name="id",required=true) String id) { ExamRating examRating = examRatingService.getById(id); return R.data(examRating); } }