Zhaops hace 6 años
padre
commit
1d9ffa5e85

+ 20 - 0
icssman-service/src/main/java/com/diagbot/facade/IntroduceInfoFacade.java

@@ -1,16 +1,21 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.entity.IntroduceDetail;
 import com.diagbot.entity.IntroduceInfo;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.IntroduceInfoServiceImpl;
 import com.diagbot.util.UserUtils;
+import com.diagbot.vo.IntroducePageVO;
 import com.diagbot.vo.IntroduceVO;
+import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.Date;
+import java.util.Map;
 
 /**
  * @Description:
@@ -112,4 +117,19 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
         this.update(new IntroduceInfo(), introduceInfoUpdateWrapper);
         return true;
     }
+
+    /**
+     * 分页查询提示信息,可带等于条件
+     *
+     * @param introducePageVO
+     * @return
+     */
+    public IPage<IntroduceInfo> getPageByMap(IntroducePageVO introducePageVO) {
+        QueryWrapper<IntroduceInfo> introduceInfoQueryWrapper = new QueryWrapper<>();
+        for (Map.Entry<String, Object> entry : introducePageVO.getMap().entrySet()) {
+            introduceInfoQueryWrapper.eq(entry.getKey(), entry.getValue());
+        }
+        IPage<IntroduceInfo> introduceInfoIPage = this.page(introducePageVO, introduceInfoQueryWrapper);
+        return introduceInfoIPage;
+    }
 }

+ 18 - 0
icssman-service/src/main/java/com/diagbot/vo/IntroducePageVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/16 15:50
+ */
+@Getter
+@Setter
+public class IntroducePageVO extends Page {
+    Map<String, Object> map;
+}

+ 23 - 1
icssman-service/src/main/java/com/diagbot/web/IntroduceInfoController.java

@@ -1,8 +1,12 @@
 package com.diagbot.web;
 
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.IntroduceInfo;
 import com.diagbot.facade.IntroduceInfoFacade;
+import com.diagbot.vo.IntroducePageVO;
 import com.diagbot.vo.IntroduceVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -37,6 +41,7 @@ public class IntroduceInfoController {
                     "remark:备注<br>" +
                     "detailList:提示信息明细列表")
     @PostMapping("/saveIntroduce")
+    @SysLogger("saveIntroduce")
     public RespDTO<Boolean> saveIntroduce(@RequestBody @Valid IntroduceVO introduceVO) {
         Boolean data = introduceInfoFacade.saveIntroduce(introduceVO);
         return RespDTO.onSuc(data);
@@ -45,6 +50,7 @@ public class IntroduceInfoController {
     @ApiOperation(value = "单条删除提示信息[by:zhaops]",
             notes = "id: id,必填")
     @PostMapping("/deleteRecord")
+    @SysLogger("deleteRecord")
     public RespDTO<Boolean> deleteRecord(@RequestParam Long id) {
         Boolean data = introduceInfoFacade.deleteRecord(id);
         return RespDTO.onSuc(data);
@@ -53,10 +59,26 @@ public class IntroduceInfoController {
     @ApiOperation(value = "批量删除提示信息[by:zhaops]",
             notes = "ids: ids,必填")
     @PostMapping("/deleteRecords")
+    @SysLogger("deleteRecords")
     public RespDTO<Boolean> deleteRecords(@RequestParam Long[] ids) {
         Boolean data = introduceInfoFacade.deleteRecords(ids);
         return RespDTO.onSuc(data);
     }
 
-
+    /**
+     * 分页查询提示信息,可带等于条件
+     *
+     * @param introducePageVO
+     * @return
+     */
+    @ApiOperation(value = "分页查询提示信息,可带等于条件[by:zhaops]",
+            notes = "current:页码,必填<br>" +
+                    "size:每页显示条数,必填<br>" +
+                    "map:查询条件(=),key为数据库字段名<br>")
+    @PostMapping("/getPageByMap")
+    @SysLogger("getPageByMap")
+    public RespDTO getPageByMap(@RequestBody IntroducePageVO introducePageVO) {
+        IPage<IntroduceInfo> infoIPage = introduceInfoFacade.getPageByMap(introducePageVO);
+        return RespDTO.onSuc(infoIPage);
+    }
 }