yuanchao 1 сар өмнө
parent
commit
e70d1e5ebb

+ 14 - 14
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/IotOpeationFillMapper.xml

@@ -224,6 +224,7 @@
             a.device_name LIKE CONCAT('%', #{orgName}, '%')
             OR a.device_code LIKE CONCAT('%', #{orgName}, '%')
             or b.user_name LIKE CONCAT('%', #{orgName}, '%')
+            or b.order_name LIKE CONCAT('%', #{orgName}, '%')
             )
         </if>
         <if test="orgName == null or orgName == ''">
@@ -256,20 +257,19 @@
 
     <select id="fillRecords" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillPageReqVO"
             resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillOrderDO">
-        select a.*
-        from
-               rq_iot_opeation_fill_order a,
-               rq_iot_opeation_fill b
-        where
-               a.id = b.order_id
-          and
-               b.device_id = #{deviceId}
-          <if test="orderName != null  and orderName != ''">
-               and a.order_name like #{orderName}
-          </if>
-          <if test="orderStatus != null  and orderStatus != ''">
-              and a.order_status like #{orderStatus}
-          </if>
+        SELECT a.*
+        FROM rq_iot_opeation_fill_order a
+        JOIN rq_iot_opeation_fill b ON a.id = b.order_id
+        WHERE b.device_id = #{deviceId}
+        <if test="orderName != null and orderName != ''">
+            AND (a.order_name LIKE CONCAT('%', #{orderName}, '%')
+            OR b.device_code LIKE CONCAT('%', #{orderName}, '%')
+            OR b.device_name LIKE CONCAT('%', #{orderName}, '%'))
+        </if>
+        <if test="orderStatus != null and orderStatus != ''">
+            AND a.order_status = #{orderStatus}
+        </if>
+        ORDER BY a.create_time DESC
     </select>
 
     <select id="rhList"