Commit c11b71e0 authored by LAPTOP-OLJ4F3OQ\thorny's avatar LAPTOP-OLJ4F3OQ\thorny

列表分页接口

parent 52d6ce92
...@@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckReport; import com.yeejoin.amos.boot.module.tdc.api.entity.CheckReport;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import java.util.List;
/** /**
* @author DELL * @author DELL
*/ */
@Mapper @Mapper
public interface CheckReportMapper extends BaseMapper<CheckReport> { public interface CheckReportMapper extends BaseMapper<CheckReport> {
} }
package com.yeejoin.amos.boot.module.tdc.api.service; 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.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckReport; import com.yeejoin.amos.boot.module.tdc.api.entity.CheckReport;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* @author DELL * @author DELL
*/ */
@Service @Service
public interface CheckReportService extends IService<CheckReport> { public interface CheckReportService extends IService<CheckReport> {
IPage<CheckReport> selectAll(int current, int size, String amosOrgCode);
} }
package com.yeejoin.amos.boot.module.tdc.biz.controller; package com.yeejoin.amos.boot.module.tdc.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.service.CheckModelService;
import com.yeejoin.amos.boot.module.tdc.api.service.CheckReportService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RestController; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
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;
import java.util.List;
/** /**
* 校验报告 * 校验报告
...@@ -13,4 +26,21 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -13,4 +26,21 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping(value = "/report") @RequestMapping(value = "/report")
public class CheckReportController { 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; 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.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.entity.CheckReport;
import com.yeejoin.amos.boot.module.tdc.api.mapper.CheckReportMapper; 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 com.yeejoin.amos.boot.module.tdc.api.service.CheckReportService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.List;
/** /**
* @author DELL * @author DELL
*/ */
@Service @Service
public class CheckReportImpl extends ServiceImpl<CheckReportMapper, CheckReport> implements CheckReportService { 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