suochencheng 7 years ago
parent
commit
290042cb6c
1 changed files with 17 additions and 3 deletions
  1. 17 3
      src/main/java/com/izouma/awesomeadmin/dao/ProductPriceMapper.xml

+ 17 - 3
src/main/java/com/izouma/awesomeadmin/dao/ProductPriceMapper.xml

@@ -96,7 +96,9 @@
             <if test="minCounts!= null">
                 min_counts,
             </if>
-            max_counts,
+            <if test="maxCounts!= null">
+                max_counts,
+            </if>
             <if test="inventory!= null">
                 inventory,
             </if>
@@ -138,7 +140,9 @@
             <if test="minCounts != null">
                 #{minCounts,jdbcType=INTEGER},
             </if>
-            #{maxCounts,jdbcType=INTEGER},
+            <if test="maxCounts != null">
+                #{maxCounts,jdbcType=INTEGER},
+            </if>
             <if test="inventory != null">
                 #{inventory,jdbcType=INTEGER},
             </if>
@@ -183,7 +187,17 @@
             <if test="minCounts != null">
                 min_counts= #{minCounts,jdbcType=INTEGER},
             </if>
-            max_counts= #{maxCounts,jdbcType=INTEGER},
+            <if test="maxCounts != null">
+                <choose>
+                    <when test="maxCounts&lt;0">
+                        max_counts = null,
+                    </when>
+                    <otherwise>
+                        max_counts= #{maxCounts,jdbcType=INTEGER},
+                    </otherwise>
+                </choose>
+
+            </if>
             <if test="inventory != null">
                 inventory= #{inventory,jdbcType=INTEGER},
             </if>