| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.ProcedureDoc; |
| | | import com.whyc.service.ProcedureDocService; |
| | | 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.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | |
| | | service.download(filePath, response); |
| | | } |
| | | |
| | | @PostMapping("listPage") |
| | | @ApiOperation("查询列表分页") |
| | | public Response getListPage(@RequestBody ProcedureDoc procedureDoc, @RequestParam int pageNum, @RequestParam int pageSize){ |
| | | return service.getListPage(procedureDoc,pageNum,pageSize); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.whyc.pojo.ProcedureDoc; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ProcedureDocMapper extends CustomMapper<ProcedureDoc> { |
| | | List<ProcedureDoc> getListPage(ProcedureDoc procedureDoc); |
| | | |
| | | } |
| | |
| | | private Date createTime; |
| | | |
| | | @TableField(exist = false) |
| | | private String nameFzr; |
| | | |
| | | @TableField(exist = false) |
| | | private String nameBz; |
| | | |
| | | @TableField(exist = false) |
| | | private String nameZz; |
| | | |
| | | @TableField(exist = false) |
| | | private String namePb; |
| | | |
| | | @TableField(exist = false) |
| | | private MultipartFile multipartFile; |
| | | |
| | | public Integer getId() { |
| | |
| | | public void setMultipartFile(MultipartFile multipartFile) { |
| | | this.multipartFile = multipartFile; |
| | | } |
| | | |
| | | public void setNameFzr(String nameFzr) { |
| | | this.nameFzr = nameFzr; |
| | | } |
| | | |
| | | public String getNameBz() { |
| | | return nameBz; |
| | | } |
| | | |
| | | public void setNameBz(String nameBz) { |
| | | this.nameBz = nameBz; |
| | | } |
| | | |
| | | public String getNameZz() { |
| | | return nameZz; |
| | | } |
| | | |
| | | public void setNameZz(String nameZz) { |
| | | this.nameZz = nameZz; |
| | | } |
| | | |
| | | public String getNamePb() { |
| | | return namePb; |
| | | } |
| | | |
| | | public void setNamePb(String namePb) { |
| | | this.namePb = namePb; |
| | | } |
| | | } |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.ProcedureDocMapper; |
| | | import com.whyc.pojo.ProcedureDoc; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ProcedureDocService { |
| | |
| | | String filename = filePath.substring(filePath.lastIndexOf(File.separator)+1); |
| | | FileUtil.download(response,absolutePath,filename); |
| | | } |
| | | |
| | | public Response getListPage(ProcedureDoc procedureDoc, int pageNum, int pageSize) { |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<ProcedureDoc> list = mapper.getListPage(procedureDoc); |
| | | PageInfo<ProcedureDoc> pageInfo = new PageInfo<>(list); |
| | | return new Response().set(1,pageInfo); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.ProcedureDocMapper" > |
| | | |
| | | <select id="getListPage" resultType="com.whyc.pojo.ProcedureDoc"> |
| | | select * from |
| | | (SELECT d.*,u1.name nameFzr,u2.name nameBz,u3.name nameZz,u4.name namePb FROM tb_procedure_doc d,tb_doc_user u1,tb_doc_user u2,tb_doc_user u3,tb_doc_user u4 |
| | | where d.fzr = u1.id |
| | | and d.bz = u2.id |
| | | and d.zz = u3.id |
| | | and d.pb = u4.id)t |
| | | <where> |
| | | <if test="name!=null and name!=''"> |
| | | t.name like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="nameFzr!=null and nameFzr!=''"> |
| | | t.nameFzr like concat('%',#{nameFzr},'%') |
| | | </if> |
| | | <if test="nameBz!=null and nameBz!=''"> |
| | | t.nameBz like concat('%',#{nameBz},'%') |
| | | </if> |
| | | <if test="nameZz!=null and nameZz!=''"> |
| | | t.nameZz like concat('%',#{nameZz},'%') |
| | | </if> |
| | | <if test="namePb!=null and namePb!=''"> |
| | | t.namePb like concat('%',#{namePb},'%') |
| | | </if> |
| | | <if test="type!=null"> |
| | | t.type = #{type} |
| | | </if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | </mapper> |