Ver código fonte

优化 组件查询列表

limingming 1 ano atrás
pai
commit
0da9dfe471

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/BasicLibraryMapper.java

@@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ruoyi.system.domain.BasicLibrary;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 基础库管理Mapper接口
@@ -12,4 +13,5 @@ import com.ruoyi.system.domain.BasicLibrary;
  */
 public interface BasicLibraryMapper extends BaseMapper<BasicLibrary> {
 
+    BasicLibrary getBaseOne(@Param("baseId") Long baseId);
 }

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/BasicLibraryService.java

@@ -13,4 +13,5 @@ import com.ruoyi.system.domain.BasicLibrary;
 public interface BasicLibraryService extends IService<BasicLibrary> {
 
 
+    BasicLibrary getBaseOne(Long baseId);
 }

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BasicLibraryServiceImpl.java

@@ -17,4 +17,8 @@ import org.springframework.stereotype.Service;
 public class BasicLibraryServiceImpl  extends ServiceImpl<BasicLibraryMapper, BasicLibrary> implements BasicLibraryService {
 
 
+    @Override
+    public BasicLibrary getBaseOne(Long baseId) {
+        return baseMapper.getBaseOne(baseId);
+    }
 }

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ComponentsLibraryServiceImpl.java

@@ -42,7 +42,7 @@ public class ComponentsLibraryServiceImpl extends ServiceImpl<ComponentsLibraryM
             componentsAndBasicVo.setDictateParameter(componentsLibrary.getDictateParameter());
             componentsAndBasicVo.setDefValue(componentsLibrary.getDefValue());
             componentsAndBasicVo.setRepeatCode(componentsLibrary.getRepeatCode());
-            BasicLibrary one = basicLibraryService.getOne(new LambdaQueryWrapper<BasicLibrary>().eq(BasicLibrary::getId, componentsLibrary.getBaseId()), false);
+            BasicLibrary one = basicLibraryService.getBaseOne(componentsLibrary.getBaseId());
             componentsAndBasicVo.setBaseName(one.getName());
             componentsAndBasicVo.setBandValue(one.getBandValue());
             componentsAndBasicVo.setBootCode(one.getBootCode());

+ 30 - 1
ruoyi-system/src/main/resources/mapper/system/platform/BasicLibraryMapper.xml

@@ -23,7 +23,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <sql id="selectBasicLibraryVo">
         select id, name, band_value, boot_code, boot_code_send, date_code, over_code, status, del_flag, create_by, create_time, update_by, update_time from t_basic_library
     </sql>
-
+    <select id="getBaseOne" resultType="com.ruoyi.system.domain.BasicLibrary">
+        SELECT
+            id,
+            NAME,
+            band_value,
+            boot_code,
+            boot_code_send,
+            boot_code_status,
+            synchronize_code,
+            synchronize_code_send,
+            synchronize_code_status,
+            repeat_code,
+            address_code,
+            address_code_status,
+            date_code,
+            over_code,
+            data_inverse_code_status,
+            date_binary0,
+            date_binary1,
+            STATUS,
+            del_flag,
+            create_by,
+            create_time,
+            update_by,
+            update_time
+        FROM
+            t_basic_library
+        WHERE
+            id = #{baseId}
+    </select>
 
 
 </mapper>