Prechádzať zdrojové kódy

系统参数查询 方法重写

zhulu 1 rok pred
rodič
commit
1c073105d5

+ 5 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysConfigMapper.java

@@ -1,8 +1,11 @@
 package com.xunmei.system.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xunmei.system.api.domain.SysConfig;
+import com.xunmei.system.api.domain.SysOrg;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -14,6 +17,8 @@ import java.util.List;
 @Mapper
 public interface SysConfigMapper extends BaseMapper<SysConfig>
 {
+    Page<SysConfig> selectConfigForTable(Page<SysConfig> page,@Param("config") SysConfig config);
+
     /**
      * 查询参数配置信息
      * 

+ 1 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysConfigServiceImpl.java

@@ -53,7 +53,7 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
         } else {
             page = new Page<>();
         }
-        page = configMapper.selectPage(page, new QueryWrapper<>(sysConfig));
+        page = configMapper.selectConfigForTable(page, sysConfig);
         return TableDataInfo.build(page);
     }
 

+ 23 - 1
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysConfigMapper.xml

@@ -37,7 +37,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectConfigVo"/>
         <include refid="sqlwhereSearch"/>
     </select>
-    
+
+    <select id="selectConfigForTable" resultMap="SysConfigResult">
+        <include refid="selectConfigVo"/>
+        <where>
+            <if test="config.configName != null and config.configName != ''">
+                AND config_name like concat('%', #{config.configName}, '%')
+            </if>
+            <if test="config.configType != null and config.configType != ''">
+                AND config_type = #{config.configType}
+            </if>
+            <if test="config.configKey != null and config.configKey != ''">
+                AND config_key like concat('%', #{config.configKey}, '%')
+            </if>
+            <if test="config.params.beginTime != null and config.params.beginTime != ''"><!-- 开始时间检索 -->
+                and date_format(create_time,'%y%m%d') &gt;= date_format(#{config.params.beginTime},'%y%m%d')
+            </if>
+            <if test="config.params.endTime != null and config.params.endTime != ''"><!-- 结束时间检索 -->
+                and date_format(create_time,'%y%m%d') &lt;= date_format(#{config.params.endTime},'%y%m%d')
+            </if>
+        </where>
+    </select>
+
+
     <select id="selectConfigList" parameterType="com.xunmei.system.api.domain.SysConfig" resultMap="SysConfigResult">
         <include refid="selectConfigVo"/>
         <where>