From 546915fc4b7267c16b2384809b0ca4f43ca33f3e Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期日, 09 十月 2022 08:50:14 +0800
Subject: [PATCH] 1

---
 src/main/resources/mapper/sys/ArgsMapper.xml                    |    6 +++---
 src/main/java/com/lf/server/controller/sys/ArgsController.java  |   35 ++++++++++++++++++++++++++++++-----
 src/main/java/com/lf/server/controller/sys/ResOpController.java |    2 +-
 说明.txt                                                          |    1 +
 4 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/lf/server/controller/sys/ArgsController.java b/src/main/java/com/lf/server/controller/sys/ArgsController.java
index 0608569..b5343bd 100644
--- a/src/main/java/com/lf/server/controller/sys/ArgsController.java
+++ b/src/main/java/com/lf/server/controller/sys/ArgsController.java
@@ -65,6 +65,31 @@
     }
 
     @SysLog()
+    @ApiOperation(value = "鍒嗛〉鏌ヨ骞惰繑鍥炶褰曟暟")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "name", value = "鍚嶇О", dataType = "String", paramType = "query", example = "鏈夋晥鏈�"),
+            @ApiImplicitParam(name = "pageSize", value = "姣忛〉鏉℃暟", dataType = "Integer", paramType = "query", example = "10"),
+            @ApiImplicitParam(name = "pageIndex", value = "鍒嗛〉鏁帮紙浠�1寮�濮嬶級", dataType = "Integer", paramType = "query", example = "1")
+    })
+    @GetMapping(value = "/selectByPageAndCount")
+    public ResponseMsg<List<ArgsEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) {
+        try {
+            if (pageSize < 1 || pageIndex < 1) {
+                return fail("姣忛〉椤垫暟鎴栧垎椤垫暟灏忎簬1", null);
+            }
+            int count = argsService.selectCount(name);
+            if (count == 0) {
+                return success(0, null);
+            }
+            List<ArgsEntity> rs = argsService.selectByPage(name, pageSize, pageSize * (pageIndex - 1));
+
+            return success(count, rs);
+        } catch (Exception ex) {
+            return fail(ex.getMessage(), null);
+        }
+    }
+
+    @SysLog()
     @ApiOperation(value = "鏌ヨ鎵�鏈�")
     @GetMapping(value = "/selectAll")
     public ResponseMsg<List<ArgsEntity>> selectAll() {
@@ -96,7 +121,7 @@
     @SysLog()
     @ApiOperation(value = "娣诲姞鏁版嵁")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", paramType = "body")
+            @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", dataType = "ArgsEntity", paramType = "body")
     })
     @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8")
     public ResponseMsg<Integer> insert(@RequestBody ArgsEntity entity) {
@@ -112,7 +137,7 @@
     @SysLog()
     @ApiOperation(value = "鎵归噺娣诲姞")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "list", value = "瀹炰綋绫婚泦鍚�", paramType = "body")
+            @ApiImplicitParam(name = "list", value = "瀹炰綋绫婚泦鍚�", dataType = "ArgsEntity", paramType = "body")
     })
     @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8")
     public ResponseMsg<Integer> inserts(@RequestBody List<ArgsEntity> list) {
@@ -144,7 +169,7 @@
     @SysLog()
     @ApiOperation(value = "鎵归噺鍒犻櫎")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "ids", value = "ID鏁扮粍", dataType = "Integer", paramType = "query", example = "{1,2}")
+            @ApiImplicitParam(name = "ids", value = "ID鏁扮粍", dataType = "Integer", paramType = "query", example = "1,2")
     })
     @GetMapping(value = "/deletes")
     public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids) {
@@ -164,7 +189,7 @@
     @SysLog()
     @ApiOperation(value = "淇敼鏁版嵁")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", paramType = "body")
+            @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", dataType = "ArgsEntity", paramType = "body")
     })
     @ResponseBody
     @PostMapping(value = "/update", produces = "application/json; charset=UTF-8")
@@ -181,7 +206,7 @@
     @SysLog()
     @ApiOperation(value = "鎵归噺淇敼")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "list", value = "瀹炰綋绫婚泦鍚�", paramType = "body")
+            @ApiImplicitParam(name = "list", value = "瀹炰綋绫婚泦鍚�", dataType = "ArgsEntity", paramType = "body")
     })
     @ResponseBody
     @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8")
diff --git a/src/main/java/com/lf/server/controller/sys/ResOpController.java b/src/main/java/com/lf/server/controller/sys/ResOpController.java
index 153ff6e..5df0b09 100644
--- a/src/main/java/com/lf/server/controller/sys/ResOpController.java
+++ b/src/main/java/com/lf/server/controller/sys/ResOpController.java
@@ -65,7 +65,7 @@
     @SysLog()
     @ApiOperation(value = "鍒嗛〉鏌ヨ骞惰繑鍥炶褰曟暟")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "userid", value = "鐧诲綍浜篒D", dataType = "String", paramType = "query", example = "1"),
+            @ApiImplicitParam(name = "userid", value = "鐧诲綍浜篒D", dataType = "Integer", paramType = "query", example = "1"),
             @ApiImplicitParam(name = "pageSize", value = "姣忛〉鏉℃暟", dataType = "Integer", paramType = "query", example = "10"),
             @ApiImplicitParam(name = "pageIndex", value = "鍒嗛〉鏁帮紙浠�1寮�濮嬶級", dataType = "Integer", paramType = "query", example = "1")
     })
diff --git a/src/main/resources/mapper/sys/ArgsMapper.xml b/src/main/resources/mapper/sys/ArgsMapper.xml
index 1aab1f5..3b98623 100644
--- a/src/main/resources/mapper/sys/ArgsMapper.xml
+++ b/src/main/resources/mapper/sys/ArgsMapper.xml
@@ -1,12 +1,12 @@
 <?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.lf.server.mapper.sys.ArgsEntity">
+<mapper namespace="com.lf.server.mapper.sys.ArgsMapper">
     <!-- 缁熻琛屾暟 -->
     <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String">
         select count(*) from lf.sys_args
         <where>
             <if test="name != null">
-                name = #{name}
+                name like #{name}
             </if>
         </where>
     </select>
@@ -16,7 +16,7 @@
         select * from lf.sys_args
         <where>
             <if test="name != null">
-                name = #{name}
+                name like #{name}
             </if>
         </where>
         order by id
diff --git "a/\350\257\264\346\230\216.txt" "b/\350\257\264\346\230\216.txt"
index 3c286dc..5a398b0 100644
--- "a/\350\257\264\346\230\216.txt"
+++ "b/\350\257\264\346\230\216.txt"
@@ -1,5 +1,6 @@
 1.淇敼鑿滃崟銆佹暟鎹洰褰曘�佸崟浣嶇殑xls鏁版嵁锛岀紪鍐欓�掑綊鏌ヨSQL
 2.鐧诲綍鏃堕獙璇佷娇鐢∕D5+Salt瀵嗙爜
+
 3.淇敼鐢ㄦ埛瀵嗙爜鏃朵娇鐢∕D5+Salt瀵嗙爜
 4.瑙e喅Swagger-UI鏃犳硶浼犻�扖ookie淇℃伅
 5.鐧诲綍鏃剁殑鐢ㄦ埛鍚嶅拰瀵嗙爜浣跨敤RSA鍔犲瘑銆佽В瀵�

--
Gitblit v1.9.3