Browse Source

【NEW】增加安全工具关键字搜索

ZhaoMn 3 years ago
parent
commit
3d74872ec1

+ 11 - 6
railway-business/src/main/resources/mapper/safetool/BaseSafetyToolMapper.xml

@@ -40,7 +40,7 @@
   <sql id="Base_Column_List">
     t.tool_id,
     t.dept_id,
-    dept.dept_name,
+    d.dept_name,
     t.store_place,
     dict1.dict_label as tool_name,
     t.tool_type,
@@ -294,7 +294,7 @@
     SELECT
     <include refid="Base_Column_List"/>
     FROM base_safety_tool t
-    LEFT JOIN sys_dept dept on t.dept_id = dept.dept_id
+    LEFT JOIN sys_dept d on t.dept_id = d.dept_id
     LEFT JOIN sys_dict_data dict1 ON (t.tool_type = dict1.dict_value AND dict1.dict_type =
     'tool_type')
     LEFT JOIN sys_dict_data dict2 ON (t.test_cycle = dict2.dict_value AND dict2.dict_type =
@@ -307,7 +307,7 @@
     SELECT
     <include refid="Base_Column_List"/>
     FROM base_safety_tool t
-    LEFT JOIN sys_dept dept on t.dept_id = dept.dept_id
+    LEFT JOIN sys_dept d on t.dept_id = d.dept_id
     LEFT JOIN sys_dict_data dict1 ON (t.tool_type = dict1.dict_value AND dict1.dict_type =
     'tool_type')
     LEFT JOIN sys_dict_data dict2 ON (t.test_cycle = dict2.dict_value AND dict2.dict_type =
@@ -319,7 +319,7 @@
     SELECT
     <include refid="Base_Column_List"/>
     FROM base_safety_tool t
-    LEFT JOIN sys_dept dept on t.dept_id = dept.dept_id
+    LEFT JOIN sys_dept d on t.dept_id = d.dept_id
     LEFT JOIN sys_dict_data dict1 ON (t.tool_type = dict1.dict_value AND dict1.dict_type =
     'tool_type')
     LEFT JOIN sys_dict_data dict2 ON (t.test_cycle = dict2.dict_value AND dict2.dict_type =
@@ -344,8 +344,13 @@
       <if test="elecLevel!=null and elecLevel!=''">
         and t.elec_level=#{elecLevel}
       </if>
-      <if test="unit!=null and unit!=''">
-        and t.unit=#{unit}
+      <if test="searchValue != null and searchValue != ''">
+        AND (
+        t.tool_name like concat('%', #{searchValue}, '%')
+        OR t.tool_code like concat('%', #{searchValue}, '%')
+        OR d.dept_name like concat('%', #{searchValue}, '%')
+        OR t.store_place like concat('%', #{searchValue}, '%')
+        )
       </if>
       <if test="testCycle!=null and testCycle!=''">
         and t.test_cycle=#{testCycle}