【 项目查询增加名称、code筛选参数】

This commit is contained in:
weizhihong 2022-09-29 10:26:35 +08:00
parent 80b3106cfa
commit c40ce1e2dd
5 changed files with 65 additions and 11 deletions

View File

@ -3,9 +3,10 @@ package club.joylink.rtss.controller.project;
import club.joylink.rtss.entity.project.Project; import club.joylink.rtss.entity.project.Project;
import club.joylink.rtss.entity.project.ProjectView; import club.joylink.rtss.entity.project.ProjectView;
import club.joylink.rtss.services.project.ProjectService; import club.joylink.rtss.services.project.ProjectService;
import club.joylink.rtss.vo.client.PageQueryVO;
import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.project.ProjectQueryVO;
import club.joylink.rtss.vo.project.ProjectVO; import club.joylink.rtss.vo.project.ProjectVO;
import club.joylink.rtss.vo.project.ProjectViewQueryVO;
import club.joylink.rtss.vo.project.ProjectViewVO; import club.joylink.rtss.vo.project.ProjectViewVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -23,7 +24,7 @@ public class ProjectInfoController {
private ProjectService projectService; private ProjectService projectService;
@GetMapping("/page") @GetMapping("/page")
public PageVO<Project> pagingQuery(PageQueryVO queryVO) { public PageVO<Project> pagingQuery(ProjectQueryVO queryVO) {
return projectService.pagingQuery(queryVO); return projectService.pagingQuery(queryVO);
} }
@ -58,7 +59,7 @@ public class ProjectInfoController {
} }
@GetMapping("/viewSetting/page") @GetMapping("/viewSetting/page")
public PageVO<ProjectView> projectViewPagingQuery(PageQueryVO queryVO) { public PageVO<ProjectView> projectViewPagingQuery(ProjectViewQueryVO queryVO) {
return projectService.projectViewPagingQuery(queryVO); return projectService.projectViewPagingQuery(queryVO);
} }

View File

@ -2,9 +2,10 @@ package club.joylink.rtss.services.project;
import club.joylink.rtss.entity.project.Project; import club.joylink.rtss.entity.project.Project;
import club.joylink.rtss.entity.project.ProjectView; import club.joylink.rtss.entity.project.ProjectView;
import club.joylink.rtss.vo.client.PageQueryVO;
import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.project.ProjectQueryVO;
import club.joylink.rtss.vo.project.ProjectVO; import club.joylink.rtss.vo.project.ProjectVO;
import club.joylink.rtss.vo.project.ProjectViewQueryVO;
import club.joylink.rtss.vo.project.ProjectViewVO; import club.joylink.rtss.vo.project.ProjectViewVO;
import java.util.List; import java.util.List;
@ -17,7 +18,7 @@ public interface ProjectService {
/** /**
* 分页 * 分页
*/ */
PageVO<Project> pagingQuery(PageQueryVO queryVO); PageVO<Project> pagingQuery(ProjectQueryVO queryVO);
/** /**
* 列表 * 列表
@ -52,7 +53,7 @@ public interface ProjectService {
/** /**
* 前端设置信息分页 * 前端设置信息分页
*/ */
PageVO<ProjectView> projectViewPagingQuery(PageQueryVO queryVO); PageVO<ProjectView> projectViewPagingQuery(ProjectViewQueryVO queryVO);
/** /**
* 获取所有的前端配置 * 获取所有的前端配置

View File

@ -8,9 +8,10 @@ import club.joylink.rtss.entity.project.ProjectView;
import club.joylink.rtss.entity.project.ProjectViewExample; import club.joylink.rtss.entity.project.ProjectViewExample;
import club.joylink.rtss.simulation.cbtc.exception.SimulationException; import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
import club.joylink.rtss.vo.client.PageQueryVO;
import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.project.ProjectQueryVO;
import club.joylink.rtss.vo.project.ProjectVO; import club.joylink.rtss.vo.project.ProjectVO;
import club.joylink.rtss.vo.project.ProjectViewQueryVO;
import club.joylink.rtss.vo.project.ProjectViewVO; import club.joylink.rtss.vo.project.ProjectViewVO;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@ -40,10 +41,16 @@ public class ProjectServiceImpl implements ProjectService {
private ProjectViewDAO projectViewDAO; private ProjectViewDAO projectViewDAO;
@Override @Override
public PageVO<Project> pagingQuery(PageQueryVO queryVO) { public PageVO<Project> pagingQuery(ProjectQueryVO queryVO) {
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize()); PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
ProjectExample projectExample = new ProjectExample(); ProjectExample projectExample = new ProjectExample();
projectExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS); ProjectExample.Criteria criteria = projectExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS);
if (!StringUtils.isEmpty(queryVO.getCode())) {
criteria.andCodeEqualTo(queryVO.getCode());
}
if (!StringUtils.isEmpty(queryVO.getName())) {
criteria.andNameLike(queryVO.getName());
}
Page<Project> page = (Page<Project>) projectDAO.selectWithBLOBsByExample(projectExample); Page<Project> page = (Page<Project>) projectDAO.selectWithBLOBsByExample(projectExample);
return PageVO.convert(page, page.getResult()); return PageVO.convert(page, page.getResult());
} }
@ -113,10 +120,16 @@ public class ProjectServiceImpl implements ProjectService {
} }
@Override @Override
public PageVO<ProjectView> projectViewPagingQuery(PageQueryVO queryVO) { public PageVO<ProjectView> projectViewPagingQuery(ProjectViewQueryVO queryVO) {
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize()); PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
ProjectViewExample projectViewExample = new ProjectViewExample(); ProjectViewExample projectViewExample = new ProjectViewExample();
projectViewExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS); ProjectViewExample.Criteria criteria = projectViewExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS);
if (!StringUtils.isEmpty(queryVO.getProject())) {
criteria.andProjectEqualTo(queryVO.getProject());
}
if (!StringUtils.isEmpty(queryVO.getMarkKey())) {
criteria.andMarkKeyEqualTo(queryVO.getMarkKey());
}
Page<ProjectView> page = (Page<ProjectView>) projectViewDAO.selectWithBLOBsByExample(projectViewExample); Page<ProjectView> page = (Page<ProjectView>) projectViewDAO.selectWithBLOBsByExample(projectViewExample);
return PageVO.convert(page, page.getResult()); return PageVO.convert(page, page.getResult());
} }

View File

@ -0,0 +1,21 @@
package club.joylink.rtss.vo.project;
import club.joylink.rtss.vo.client.PageQueryVO;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
public class ProjectQueryVO extends PageQueryVO {
/**
* 项目编码后端使用
*/
private String code;
/**
* 项目名称
*/
private String name;
}

View File

@ -0,0 +1,18 @@
package club.joylink.rtss.vo.project;
import club.joylink.rtss.vo.client.PageQueryVO;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class ProjectViewQueryVO extends PageQueryVO {
private String markKey;
private String project;
}