Explorar el Código

搜索品牌名称时也按规格排序

liyuan hace 7 meses
padre
commit
8957018431

+ 3 - 3
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/mapper/ProductLaunchMapper.xml

@@ -203,10 +203,10 @@
         GROUP BY
         ppl.id
         ) allGoods
-        <if test="brandId != null">
-            order by  cnameInt
+        <if test="brandId != null or brandName != null  and brandName != ''">
+            order by  cnameInt, sort DESC
         </if>
-        <if test="brandId == null">
+        <if test="brandId == null and (brandName == null or brandName == '')">
             ORDER BY sort DESC, inventoryLocal desc
         </if>
     </select>

+ 3 - 3
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shopping/mapper/ShoppingMallDetailMapper.xml

@@ -121,10 +121,10 @@
         GROUP BY
         goods_code
         ) AS allGoods
-        <if test="brandId != null">
-            order by  cnameInt
+        <if test="brandId != null or brandName != null  and brandName != ''">
+            order by  cnameInt, sort DESC
         </if>
-        <if test="brandId == null">
+        <if test="brandId == null and (brandName == null or brandName == '')">
             ORDER BY sort DESC, inventoryLocal desc
         </if>