Commit e0353498 authored by limei's avatar limei

分页列表接口

parent 20ab5c3e
package com.yeejoin.amos.boot.module.tdc.api.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckReport;
import org.springframework.stereotype.Service;
......@@ -9,4 +10,5 @@ import org.springframework.stereotype.Service;
*/
@Service
public interface CheckReportService extends IService<CheckReport> {
IPage<CheckReport> selectAll(int current, int size, String amosOrgCode);
}
package com.yeejoin.amos.boot.module.tdc.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckReport;
import com.yeejoin.amos.boot.module.tdc.api.service.CheckReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
/**
* 校验报告
......@@ -13,4 +23,18 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping(value = "/report")
public class CheckReportController {
@Autowired
CheckReportService checkReportService;
/**
* 根据amosOrgCode查询
* return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "selectAll")
@ApiOperation(httpMethod = "GET",value = "根据amosOrgCode查询模型列表", notes = "根据amosOrgCode查询模型列表")
public ResponseModel<IPage<CheckReport>> selectAll(int current, int size, String amosOrgCode) {
return ResponseHelper.buildResponse(checkReportService.selectAll(current,size,amosOrgCode));
}
}
package com.yeejoin.amos.boot.module.tdc.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckModel;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckReport;
import com.yeejoin.amos.boot.module.tdc.api.mapper.CheckReportMapper;
import com.yeejoin.amos.boot.module.tdc.api.service.CheckModelService;
import com.yeejoin.amos.boot.module.tdc.api.service.CheckReportService;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.List;
/**
* @author DELL
*/
@Service
public class CheckReportImpl extends ServiceImpl<CheckReportMapper, CheckReport> implements CheckReportService {
@Override
public IPage<CheckReport> selectAll(int current,int size,String amosOrgCode) {
Page page = new Page(current,size);
if(ValidationUtil.isEmpty(amosOrgCode)){
return this.page(page);
}else{
LambdaQueryWrapper<CheckReport> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CheckReport::getAmosOrgCode, amosOrgCode);
return this.page(page,wrapper);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment