Procházet zdrojové kódy

图书详情和预约用户列表

před 5 roky
rodič
revize
b14ccc5b6d

+ 6 - 1
bms/src/main/java/com/hssx/bms/service/impl/InstitutionalInformationServiceImpl.java

@@ -102,8 +102,13 @@ public class InstitutionalInformationServiceImpl extends ServiceImpl<Institution
         if(null == page.getPageNum() && null == page.getPageSize()){
             page = new PageUtil();
         }
+        QueryWrapper<InstitutionalInformation> qw = new QueryWrapper<InstitutionalInformation>();
+        qw.eq("is_delete",0).select("id", "name", "phone", "address");
         PageHelper.startPage(page.getPageNum(),page.getPageSize());
-        List<InstitutionalInformation> institutionalInformations = institutionalMapper.selectList(new QueryWrapper<InstitutionalInformation>().eq("is_delete",0).select("id", "name", "phone", "address"));
+        if(null != page.getKeyName() && !"".equals(page.getKeyName())){
+            qw.eq("name",page.getKeyName());
+        }
+        List<InstitutionalInformation> institutionalInformations = institutionalMapper.selectList(qw);
         PageInfo<InstitutionalInformation> pageInfo = new PageInfo<>(institutionalInformations);
         msg.data = pageInfo;
         return msg;

+ 4 - 0
bms/src/main/java/com/hssx/bms/until/PageUtil.java

@@ -1,5 +1,7 @@
 package com.hssx.bms.until;
 
+import lombok.Data;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -9,11 +11,13 @@ import java.util.List;
  * Description:<描述> 模仿pagehelper参数的分页封装类
  * Version: 1.0
  */
+@Data
 public class PageUtil<T> {
     private Integer pageNum = 1;
     private Integer total;
     private Integer pageSize = 10;
     private Integer pages;
+    private String keyName;
     private List<T> list = new ArrayList<>();
 
     public Integer getPageNum() {