From fabb5ca75a65da3b1ed8b6447b75d3ca191f93de Mon Sep 17 00:00:00 2001
From: lxw <810412026@qq.com>
Date: 星期三, 07 九月 2022 10:41:49 +0800
Subject: [PATCH] 查询软件列表的信息

---
 src/main/java/com/whyc/service/SoftwareService.java |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/whyc/service/SoftwareService.java b/src/main/java/com/whyc/service/SoftwareService.java
index 79c8cac..ecdcfa9 100644
--- a/src/main/java/com/whyc/service/SoftwareService.java
+++ b/src/main/java/com/whyc/service/SoftwareService.java
@@ -1,8 +1,13 @@
 package com.whyc.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.github.pagehelper.PageHelper;
+import com.whyc.dto.Response;
+import com.whyc.mapper.SoftwareMapper;
 import com.whyc.pojo.Software;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.*;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.io.IOException;
@@ -12,6 +17,8 @@
 
 @Service
 public class SoftwareService {
+    @Autowired
+    private SoftwareMapper mapper;
 
     public List<Software> excelParse(InputStream inputStream) throws IOException, InvalidFormatException {
         List<Software> softwareList = new LinkedList<>();
@@ -52,5 +59,15 @@
         return softwareList;
 
     }
-
+    //鏌ヨ杞欢鍒楄〃鐨勪俊鎭�
+    public Response getAllSoftware(String fileName, int pageCurr, int pageSize) {
+        PageHelper.startPage(pageCurr,pageSize);
+        QueryWrapper wrapper=new QueryWrapper();
+        if(fileName!=null&&!fileName.isEmpty()){
+            wrapper.like("file_name",fileName);
+        }
+        wrapper.orderByAsc("id");
+        List list=mapper.selectList(wrapper);
+        return new Response().setII(1,list.size()>0,list,"杞欢淇℃伅杩斿洖");
+    }
 }

--
Gitblit v1.9.1