Commit 65088289 authored by srx's avatar srx

项目列表分页查询

parent 7330cf40
...@@ -26,5 +26,5 @@ public interface ProjectMapper extends BaseMapper<Project> { ...@@ -26,5 +26,5 @@ public interface ProjectMapper extends BaseMapper<Project> {
ProjectDto getDetail(Long sequenceNbr); ProjectDto getDetail(Long sequenceNbr);
//项目模糊筛选 //项目模糊筛选
List<ProjectDto> queryProjectPage(Project projectParam); IPage<ProjectDto> queryProjectPage(IPage<ProjectDto> page, Project project);
} }
package com.yeejoin.amos.boot.module.ugp.api.service; package com.yeejoin.amos.boot.module.ugp.api.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto; import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto; import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
...@@ -14,5 +15,6 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Project; ...@@ -14,5 +15,6 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
* @date 2022-09-22 * @date 2022-09-22
*/ */
public interface IProjectService { public interface IProjectService {
Page<ProjectDto> queryProjectPage(int current, int size, Project project);
IPage<ProjectDto> queryProjectPage(IPage<ProjectDto> page, Project project);
} }
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
<select id="queryProjectPage" resultType="com.yeejoin.amos.boot.module.ugp.api.entity.Project"> <select id="queryProjectPage" resultType="com.yeejoin.amos.boot.module.ugp.api.entity.Project">
select * from tz_ugp_project select * from tz_ugp_project
<where> <where>
<if test="name != '' and name != null"> <if test="project.name != '' and project.name != null">
and `name` like concat('%',#{name},'%') and `name` like concat('%',#{project.name},'%')
</if> </if>
<if test="constructionUnit != '' and constructionUnit != null"> <if test="project.constructionUnit != '' and project.constructionUnit != null">
and `construction_Unit` like concat('%',#{constructionUnit},'%') and `construction_Unit` like concat('%',#{project.constructionUnit},'%')
</if> </if>
</where> </where>
</select> </select>
......
...@@ -131,13 +131,16 @@ public class ProjectController extends BaseController { ...@@ -131,13 +131,16 @@ public class ProjectController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "项目信息表分页查询", notes = "项目信息表分页查询") @ApiOperation(httpMethod = "GET",value = "项目信息表分页查询", notes = "项目信息表分页查询")
public ResponseModel<Page<ProjectDto>> queryForPage( public ResponseModel<IPage<ProjectDto>> queryForPage(
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, Project project) { @RequestParam(value = "size") int size, Project project) {
return ResponseHelper.buildResponse(projectServiceImpl.queryProjectPage(current,size,project)); IPage<ProjectDto> page = new Page<>();
page.setSize(size);
page.setCurrent(current);
return ResponseHelper.buildResponse(projectServiceImpl.queryProjectPage(page,project));
} }
/** /**
* 列表全部数据查询 * 列表全部数据查询
* *
......
...@@ -4,11 +4,14 @@ import com.alibaba.fastjson.JSON; ...@@ -4,11 +4,14 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant; import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto; import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Attachment; import com.yeejoin.amos.boot.module.ugp.api.entity.Attachment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project; import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectInitiation; import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectInitiation;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper;
...@@ -169,14 +172,7 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -169,14 +172,7 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
} }
//项目模糊筛选 //项目模糊筛选
public Page<ProjectDto> queryProjectPage(int current, int size, Project project) { public IPage<ProjectDto> queryProjectPage(IPage<ProjectDto> page, Project project) {
Page<ProjectDto> page = new Page<>(); return projectMapper.queryProjectPage(page,project);
page.setSize(size);
page.setCurrent(current);
this.list();
List<ProjectDto> projects = projectMapper.queryProjectPage(project);
page.setRecords(projects);
return page;
} }
} }
\ No newline at end of file
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