Browse Source

修复条件查询无效的问题

niantuo 6 years ago
parent
commit
71525db13a

+ 0 - 1
build.gradle

@@ -111,7 +111,6 @@ subprojects {
         compile("javax.servlet:servlet-api:2.5")
         
         compile("mysql:mysql-connector-java:$mysql_connector_version")
-        compile("org.mybatis.spring.boot:mybatis-spring-boot-starter:2.0.1")
         compile("com.baomidou:mybatis-plus-boot-starter:$mybatisPlusVersion")
 
         // swagger

+ 1 - 0
envir-config/src/main/kotlin/cn/gygxzc/cloud/config/model/ConfigProperty.kt

@@ -25,6 +25,7 @@ data class ConfigProperty(@TableId(type = IdType.AUTO)
                           var createTime: Date? = null,
                           var updateTime: Date? = null,
                           var updateBy: String? = null,
+                          @TableField("`desc`")
                           var desc: String? = null,
                           var remark: String? = null) {
 }

+ 14 - 1
envir-config/src/main/kotlin/cn/gygxzc/cloud/config/service/impl/ConfigPropService.kt

@@ -40,7 +40,20 @@ class ConfigPropService : IConfigPropService {
 
     override fun query(prop: ConfigProperty,
                        page: Long, pageSize: Long): IPage<ConfigProperty> {
-        val queryWrapper = QueryWrapper<ConfigProperty>(prop)
+        val queryWrapper = QueryWrapper<ConfigProperty>()
+        queryWrapper.orderByDesc("`key`","application","profile")
+        if (!prop.application.isNullOrBlank()){
+            queryWrapper.eq("application",prop.application)
+        }
+        if (!prop.profile.isNullOrBlank()){
+            queryWrapper.eq("profile",prop.profile)
+        }
+        if (!prop.label.isNullOrBlank()){
+            queryWrapper.eq("label",prop.label)
+        }
+        if (!prop.key.isNullOrBlank()){
+            queryWrapper.like("key",prop.key)
+        }
         return propDao.selectPage(Page(page, pageSize), queryWrapper)
     }
 

+ 16 - 0
eureka-web/src/main/resources/application.yml

@@ -16,7 +16,23 @@ spring:
       context-path: /admin
 
 
+mybatis-plus:
+  mapper-locations: classpath*:mapper/**/*.xml
+  global-config:
+    db-config:
+      id-type: auto
+      table-underline: true
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      column-like: true
+    refresh: true
 
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: true #配置的缓存的全局开关
+    lazyLoadingEnabled: true #延时加载的开关
+    multipleResultSetsEnabled: true #延时加载一个属性时会加载该对象全部属性,否则按需加载属性
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl