| | |
| | | package com.example.jz.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.example.jz.enums.BusinessHttpStatus; |
| | | import com.example.jz.exception.BusinessException; |
| | | import com.example.jz.modle.R; |
| | | import com.example.jz.modle.dto.ReportParamDto; |
| | | import com.example.jz.modle.entity.Report; |
| | | import com.example.jz.modle.vo.ReportListVo; |
| | | import com.example.jz.service.ReportService; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 报案表(Report)表控制层 |
| | |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param page 分页对象 |
| | | * @param report 查询实体 |
| | | * @param reportParamDto 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @GetMapping |
| | | @ApiOperation(value = "分页查询所有数据") |
| | | public R<IPage<Report>> selectAll(Page<Report> page, Report report) { |
| | | return R.ok(reportService.page(page, new QueryWrapper<>(report))); |
| | | public R<IPage<ReportListVo>> selectAll(Page<ReportListVo> page, ReportParamDto reportParamDto) { |
| | | return R.ok(reportService.getPage(page, reportParamDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("{id}") |
| | | @ApiOperation(value = "通过主键查询单条数据") |
| | | public R<Report> selectOne(@PathVariable Serializable id) { |
| | | return R.ok(reportService.getById(id)); |
| | | public R<ReportListVo> selectOne(@PathVariable Serializable id) { |
| | | return R.ok(reportService.getReportListVoById(id)); |
| | | } |
| | | |
| | | /** |