|
@@ -0,0 +1,44 @@
|
|
|
+package cn.gygxzc.cloud.config.service.impl
|
|
|
+
|
|
|
+import cn.gygxzc.cloud.config.dao.ICommonConfigDao
|
|
|
+import cn.gygxzc.cloud.config.model.CommonConfig
|
|
|
+import cn.gygxzc.cloud.config.service.ICommonConfigService
|
|
|
+import cn.tonyandmoney.tuonq.core.req.PageReq
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
|
|
|
+import org.springframework.stereotype.Service
|
|
|
+
|
|
|
+@Service
|
|
|
+class CommonConfigService : ICommonConfigService, ServiceImpl<ICommonConfigDao, CommonConfig>() {
|
|
|
+
|
|
|
+
|
|
|
+ override fun queryByPage(req: PageReq, entity: CommonConfig): IPage<CommonConfig> {
|
|
|
+ val wrapper = QueryWrapper<CommonConfig>()
|
|
|
+ if (!entity.property.isNullOrBlank()) {
|
|
|
+ wrapper.like("property", entity.property)
|
|
|
+ }
|
|
|
+ if (!entity.title.isNullOrBlank()) {
|
|
|
+ wrapper.like("title", entity.title)
|
|
|
+ }
|
|
|
+ if (!entity.application.isNullOrBlank()) {
|
|
|
+ wrapper.like("application", entity.application)
|
|
|
+ }
|
|
|
+ if (entity.isServer != null) {
|
|
|
+ wrapper.eq("is_server", entity.isServer)
|
|
|
+ }
|
|
|
+ return baseMapper.selectPage(req.page(), wrapper)
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun queryApplicationConfig(isServer: Boolean, application: String): List<CommonConfig> {
|
|
|
+
|
|
|
+ val wrapper = QueryWrapper<CommonConfig>()
|
|
|
+ wrapper.eq("is_server", isServer)
|
|
|
+ wrapper.and {
|
|
|
+ it.eq("application", application).or().isNull("application")
|
|
|
+ }
|
|
|
+ wrapper.select("id", "property", "prop_value", "application")
|
|
|
+ return baseMapper.selectList(wrapper)
|
|
|
+ }
|
|
|
+
|
|
|
+}
|