Browse Source

2023-10-27 实验室列表添加关键字搜索过滤。

chaiyunlong 2 years ago
parent
commit
0e2c31e414

+ 11 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/dto/LabSubListQuery.java

@@ -13,6 +13,9 @@ import io.swagger.annotations.ApiModelProperty;
 @ApiModel("实验室列表查询参数")
 public class LabSubListQuery {
 
+    @ApiModelProperty("关键字查询")
+    private String searchValue;
+
     @ApiModelProperty("实验室名称")
     private String name;
 
@@ -34,6 +37,14 @@ public class LabSubListQuery {
      */
     private Boolean pcControl = false;
 
+    public String getSearchValue() {
+        return searchValue;
+    }
+
+    public void setSearchValue(String searchValue) {
+        this.searchValue = searchValue;
+    }
+
     public String getSubDept() {
         return subDept;
     }

+ 8 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSubjectMapper.xml

@@ -404,6 +404,10 @@
             resultMap="LabSubjectResultVO">
         <include refid="selectLabSubjectListVo"/>
         <where>
+            <if test="searchValue != null ">
+                and (t.name like concat('%', #{searchValue}, '%')
+                or t.room like concat('%', #{searchValue}, '%'))
+            </if>
             <if test="name != null  and name != ''">and t.name like concat('%', #{name}, '%')</if>
             <if test="adminName != null  and adminName != ''">and su.nick_name like concat('%', #{adminName}, '%')</if>
 
@@ -478,6 +482,10 @@
         left join sys_dept sd on sd.dept_id = t.dept_id
         left join lab_safe_classified cf on cf.id = t.level
         <where>
+            <if test="searchValue != null ">
+                and (t.name like concat('%', #{searchValue}, '%')
+                or t.room like concat('%', #{searchValue}, '%'))
+            </if>
             <if test="name != null  and name != ''">and t.name like concat('%', #{name}, '%')</if>
             <if test="adminName != null  and adminName != ''">and su.nick_name like concat('%', #{adminName}, '%')</if>