Browse Source

铁路点位

459242451@qq.com 3 years ago
parent
commit
6b10e62609

+ 28 - 23
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlCommonController.java

@@ -1,52 +1,41 @@
 package com.ruoyi.web.controller.qdtl;
 
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
-import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.redis.RedisCache;
-import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.qdtl.domain.TlArea;
-import com.ruoyi.qdtl.domain.TlAreaMonitor;
-import com.ruoyi.qdtl.domain.TlMonitor;
-import com.ruoyi.qdtl.service.ITlAreaService;
-import com.ruoyi.qdtl.service.ITlMonitorService;
+import com.ruoyi.system.domain.SysConfig;
+import com.ruoyi.system.service.ISysConfigService;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
 
 /**
  * 监控设备管理Controller
- * 
+ *
  * @author ruoyi
  * @date 2022-03-02
  */
 @RestController
 @RequestMapping("/qdtl/common")
-public class TlCommonController extends BaseController
-{
+@Slf4j
+public class TlCommonController extends BaseController {
 
     @Autowired
     private RedisCache redisCache;
+    @Autowired
+    private ISysConfigService sysConfigService;
 
     /**
      * 查询监控设备管理列表
@@ -59,15 +48,31 @@ public class TlCommonController extends BaseController
             method = "post";
         }
         String params = jsonObject.getStr("params");
+        // 通过params解析缓存key
+        String paramsPath = JSONUtil.parseObj(params).getStr("path");
         String result = "";
         if ("post".equals(method)) {
-            result = HttpUtil.post(url, params);
+            try {
+                result = HttpRequest.post(url).timeout(8000).body(params).execute().body();
+                // 结果集存入缓存
+                redisCache.setCacheObject("tl:http:" + paramsPath, result);
+            } catch (Exception e) {
+                log.error("http请求失败:{}", e.getMessage());
+                // 从缓存中取值
+                result = redisCache.getCacheObject("tl:http:" + paramsPath);
+            }
 
         } else if ("get".equals(method)) {
             result = HttpUtil.get(url);
         }
 
-        return AjaxResult.success("请求成功",result);
+        return AjaxResult.success("请求成功", result);
+    }
+
+    @GetMapping("/railwayLine")
+    public AjaxResult railwayLine(@RequestParam(required = false) String key) {
+        List<SysConfig> list = sysConfigService.selectConfigByLeftKey("tl.railway.");
+        return AjaxResult.success(list);
     }
 
 

+ 14 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/XunTask.java

@@ -53,4 +53,18 @@ public class XunTask {
             }
         }
     }
+
+    /**
+     * 同步巡检记录
+     */
+    public void syncCheckpointLog() {
+
+    }
+
+    /**
+     * 同步巡检轨迹
+     */
+    public void syncTrail() {
+
+    }
 }

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/IQdCommonService.java

@@ -17,4 +17,8 @@ public interface IQdCommonService {
 
     JSONArray getDevice();
 
+    JSONArray getCheckpointLog(String startTime, String endTime);
+
+    JSONArray getTrail(String startTime, String endTime, String deviceId);
+
 }

+ 50 - 4
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/QdCommonServiceImpl.java

@@ -8,16 +8,14 @@ import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.exception.ServiceException;
-import com.ruoyi.qdtl.domain.XunDevice;
 import com.ruoyi.qdtl.service.IQdCommonService;
+import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
@@ -35,12 +33,17 @@ public class QdCommonServiceImpl implements IQdCommonService {
     private String xuntokenUrl;
     @Value("${third.xundevice}")
     private String xundeviceUrl;
+    @Value("${third.xuncheckpointLog}")
+    private String xuncheckpointLogUrl;
+    @Value("${third.xuntrail}")
+    private String xuntrailUrl;
 
     @Autowired
     private RedisCache redisCache;
 
     /**
      * 获取巡检接口的token
+     *
      * @return
      */
     @Override
@@ -59,7 +62,7 @@ public class QdCommonServiceImpl implements IQdCommonService {
             // 存入缓存。暂定为6小时过期
             redisCache.setCacheObject("xun:token", token, 6, TimeUnit.HOURS);
         } else {
-            log.error("获取xun接口的token失败:{}",postJson);
+            log.error("获取xun接口的token失败:{}", postJson);
             throw new ServiceException("获取xun接口的token失败");
         }
         return token;
@@ -67,6 +70,7 @@ public class QdCommonServiceImpl implements IQdCommonService {
 
     /**
      * 设备列表
+     *
      * @return
      */
     @Override
@@ -79,4 +83,46 @@ public class QdCommonServiceImpl implements IQdCommonService {
         }
         return new JSONArray();
     }
+
+    /**
+     * 查询巡检记录
+     *
+     * @param startTime 时间戳(秒)
+     * @param endTime
+     * @return
+     */
+    @Override
+    @SneakyThrows
+    public JSONArray getCheckpointLog(String startTime, String endTime) {
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("startTime", startTime);
+        paramMap.put("endTime", endTime);
+        String get = HttpRequest.get(xuncheckpointLogUrl).form(paramMap).header("Authorization", this.getXunToken()).execute().body();
+        JSONObject getJson = JSONUtil.parseObj(get);
+        if (200 == getJson.getInt("code")) {
+            JSONObject data = getJson.getJSONObject("data");
+            if (data != null) {
+                return data.getJSONArray("rows");
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 查询设备运行轨迹
+     *
+     * @param startTime
+     * @param endTime
+     * @param deviceId
+     * @return
+     */
+    @Override
+    public JSONArray getTrail(String startTime, String endTime, String deviceId) {
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("startTime", startTime);
+        paramMap.put("endTime", endTime);
+        paramMap.put("deviceId", deviceId);
+        String get = HttpRequest.get(xuntrailUrl).form(paramMap).header("Authorization", this.getXunToken()).execute().body();
+        return JSONUtil.parseArray(get);
+    }
 }

+ 14 - 11
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java

@@ -1,18 +1,19 @@
 package com.ruoyi.system.mapper;
 
-import java.util.List;
 import com.ruoyi.system.domain.SysConfig;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 参数配置 数据层
- * 
+ *
  * @author ruoyi
  */
-public interface SysConfigMapper
-{
+public interface SysConfigMapper {
     /**
      * 查询参数配置信息
-     * 
+     *
      * @param config 参数配置信息
      * @return 参数配置信息
      */
@@ -20,7 +21,7 @@ public interface SysConfigMapper
 
     /**
      * 查询参数配置列表
-     * 
+     *
      * @param config 参数配置信息
      * @return 参数配置集合
      */
@@ -28,7 +29,7 @@ public interface SysConfigMapper
 
     /**
      * 根据键名查询参数配置信息
-     * 
+     *
      * @param configKey 参数键名
      * @return 参数配置信息
      */
@@ -36,7 +37,7 @@ public interface SysConfigMapper
 
     /**
      * 新增参数配置
-     * 
+     *
      * @param config 参数配置信息
      * @return 结果
      */
@@ -44,7 +45,7 @@ public interface SysConfigMapper
 
     /**
      * 修改参数配置
-     * 
+     *
      * @param config 参数配置信息
      * @return 结果
      */
@@ -52,7 +53,7 @@ public interface SysConfigMapper
 
     /**
      * 删除参数配置
-     * 
+     *
      * @param configId 参数ID
      * @return 结果
      */
@@ -60,9 +61,11 @@ public interface SysConfigMapper
 
     /**
      * 批量删除参数信息
-     * 
+     *
      * @param configIds 需要删除的参数ID
      * @return 结果
      */
     public int deleteConfigByIds(Long[] configIds);
+
+    List<SysConfig> selectConfigByLeftKey(@Param("leftKey") String leftKey);
 }

+ 14 - 12
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java

@@ -1,18 +1,18 @@
 package com.ruoyi.system.service;
 
-import java.util.List;
 import com.ruoyi.system.domain.SysConfig;
 
+import java.util.List;
+
 /**
  * 参数配置 服务层
- * 
+ *
  * @author ruoyi
  */
-public interface ISysConfigService
-{
+public interface ISysConfigService {
     /**
      * 查询参数配置信息
-     * 
+     *
      * @param configId 参数配置ID
      * @return 参数配置信息
      */
@@ -20,7 +20,7 @@ public interface ISysConfigService
 
     /**
      * 根据键名查询参数配置信息
-     * 
+     *
      * @param configKey 参数键名
      * @return 参数键值
      */
@@ -28,14 +28,14 @@ public interface ISysConfigService
 
     /**
      * 获取验证码开关
-     * 
+     *
      * @return true开启,false关闭
      */
     public boolean selectCaptchaOnOff();
 
     /**
      * 查询参数配置列表
-     * 
+     *
      * @param config 参数配置信息
      * @return 参数配置集合
      */
@@ -43,7 +43,7 @@ public interface ISysConfigService
 
     /**
      * 新增参数配置
-     * 
+     *
      * @param config 参数配置信息
      * @return 结果
      */
@@ -51,7 +51,7 @@ public interface ISysConfigService
 
     /**
      * 修改参数配置
-     * 
+     *
      * @param config 参数配置信息
      * @return 结果
      */
@@ -59,7 +59,7 @@ public interface ISysConfigService
 
     /**
      * 批量删除参数信息
-     * 
+     *
      * @param configIds 需要删除的参数ID
      */
     public void deleteConfigByIds(Long[] configIds);
@@ -81,9 +81,11 @@ public interface ISysConfigService
 
     /**
      * 校验参数键名是否唯一
-     * 
+     *
      * @param config 参数信息
      * @return 结果
      */
     public String checkConfigKeyUnique(SysConfig config);
+
+    List<SysConfig> selectConfigByLeftKey(String leftKey);
 }

+ 39 - 56
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java

@@ -13,18 +13,18 @@ import com.ruoyi.system.mapper.SysConfigMapper;
 import com.ruoyi.system.service.ISysConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
 import javax.annotation.PostConstruct;
 import java.util.Collection;
 import java.util.List;
 
 /**
  * 参数配置 服务层实现
- * 
+ *
  * @author ruoyi
  */
 @Service
-public class SysConfigServiceImpl implements ISysConfigService
-{
+public class SysConfigServiceImpl implements ISysConfigService {
     @Autowired
     private SysConfigMapper configMapper;
 
@@ -35,21 +35,19 @@ public class SysConfigServiceImpl implements ISysConfigService
      * 项目启动时,初始化参数到缓存
      */
     @PostConstruct
-    public void init()
-    {
+    public void init() {
         loadingConfigCache();
     }
 
     /**
      * 查询参数配置信息
-     * 
+     *
      * @param configId 参数配置ID
      * @return 参数配置信息
      */
     @Override
     @DataSource(DataSourceType.MASTER)
-    public SysConfig selectConfigById(Long configId)
-    {
+    public SysConfig selectConfigById(Long configId) {
         SysConfig config = new SysConfig();
         config.setConfigId(configId);
         return configMapper.selectConfig(config);
@@ -57,23 +55,20 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 根据键名查询参数配置信息
-     * 
+     *
      * @param configKey 参数key
      * @return 参数键值
      */
     @Override
-    public String selectConfigByKey(String configKey)
-    {
+    public String selectConfigByKey(String configKey) {
         String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(configKey)));
-        if (StringUtils.isNotEmpty(configValue))
-        {
+        if (StringUtils.isNotEmpty(configValue)) {
             return configValue;
         }
         SysConfig config = new SysConfig();
         config.setConfigKey(configKey);
         SysConfig retConfig = configMapper.selectConfig(config);
-        if (StringUtils.isNotNull(retConfig))
-        {
+        if (StringUtils.isNotNull(retConfig)) {
             redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue());
             return retConfig.getConfigValue();
         }
@@ -82,15 +77,13 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 获取验证码开关
-     * 
+     *
      * @return true开启,false关闭
      */
     @Override
-    public boolean selectCaptchaOnOff()
-    {
+    public boolean selectCaptchaOnOff() {
         String captchaOnOff = selectConfigByKey("sys.account.captchaOnOff");
-        if (StringUtils.isEmpty(captchaOnOff))
-        {
+        if (StringUtils.isEmpty(captchaOnOff)) {
             return true;
         }
         return Convert.toBool(captchaOnOff);
@@ -98,28 +91,25 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 查询参数配置列表
-     * 
+     *
      * @param config 参数配置信息
      * @return 参数配置集合
      */
     @Override
-    public List<SysConfig> selectConfigList(SysConfig config)
-    {
+    public List<SysConfig> selectConfigList(SysConfig config) {
         return configMapper.selectConfigList(config);
     }
 
     /**
      * 新增参数配置
-     * 
+     *
      * @param config 参数配置信息
      * @return 结果
      */
     @Override
-    public int insertConfig(SysConfig config)
-    {
+    public int insertConfig(SysConfig config) {
         int row = configMapper.insertConfig(config);
-        if (row > 0)
-        {
+        if (row > 0) {
             redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
         }
         return row;
@@ -127,16 +117,14 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 修改参数配置
-     * 
+     *
      * @param config 参数配置信息
      * @return 结果
      */
     @Override
-    public int updateConfig(SysConfig config)
-    {
+    public int updateConfig(SysConfig config) {
         int row = configMapper.updateConfig(config);
-        if (row > 0)
-        {
+        if (row > 0) {
             redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
         }
         return row;
@@ -144,17 +132,14 @@ public class SysConfigServiceImpl implements ISysConfigService
 
     /**
      * 批量删除参数信息
-     * 
+     *
      * @param configIds 需要删除的参数ID
      */
     @Override
-    public void deleteConfigByIds(Long[] configIds)
-    {
-        for (Long configId : configIds)
-        {
+    public void deleteConfigByIds(Long[] configIds) {
+        for (Long configId : configIds) {
             SysConfig config = selectConfigById(configId);
-            if (StringUtils.equals(UserConstants.YES, config.getConfigType()))
-            {
+            if (StringUtils.equals(UserConstants.YES, config.getConfigType())) {
                 throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
             }
             configMapper.deleteConfigById(configId);
@@ -166,11 +151,9 @@ public class SysConfigServiceImpl implements ISysConfigService
      * 加载参数缓存数据
      */
     @Override
-    public void loadingConfigCache()
-    {
+    public void loadingConfigCache() {
         List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig());
-        for (SysConfig config : configsList)
-        {
+        for (SysConfig config : configsList) {
             redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
         }
     }
@@ -179,8 +162,7 @@ public class SysConfigServiceImpl implements ISysConfigService
      * 清空参数缓存数据
      */
     @Override
-    public void clearConfigCache()
-    {
+    public void clearConfigCache() {
         Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*");
         redisCache.deleteObject(keys);
     }
@@ -189,38 +171,39 @@ public class SysConfigServiceImpl implements ISysConfigService
      * 重置参数缓存数据
      */
     @Override
-    public void resetConfigCache()
-    {
+    public void resetConfigCache() {
         clearConfigCache();
         loadingConfigCache();
     }
 
     /**
      * 校验参数键名是否唯一
-     * 
+     *
      * @param config 参数配置信息
      * @return 结果
      */
     @Override
-    public String checkConfigKeyUnique(SysConfig config)
-    {
+    public String checkConfigKeyUnique(SysConfig config) {
         Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
         SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey());
-        if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue())
-        {
+        if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
     }
 
+    @Override
+    public List<SysConfig> selectConfigByLeftKey(String leftKey) {
+        return configMapper.selectConfigByLeftKey(leftKey);
+    }
+
     /**
      * 设置cache key
-     * 
+     *
      * @param configKey 参数键
      * @return 缓存键key
      */
-    private String getCacheKey(String configKey)
-    {
+    private String getCacheKey(String configKey) {
         return Constants.SYS_CONFIG_KEY + configKey;
     }
 }

+ 86 - 70
ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml

@@ -1,91 +1,105 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.system.mapper.SysConfigMapper">
-    
+
     <resultMap type="SysConfig" id="SysConfigResult">
-    	<id     property="configId"      column="config_id"      />
-        <result property="configName"    column="config_name"    />
-        <result property="configKey"     column="config_key"     />
-        <result property="configValue"   column="config_value"   />
-        <result property="configType"    column="config_type"    />
-        <result property="createBy"      column="create_by"      />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"      column="update_by"      />
-        <result property="updateTime"    column="update_time"    />
+        <id property="configId" column="config_id"/>
+        <result property="configName" column="config_name"/>
+        <result property="configKey" column="config_key"/>
+        <result property="configValue" column="config_value"/>
+        <result property="configType" column="config_type"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
     </resultMap>
-    
+
     <sql id="selectConfigVo">
-        select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark 
-		from sys_config
+        select config_id,
+               config_name,
+               config_key,
+               config_value,
+               config_type,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from sys_config
     </sql>
-    
+
     <!-- 查询条件 -->
-	<sql id="sqlwhereSearch">
-		<where>
-			<if test="configId !=null">
-				and config_id = #{configId}
-			</if>
-			<if test="configKey !=null and configKey != ''">
-				and config_key = #{configKey}
-			</if>
-		</where>
-	</sql>
-    
+    <sql id="sqlwhereSearch">
+        <where>
+            <if test="configId !=null">
+                and config_id = #{configId}
+            </if>
+            <if test="configKey !=null and configKey != ''">
+                and config_key = #{configKey}
+            </if>
+        </where>
+    </sql>
+
     <select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
         <include refid="selectConfigVo"/>
         <include refid="sqlwhereSearch"/>
     </select>
-    
+
     <select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
         <include refid="selectConfigVo"/>
         <where>
-			<if test="configName != null and configName != ''">
-				AND config_name like concat('%', #{configName}, '%')
-			</if>
-			<if test="configType != null and configType != ''">
-				AND config_type = #{configType}
-			</if>
-			<if test="configKey != null and configKey != ''">
-				AND config_key like concat('%', #{configKey}, '%')
-			</if>
-			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-				and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
-			</if>
-			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-				and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
-			</if>
-		</where>
+            <if test="configName != null and configName != ''">
+                AND config_name like concat('%', #{configName}, '%')
+            </if>
+            <if test="configType != null and configType != ''">
+                AND config_type = #{configType}
+            </if>
+            <if test="configKey != null and configKey != ''">
+                AND config_key like concat('%', #{configKey}, '%')
+            </if>
+            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+                and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+            </if>
+            <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+                and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+            </if>
+        </where>
     </select>
-    
+
     <select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
         <include refid="selectConfigVo"/>
         where config_key = #{configKey} limit 1
     </select>
-    
+
+    <select id="selectConfigByLeftKey" parameterType="String" resultMap="SysConfigResult">
+        <include refid="selectConfigVo"/>
+        where config_key like concat(#{leftKey},'%')
+    </select>
+
     <insert id="insertConfig" parameterType="SysConfig">
         insert into sys_config (
-			<if test="configName != null and configName != '' ">config_name,</if>
-			<if test="configKey != null and configKey != '' ">config_key,</if>
-			<if test="configValue != null and configValue != '' ">config_value,</if>
-			<if test="configType != null and configType != '' ">config_type,</if>
-			<if test="createBy != null and createBy != ''">create_by,</if>
-			<if test="remark != null and remark != ''">remark,</if>
- 			create_time
+        <if test="configName != null and configName != '' ">config_name,</if>
+        <if test="configKey != null and configKey != '' ">config_key,</if>
+        <if test="configValue != null and configValue != '' ">config_value,</if>
+        <if test="configType != null and configType != '' ">config_type,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        <if test="remark != null and remark != ''">remark,</if>
+        create_time
         )values(
-			<if test="configName != null and configName != ''">#{configName},</if>
-			<if test="configKey != null and configKey != ''">#{configKey},</if>
-			<if test="configValue != null and configValue != ''">#{configValue},</if>
-			<if test="configType != null and configType != ''">#{configType},</if>
-			<if test="createBy != null and createBy != ''">#{createBy},</if>
-			<if test="remark != null and remark != ''">#{remark},</if>
- 			sysdate()
-		)
+        <if test="configName != null and configName != ''">#{configName},</if>
+        <if test="configKey != null and configKey != ''">#{configKey},</if>
+        <if test="configValue != null and configValue != ''">#{configValue},</if>
+        <if test="configType != null and configType != ''">#{configType},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        <if test="remark != null and remark != ''">#{remark},</if>
+        sysdate()
+        )
     </insert>
-	 
+
     <update id="updateConfig" parameterType="SysConfig">
-        update sys_config 
+        update sys_config
         <set>
             <if test="configName != null and configName != ''">config_name = #{configName},</if>
             <if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
@@ -93,20 +107,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="configType != null and configType != ''">config_type = #{configType},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
             <if test="remark != null">remark = #{remark},</if>
- 			update_time = sysdate()
+            update_time = sysdate()
         </set>
         where config_id = #{configId}
     </update>
-	
+
     <delete id="deleteConfigById" parameterType="Long">
-        delete from sys_config where config_id = #{configId}
+        delete
+        from sys_config
+        where config_id = #{configId}
     </delete>
-    
+
     <delete id="deleteConfigByIds" parameterType="Long">
-        delete from sys_config where config_id in 
+        delete from sys_config where config_id in
         <foreach item="configId" collection="array" open="(" separator="," close=")">
-        	#{configId}
+            #{configId}
         </foreach>
     </delete>
-    
+
 </mapper>