Răsfoiți Sursa

feat(order): 添加商品数量统计和退货项目信息

- 在订单主服务中计算并设置商品总数量
- 为退货项目实体添加商品ID、编号、单位和图片字段
- 在退货项目业务对象中增加相应的商品信息属性
- 在退货项目视图对象中添加Excel导出的商品字段
- 修复退货服务中的数据返回问题,确保退货详情正确加载
- 更新前端控制器中的订单状态描述,将待审核改为待支付
- 将订单商品价格从市场价改为会员价以支持会员折扣
- 格式化产品模块的SQL映射文件以提高可读性
hurx 1 lună în urmă
părinte
comite
3f9a69957b

+ 4 - 4
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/controller/pc/PcOrderController.java

@@ -269,10 +269,10 @@ public class PcOrderController extends BaseController {
             mainBo.setWarehouseId(1L); // TODO: 后续可配置或根据客户动态获取
 
 
-            // 设置订单状态为待审核
+            // 设置订单状态为待支付
             mainBo.setOrderStatus(OrderStatus.PENDING_PAYMENT.getCode());
 
-            // 设置检查状态为待审核
+            // 设置审核状态为待审核
             mainBo.setCheckStatus("0");
 
             mainBo.setOrderSource(OrderSourceEnum.BEFORE_ADD.getCode());
@@ -325,9 +325,9 @@ public class PcOrderController extends BaseController {
                     orderProductBo.setProductUnitId(Long.valueOf(productVo.getUnitId()));
                     orderProductBo.setProductUnit(productVo.getUnitName());
                     orderProductBo.setProductImage(productVo.getProductImageUrl());
-                    orderProductBo.setOrderPrice(productVo.getMarketPrice());
+                    orderProductBo.setOrderPrice(productVo.getMemberPrice());
                     orderProductBo.setOrderQuantity(quantity);
-                    orderProductBo.setSubtotal(productVo.getMarketPrice().multiply(BigDecimal.valueOf(quantity)));
+                    orderProductBo.setSubtotal(productVo.getMemberPrice().multiply(BigDecimal.valueOf(quantity)));
                     return orderProductBo;
                 })
                 .filter(Objects::nonNull)

+ 21 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/domain/OrderReturnItem.java

@@ -4,6 +4,7 @@ import org.dromara.common.tenant.core.TenantEntity;
 import com.baomidou.mybatisplus.annotation.*;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+
 import java.math.BigDecimal;
 
 import java.io.Serial;
@@ -43,6 +44,26 @@ public class OrderReturnItem extends TenantEntity {
      */
     private String productSku;
 
+    /**
+     * 商品ID
+     */
+    private Long productId;
+
+    /**
+     * 商品编号
+     */
+    private String productNo;
+
+    /**
+     * 商品单位
+     */
+    private String productUnit;
+
+    /**
+     * 商品图片
+     */
+    private String productImage;
+
     /**
      * 商品名称
      */

+ 21 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/domain/bo/OrderReturnItemBo.java

@@ -8,6 +8,7 @@ import io.github.linpeilie.annotations.AutoMapper;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import jakarta.validation.constraints.*;
+
 import java.math.BigDecimal;
 
 /**
@@ -41,6 +42,26 @@ public class OrderReturnItemBo extends BaseEntity {
      */
     private String productSku;
 
+    /**
+     * 商品ID
+     */
+    private Long productId;
+
+    /**
+     * 商品编号
+     */
+    private String productNo;
+
+    /**
+     * 商品单位
+     */
+    private String productUnit;
+
+    /**
+     * 商品图片
+     */
+    private String productImage;
+
     /**
      * 商品名称
      */

+ 14 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/domain/vo/OrderReturnItemVo.java

@@ -53,6 +53,20 @@ public class OrderReturnItemVo implements Serializable {
     @ExcelProperty(value = "商品SKU编码")
     private String productSku;
 
+    @ExcelProperty(value = "商品ID")
+    private Long productId;
+
+    @ExcelProperty(value = "商品编号")
+    private String productNo;
+
+    @ExcelProperty(value = "商品单位")
+    private String productUnit;
+
+    /**
+     * 商品图片
+     */
+    private String productImage;
+
     /**
      * 商品名称
      */

+ 4 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/impl/OrderMainServiceImpl.java

@@ -272,6 +272,8 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
 
             BigDecimal totalAmount = orderProductBos.stream().map(OrderProductBo::getSubtotal).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
 
+            Long productQuantity = orderProductBos.stream().mapToLong(OrderProductBo::getOrderQuantity).sum();
+
             // 应付总额 = 商品总价 + 运费
             BigDecimal payableAmount = totalAmount.add(bo.getShippingFee());
 
@@ -279,6 +281,8 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
             String orderNo = SequenceUtils.generateOrderCode("RS");
             bo.setOrderNo(orderNo);
 
+            bo.setProductQuantity(productQuantity);
+
             bo.setTotalAmount(totalAmount);
 
             bo.setPayableAmount(payableAmount);

+ 1 - 1
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/impl/OrderReturnServiceImpl.java

@@ -58,7 +58,7 @@ public class OrderReturnServiceImpl extends ServiceImpl<OrderReturnMapper, Order
         OrderReturnVo orderReturnVo = baseMapper.selectVoById(id);
         orderReturnVo.setOrderReturnItemList(orderReturnItemMapper.selectVoList(new LambdaQueryWrapper<OrderReturnItem>()
             .eq(OrderReturnItem::getReturnId, orderReturnVo.getId())));
-        return baseMapper.selectVoById(id);
+        return orderReturnVo;
     }
 
     /**

+ 167 - 169
ruoyi-modules/ruoyi-product/src/main/resources/mapper/product/ProductBaseMapper.xml

@@ -1,38 +1,38 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.dromara.product.mapper.ProductBaseMapper">
 
     <!-- 站点产品列表查询(联表查询) -->
     <select id="selectSiteProductPage" resultType="org.dromara.product.domain.vo.SiteProductVo">
         SELECT
-            b.id,
-            b.product_no AS productNo,
-            b.item_name AS productName,
-            b.product_image AS productImage,
-            b.is_self AS isSelf,
-            b.product_review_status AS productReviewStatus,
-            b.product_status AS productStatus,
-            p.market_price AS marketPrice,
-            p.member_price AS memberPrice,
-            p.min_selling_price AS minSellingPrice,
-            p.purchasing_price AS purchasingPrice,
-            p.max_purchase_price AS maxPurchasePrice,
-            p.total_inventory AS totalInventory,
-            p.now_inventory AS nowInventory,
-            p.virtual_inventory AS virtualInventory,
-            p.min_order_quantity AS minOrderQuantity,
-            b.brand_id AS brandId,
-            br.brand_name AS brandName,
-            b.top_category_id AS topCategoryId,
-            tc.category_name AS topCategoryName,
-            b.medium_category_id AS mediumCategoryId,
-            mc.category_name AS mediumCategoryName,
-            b.bottom_category_id AS bottomCategoryId,
-            bc.category_name AS bottomCategoryName,
-            GROUP_CONCAT(DISTINCT gcl.category_name) AS giftCategoryName,
-            b.remark
+        b.id,
+        b.product_no AS productNo,
+        b.item_name AS productName,
+        b.product_image AS productImage,
+        b.is_self AS isSelf,
+        b.product_review_status AS productReviewStatus,
+        b.product_status AS productStatus,
+        p.market_price AS marketPrice,
+        p.member_price AS memberPrice,
+        p.min_selling_price AS minSellingPrice,
+        p.purchasing_price AS purchasingPrice,
+        p.max_purchase_price AS maxPurchasePrice,
+        p.total_inventory AS totalInventory,
+        p.now_inventory AS nowInventory,
+        p.virtual_inventory AS virtualInventory,
+        p.min_order_quantity AS minOrderQuantity,
+        b.brand_id AS brandId,
+        br.brand_name AS brandName,
+        b.top_category_id AS topCategoryId,
+        tc.category_name AS topCategoryName,
+        b.medium_category_id AS mediumCategoryId,
+        mc.category_name AS mediumCategoryName,
+        b.bottom_category_id AS bottomCategoryId,
+        bc.category_name AS bottomCategoryName,
+        GROUP_CONCAT(DISTINCT gcl.category_name) AS giftCategoryName,
+        b.remark
         FROM product_base b
         LEFT JOIN product_price_inventory p ON b.id = p.product_id AND p.del_flag = '0'
         LEFT JOIN product_brand br ON b.brand_id = br.id AND br.del_flag = '0'
@@ -43,7 +43,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             b.del_flag = '0'
             <if test="bo.keyword != null and bo.keyword != ''">
-                AND (b.product_no LIKE CONCAT('%', #{bo.keyword}, '%') OR b.item_name LIKE CONCAT('%', #{bo.keyword}, '%'))
+                AND (b.product_no LIKE CONCAT('%', #{bo.keyword}, '%') OR b.item_name LIKE CONCAT('%', #{bo.keyword},
+                '%'))
             </if>
             <if test="bo.brandId != null">
                 AND b.brand_id = #{bo.brandId}
@@ -68,32 +69,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
         </where>
         GROUP BY b.id, b.product_no, b.item_name, b.product_image, b.is_self,
-                 b.product_review_status, b.product_status, b.brand_id,
-                 b.top_category_id, b.medium_category_id, b.bottom_category_id, b.remark,
-                 p.market_price, p.member_price, p.min_selling_price, p.purchasing_price,
-                 p.max_purchase_price, p.total_inventory, p.now_inventory, p.virtual_inventory,
-                 p.min_order_quantity, br.brand_name, tc.category_name, mc.category_name, bc.category_name
+        b.product_review_status, b.product_status, b.brand_id,
+        b.top_category_id, b.medium_category_id, b.bottom_category_id, b.remark,
+        p.market_price, p.member_price, p.min_selling_price, p.purchasing_price,
+        p.max_purchase_price, p.total_inventory, p.now_inventory, p.virtual_inventory,
+        p.min_order_quantity, br.brand_name, tc.category_name, mc.category_name, bc.category_name
         ORDER BY b.create_time DESC
     </select>
 
     <!-- 推荐商品列表查询(联表查询分类名称) -->
     <select id="selectRecommendProductPage" resultType="org.dromara.product.domain.vo.RecommendProductVo">
         SELECT
-            b.id,
-            b.product_no AS productNo,
-            b.item_name AS itemName,
-            b.product_image AS productImage,
-            tc.category_name AS topCategoryName,
-            mc.category_name AS mediumCategoryName,
-            bc.category_name AS bottomCategoryName,
-            b.product_status AS productStatus,
-            b.home_recommended AS homeRecommended,
-            b.category_recommendation AS categoryRecommendation,
-            b.cart_recommendation AS cartRecommendation,
-            b.is_popular AS isPopular,
-            b.recommended_product_order AS recommendedProductOrder,
-            p.market_price AS marketPrice,
-            p.min_selling_price AS minSellingPrice
+        b.id,
+        b.product_no AS productNo,
+        b.item_name AS itemName,
+        b.product_image AS productImage,
+        tc.category_name AS topCategoryName,
+        mc.category_name AS mediumCategoryName,
+        bc.category_name AS bottomCategoryName,
+        b.product_status AS productStatus,
+        b.home_recommended AS homeRecommended,
+        b.category_recommendation AS categoryRecommendation,
+        b.cart_recommendation AS cartRecommendation,
+        b.is_popular AS isPopular,
+        b.recommended_product_order AS recommendedProductOrder,
+        p.market_price AS marketPrice,
+        p.min_selling_price AS minSellingPrice
         FROM product_base b
         LEFT JOIN product_price_inventory p ON b.id = p.product_id AND p.del_flag = '0'
         LEFT JOIN product_category tc ON b.top_category_id = tc.id AND tc.del_flag = '0'
@@ -138,27 +139,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <!-- 商品运营列表查询(联表查询) -->
     <select id="selectProductOperationPage" resultType="org.dromara.product.domain.vo.ProductOperationVo">
         SELECT
-            b.id,
-            b.product_no AS productNo,
-            b.item_name AS itemName,
-            b.product_image AS productImage,
-            b.brand_id AS brandId,
-            br.brand_name AS brandName,
-            b.top_category_id AS topCategoryId,
-            tc.category_name AS topCategoryName,
-            b.medium_category_id AS mediumCategoryId,
-            mc.category_name AS mediumCategoryName,
-            b.bottom_category_id AS bottomCategoryId,
-            bc.category_name AS bottomCategoryName,
-            u.unit_name AS unitName,
-            p.min_order_quantity AS minOrderQuantity,
-            p.market_price AS marketPrice,
-            p.member_price AS memberPrice,
-            p.min_selling_price AS minSellingPrice,
-            p.total_inventory AS totalInventory,
-            p.now_inventory AS nowInventory,
-            p.virtual_inventory AS virtualInventory,
-            b.product_status AS productStatus
+        b.id,
+        b.product_no AS productNo,
+        b.item_name AS itemName,
+        b.product_image AS productImage,
+        b.brand_id AS brandId,
+        br.brand_name AS brandName,
+        b.top_category_id AS topCategoryId,
+        tc.category_name AS topCategoryName,
+        b.medium_category_id AS mediumCategoryId,
+        mc.category_name AS mediumCategoryName,
+        b.bottom_category_id AS bottomCategoryId,
+        bc.category_name AS bottomCategoryName,
+        u.unit_name AS unitName,
+        p.min_order_quantity AS minOrderQuantity,
+        p.market_price AS marketPrice,
+        p.member_price AS memberPrice,
+        p.min_selling_price AS minSellingPrice,
+        p.total_inventory AS totalInventory,
+        p.now_inventory AS nowInventory,
+        p.virtual_inventory AS virtualInventory,
+        b.product_status AS productStatus
         FROM product_base b
         LEFT JOIN product_price_inventory p ON b.id = p.product_id AND p.del_flag = '0'
         LEFT JOIN product_brand br ON b.brand_id = br.id AND br.del_flag = '0'
@@ -196,25 +197,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <!-- 商品简化列表查询(用于选择弹窗) -->
     <select id="selectSimplePage" resultType="org.dromara.product.domain.vo.ProductBaseSimpleVo">
         SELECT
-            b.id,
-            b.product_no AS productNo,
-            b.item_name AS itemName,
-            b.product_image AS productImage,
-            p.market_price AS marketPrice,
-            p.member_price AS memberPrice,
-            e.specifications_code AS specification,
-            b.top_category_id AS topCategoryId,
-            tc.category_name AS topCategoryName,
-            b.medium_category_id AS mediumCategoryId,
-            mc.category_name AS mediumCategoryName,
-            b.bottom_category_id AS bottomCategoryId,
-            bc.category_name AS bottomCategoryName,
-            b.home_recommended AS homeRecommended,
-            b.category_recommendation AS categoryRecommendation,
-            b.cart_recommendation AS cartRecommendation,
-            b.recommended_product_order AS recommendedProductOrder,
-            b.is_popular AS isPopular,
-            b.product_status AS productStatus
+        b.id,
+        b.product_no AS productNo,
+        b.item_name AS itemName,
+        b.product_image AS productImage,
+        p.market_price AS marketPrice,
+        p.member_price AS memberPrice,
+        e.specifications_code AS specification,
+        b.top_category_id AS topCategoryId,
+        tc.category_name AS topCategoryName,
+        b.medium_category_id AS mediumCategoryId,
+        mc.category_name AS mediumCategoryName,
+        b.bottom_category_id AS bottomCategoryId,
+        bc.category_name AS bottomCategoryName,
+        b.home_recommended AS homeRecommended,
+        b.category_recommendation AS categoryRecommendation,
+        b.cart_recommendation AS cartRecommendation,
+        b.recommended_product_order AS recommendedProductOrder,
+        b.is_popular AS isPopular,
+        b.product_status AS productStatus
         FROM product_base b
         LEFT JOIN product_price_inventory p ON b.id = p.product_id AND p.del_flag = '0'
         LEFT JOIN product_extend e ON b.id = e.product_id AND e.del_flag = '0'
@@ -245,94 +246,91 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ORDER BY b.create_time DESC
     </select>
     <select id="selectAllList" resultType="org.dromara.product.domain.vo.ProductBaseVo">
-        SELECT
-            b.id,
-            b.product_no AS productNo,
-            b.item_name AS itemName,
-            b.brand_id AS brandId,
-            br.brand_name AS brandName,
-            b.top_category_id AS topCategoryId,
-            tc.category_name AS topCategoryName,
-            b.medium_category_id AS mediumCategoryId,
-            mc.category_name AS mediumCategoryName,
-            b.bottom_category_id AS bottomCategoryId,
-            bc.category_name AS bottomCategoryName,
-            bc.category_name AS categoryName,
-            b.unit_id AS unitId,
-            u.unit_name AS unitName,
-            b.product_image AS productImage,
-            b.is_self AS isSelf,
-            b.product_review_status AS productReviewStatus,
-            b.home_recommended AS homeRecommended,
-            b.category_recommendation AS categoryRecommendation,
-            b.cart_recommendation AS cartRecommendation,
-            b.recommended_product_order AS recommendedProductOrder,
-            b.is_popular AS isPopular,
-            b.is_new AS isNew,
-            b.product_status AS productStatus,
-            b.data_source AS dataSource,
-            b.remark,
-            b.is_customize AS isCustomize,
-            -- 扩展表字段
-            e.invoice_name AS invoiceName,
-            e.invoice_specs AS invoiceSpec,
-            e.bar_coding AS upcBarcode,
-            e.product_weight AS weight,
-            e.weight_unit AS weightUnit,
-            e.product_volume AS volume,
-            e.volume_unit AS volumeUnit,
-            e.after_sales_service AS afterSalesService,
-            e.service_guarantee AS serviceGuarantee,
-            e.is_install_service AS freeInstallation,
-            e.reference_link AS referenceLink,
-            e.sales_volume AS salesVolume,
-            e.is_customize AS customizable,
-            e.custom_description AS customDescription,
-            e.review_comments AS reviewComments,
-            -- 价格库存表字段
-            p.market_price AS marketPrice,
-            p.member_price AS memberPrice,
-            p.min_selling_price AS minSellingPrice,
-            p.purchasing_price AS purchasingPrice,
-            p.market_price AS midRangePrice,
-            p.member_price AS standardPrice,
-            p.min_selling_price AS certificatePrice,
-            p.purchasing_price AS purchasePrice,
-            p.max_purchase_price AS estimatedPurchasePrice,
-            p.tax_rate AS taxRate,
-            p.currency,
-            p.min_order_quantity AS minOrderQuantity,
-            p.total_inventory AS totalInventory,
-            p.now_inventory AS nowInventory,
-            p.virtual_inventory AS virtualInventory,
-            -- 属性分类表字段
-            c.attributes_list AS attributesList
+        SELECT b.id,
+               b.product_no                AS productNo,
+               b.item_name                 AS itemName,
+               b.brand_id                  AS brandId,
+               br.brand_name               AS brandName,
+               b.top_category_id           AS topCategoryId,
+               tc.category_name            AS topCategoryName,
+               b.medium_category_id        AS mediumCategoryId,
+               mc.category_name            AS mediumCategoryName,
+               b.bottom_category_id        AS bottomCategoryId,
+               bc.category_name            AS bottomCategoryName,
+               bc.category_name            AS categoryName,
+               b.unit_id                   AS unitId,
+               u.unit_name                 AS unitName,
+               b.product_image             AS productImage,
+               b.is_self                   AS isSelf,
+               b.product_review_status     AS productReviewStatus,
+               b.home_recommended          AS homeRecommended,
+               b.category_recommendation   AS categoryRecommendation,
+               b.cart_recommendation       AS cartRecommendation,
+               b.recommended_product_order AS recommendedProductOrder,
+               b.is_popular                AS isPopular,
+               b.is_new                    AS isNew,
+               b.product_status            AS productStatus,
+               b.data_source               AS dataSource,
+               b.remark,
+
+               -- 扩展表字段
+               e.invoice_name              AS invoiceName,
+               e.invoice_specs             AS invoiceSpec,
+               e.bar_coding                AS upcBarcode,
+               e.product_weight            AS weight,
+               e.weight_unit               AS weightUnit,
+               e.product_volume            AS volume,
+               e.volume_unit               AS volumeUnit,
+               e.after_sales_service       AS afterSalesService,
+               e.service_guarantee         AS serviceGuarantee,
+               e.is_install_service        AS freeInstallation,
+               e.reference_link            AS referenceLink,
+               e.sales_volume              AS salesVolume,
+               e.is_customize              AS customizable,
+               e.custom_description        AS customDescription,
+               e.review_comments           AS reviewComments,
+               -- 价格库存表字段
+               p.market_price              AS marketPrice,
+               p.member_price              AS memberPrice,
+               p.min_selling_price         AS minSellingPrice,
+               p.purchasing_price          AS purchasingPrice,
+               p.market_price              AS midRangePrice,
+               p.member_price              AS standardPrice,
+               p.min_selling_price         AS certificatePrice,
+               p.purchasing_price          AS purchasePrice,
+               p.max_purchase_price        AS estimatedPurchasePrice,
+               p.tax_rate                  AS taxRate,
+               p.currency,
+               p.min_order_quantity        AS minOrderQuantity,
+               p.total_inventory           AS totalInventory,
+               p.now_inventory             AS nowInventory,
+               p.virtual_inventory         AS virtualInventory,
+               -- 属性分类表字段
+               c.attributes_list           AS attributesList
         FROM product_base b
-        LEFT JOIN product_extend e ON b.id = e.product_id AND e.del_flag = '0'
-        LEFT JOIN product_price_inventory p ON b.id = p.product_id AND p.del_flag = '0'
-        LEFT JOIN product_classification c ON b.id = c.product_id AND c.del_flag = '0'
-        LEFT JOIN product_brand br ON b.brand_id = br.id AND br.del_flag = '0'
-        LEFT JOIN product_category tc ON b.top_category_id = tc.id AND tc.del_flag = '0'
-        LEFT JOIN product_category mc ON b.medium_category_id = mc.id AND mc.del_flag = '0'
-        LEFT JOIN product_category bc ON b.bottom_category_id = bc.id AND bc.del_flag = '0'
-        LEFT JOIN product_unit u ON b.unit_id = u.id AND u.del_flag = '0'
-        ${ew.customSqlSegment}
-                b.is_customize AS isCustomize,</select>
+                 LEFT JOIN product_extend e ON b.id = e.product_id AND e.del_flag = '0'
+                 LEFT JOIN product_price_inventory p ON b.id = p.product_id AND p.del_flag = '0'
+                 LEFT JOIN product_classification c ON b.id = c.product_id AND c.del_flag = '0'
+                 LEFT JOIN product_brand br ON b.brand_id = br.id AND br.del_flag = '0'
+                 LEFT JOIN product_category tc ON b.top_category_id = tc.id AND tc.del_flag = '0'
+                 LEFT JOIN product_category mc ON b.medium_category_id = mc.id AND mc.del_flag = '0'
+                 LEFT JOIN product_category bc ON b.bottom_category_id = bc.id AND bc.del_flag = '0'
+                 LEFT JOIN product_unit u ON b.unit_id = u.id AND u.del_flag = '0' ${ew.customSqlSegment}
+    </select>
 
     <!-- 查询商品状态统计信息(优化版) -->
     <select id="selectProductStatusCount" resultType="org.dromara.product.domain.vo.StatusCountVo">
-        SELECT
-            COUNT(*) AS total,
-            SUM(CASE WHEN product_status = '1' THEN 1 ELSE 0 END) AS onSale,
-            SUM(CASE WHEN product_review_status IN ('0', '3') THEN 1 ELSE 0 END) AS waitAudit,
-            SUM(CASE WHEN product_review_status = '1' THEN 1 ELSE 0 END) AS auditPass,
-            SUM(CASE WHEN product_review_status = '2' THEN 1 ELSE 0 END) AS auditReject
+        SELECT COUNT(*)                                                             AS total,
+               SUM(CASE WHEN product_status = '1' THEN 1 ELSE 0 END)                AS onSale,
+               SUM(CASE WHEN product_review_status IN ('0', '3') THEN 1 ELSE 0 END) AS waitAudit,
+               SUM(CASE WHEN product_review_status = '1' THEN 1 ELSE 0 END)         AS auditPass,
+               SUM(CASE WHEN product_review_status = '2' THEN 1 ELSE 0 END)         AS auditReject
         FROM product_base
         WHERE del_flag = '0'
     </select>
     <select id="selectBrandIdsByCategory" resultType="java.lang.Long">
         SELECT
-            product.brand_id
+        product.brand_id
         FROM product_base product
         INNER JOIN product_category category ON product.top_category_id = category.id
         <where>
@@ -340,7 +338,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND category.id = #{categoryId}
             </if>
             <if test="categoryName != null and categoryName !=''">
-                AND  category.category_Name LIKE CONCAT('%', #{categoryName}, '%')
+                AND category.category_Name LIKE CONCAT('%', #{categoryName}, '%')
             </if>
         </where>