Ver Fonte

字典接口拓展

xucaiqin há 1 mês atrás
pai
commit
fa165ee318

+ 3 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/SysDictDao.java

@@ -1,6 +1,7 @@
 package com.sckw.system.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sckw.system.api.model.dto.res.DictProduct;
 import com.sckw.system.model.SysDict;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -92,4 +93,6 @@ public interface SysDictDao extends BaseMapper<SysDict> {
      * @date: 2023/7/7
      */
     List<SysDict> selectAll();
+
+    DictProduct queryProductName(@Param("value") String value);
 }

+ 5 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java

@@ -157,6 +157,11 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
         return map;
     }
 
+    @Override
+    public DictProduct queryProductName(String value) {
+        return sysDictDao.queryProductName(value);
+    }
+
     /**
      * @param type 字典类型,value key
      * @return SysDictResDto

+ 11 - 0
sckw-modules/sckw-system/src/main/resources/mapper/SysDictDao.xml

@@ -266,4 +266,15 @@
      </foreach>
   </select>
 
+  <select id="queryProductName" resultType="com.sckw.system.api.model.dto.res.DictProduct">
+      SELECT l2.label,
+             l2.type
+      FROM sys_dict l3
+               INNER JOIN sys_dict l2 ON l3.parent_id = l2.id
+      WHERE l3.`value`
+          = #{value}
+        AND l3.del_flag = 0
+        AND l2.del_flag = 0
+      limit 1
+  </select>
 </mapper>