Commit e9f31776 authored by srx's avatar srx

项目模糊筛选

parent 6aad5a32
package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.entity.Equipment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
/**
......@@ -22,5 +25,6 @@ public interface ProjectMapper extends BaseMapper<Project> {
ProjectDto selectOneByName(@RequestParam String name);
ProjectDto getDetail(Long sequenceNbr);
//项目模糊筛选
List<ProjectDto> queryProjectPage(Project projectParam);
}
package com.yeejoin.amos.boot.module.ugp.api.service;
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.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
/**
* 项目信息表接口类
*
......@@ -8,5 +14,5 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
* @date 2022-09-22
*/
public interface IProjectService {
Page<ProjectDto> queryProjectPage(int current, int size, Project project);
}
......@@ -17,4 +17,16 @@
LEFT JOIN cb_org_usr AS ou2 ON ou2.sequence_nbr = r.supervise_dept_id
WHERE p.sequence_nbr = #{sequenceNbr}
</select>
<select id="queryProjectPage" resultType="com.yeejoin.amos.boot.module.ugp.api.entity.Project">
select * from tz_ugp_project
<where>
<if test="name != '' and name != null">
and `name` like concat('%',#{name},'%')
</if>
<if test="constructionUnit != '' and constructionUnit != null">
and `constructionUnit` like concat('%',#{constructionUnit},'%')
</if>
</where>
</select>
</mapper>
......@@ -8,9 +8,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
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.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
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.biz.service.impl.*;
import org.springframework.beans.BeanUtils;
......@@ -131,14 +133,9 @@ public class ProjectController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "项目信息表分页查询", notes = "项目信息表分页查询")
public ResponseModel<Page<ProjectDto>> queryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "name",required = false) String name,
@RequestParam(value = "constructionUnit",required = false) String constructionUnit
) {
Page<ProjectDto> page = new Page<ProjectDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(projectServiceImpl.queryForProjectPage(page, name, constructionUnit));
@RequestParam(value = "size") int size, Project project) {
return ResponseHelper.buildResponse(projectServiceImpl.queryProjectPage(current,size,project));
}
/**
......
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