Browse Source

no message

FengChaoYu 1 week ago
parent
commit
0cec78d197
1 changed files with 15 additions and 9 deletions
  1. 15 9
      mall-server-api/src/main/resources/mapper/CommonMapper.xml

+ 15 - 9
mall-server-api/src/main/resources/mapper/CommonMapper.xml

@@ -1790,25 +1790,31 @@
             content
         FROM
             pg_order_operator_log
-        WHERE
-            order_base_id IN
-            <foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
-                #{item}
-            </foreach>
+        <where>
+            <if test="ids != null and ids.size > 0">
+                order_base_id IN
+                <foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
             AND (order_base_id, create_time) IN (
                 SELECT
                     order_base_id,
                     MAX(create_time)
                 FROM
                     pg_order_operator_log
-                WHERE
+                <where>
+                    <if test="ids != null and ids.size > 0">
                     order_base_id IN
-                    <foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
-                        #{item}
-                    </foreach>
+                        <foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
+                            #{item}
+                        </foreach>
+                    </if>
                     GROUP BY
                     order_base_id
+                </where>
             );
+        </where>
     </select>