Quellcode durchsuchen

字典项查询不支持筛选

xucaiqin vor 1 Jahr
Ursprung
Commit
81dedd3d7e

+ 1 - 1
iot-module/iot-module-system/iot-module-system-biz/src/main/java/com/middle/platform/system/biz/service/SysDictItemService.java

@@ -42,7 +42,7 @@ public class SysDictItemService {
      */
     public PageRes<SysDictItemVo> list(Long dictId, BasePara basePara) {
         PageHelper.startPage(basePara.getPage(), basePara.getPageSize());
-        List<SysDictItem> sysDictItems = sysDictItemMapper.selectList(new LambdaQueryWrapper<SysDictItem>().eq(SysDictItem::getDictId, dictId).eq(SysDictItem::getDelFlag, Global.UN_DEL));
+        List<SysDictItem> sysDictItems = sysDictItemMapper.query(dictId, basePara);
         if (CollectionUtils.isEmpty(sysDictItems)) {
             return new PageRes<>(basePara.getPage(), basePara.getPageSize());
         }

+ 12 - 0
iot-module/iot-module-system/iot-module-system-biz/src/main/resources/mapper/SysDictItemMapper.xml

@@ -98,4 +98,16 @@
             id = #{id,jdbcType=BIGINT}
         </where>
     </update>
+
+    <select id="query" resultType="com.middle.platform.system.biz.entity.SysDictItem">
+        select *
+        from sys_dict_item sdi
+        <where>
+            sdi.del_flag = 0
+              and sdi.dict_id = #{dictId,jdbcType=BIGINT}
+            <if test="basePara.keywords != null and basePara.keywords != ''">
+                and sdi.label like concat('%', #{basePara.keywords,jdbcType=VARCHAR}, '%')
+            </if>
+        </where>
+    </select>
 </mapper>