From 72e3d6bb6c90d4d917d27f3cc26346aece060caa Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期三, 18 十二月 2024 15:30:50 +0800
Subject: [PATCH] 设备管理: 查询完善

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DevModelMapper.java |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DevModelMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DevModelMapper.java
index df3a775..1e3a349 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DevModelMapper.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DevModelMapper.java
@@ -28,10 +28,27 @@
                 .orderByDesc(DevModelDO::getId));
     }
 
-    @Select("select distinct brand from lihu.device_model where category=#{category}")
+    @Select("<script> " +
+            " select distinct brand from lihu.device_model " +
+            " <where> deleted = 0 " +
+            "   <if test=\"category != null and category != ''\"> " +
+            "     and category = #{category} " +
+            "   </if> " +
+            " </where> " +
+            "</script>")
     List<String> getBrandByCategory(@Param("category") String category);
 
-    @Select("select model from lihu.device_model where category=#{category} and brand=#{brand}")
+    @Select("<script> " +
+            " select distinct brand from lihu.device_model " +
+            " <where> deleted = 0 " +
+            "   <if test=\"category != null and category != ''\"> " +
+            "     and category = #{category} " +
+            "   </if> " +
+            "   <if test=\"brand != null and brand != ''\"> " +
+            "     and brand = #{brand} " +
+            "   </if> " +
+            " </where> " +
+            "</script>")
     List<String> getModelByCategoryBrand(@Param("category") String category, @Param("brand") String brand);
 
 }
\ No newline at end of file

--
Gitblit v1.9.3