suochencheng 6 роки тому
батько
коміт
d0505d3b1b

+ 14 - 9
src/main/java/com/izouma/awesomeadmin/dao/UserOrderDetailMapper.xml

@@ -478,15 +478,20 @@
             <!--generatedEnd-->
         </set>
         WHERE
-        <if test="id != null and !&quot;&quot;.equals(id)">
-            id = #{id,jdbcType=INTEGER}
-        </if>
-        <if test="idStr != null and !&quot;&quot;.equals(idStr)">
-            id IN (${idStr})
-        </if>
-        <if test="orderId != null and !&quot;&quot;.equals(orderId)">
-             order_id = #{orderId}
-        </if>
+
+        <choose>
+            <when test="id != null and !&quot;&quot;.equals(id)">
+                id = #{id,jdbcType=INTEGER}
+            </when>
+            <otherwise>
+                <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+                    id IN (${idStr})
+                </if>
+                <if test="orderId != null and !&quot;&quot;.equals(orderId)">
+                    order_id = #{orderId}
+                </if>
+            </otherwise>
+        </choose>
     </update>
 
     <select id="queryUserOrderDetailByPage" parameterType="java.util.Map"