Browse Source

添加基础查询方法(需要自行写入sql)

NorthLan 7 years ago
parent
commit
16db6a0873
1 changed files with 7 additions and 1 deletions
  1. 7 1
      zen-core/src/main/kotlin/com/gxzc/zen/common/base/BaseMapper.kt

+ 7 - 1
zen-core/src/main/kotlin/com/gxzc/zen/common/base/BaseMapper.kt

@@ -2,6 +2,7 @@ package com.gxzc.zen.common.base
 
 import com.baomidou.mybatisplus.mapper.BaseMapper
 import com.baomidou.mybatisplus.mapper.Wrapper
+import com.baomidou.mybatisplus.plugins.pagination.Pagination
 import org.apache.ibatis.annotations.Param
 
 /**
@@ -16,7 +17,12 @@ interface BaseMapper<T> : BaseMapper<T> {
     /**
      * 通过自定义SQL查询
      */
-    fun selectByParams(params: MutableMap<String, Any>?): MutableList<T>
+    fun selectByParams(@Param("p") params: MutableMap<String, Any?>?): MutableList<T>
+
+    /**
+     * 自定义SQL查询 分页
+     */
+    fun selectByParamsPage(page: Pagination, @Param("p") params: LinkedHashMap<String, Any?>?): MutableList<T>
 
     /**
      * 自定义更新逻辑(忽略mp自带的逻辑删除功能)