cloudroam
2024-12-30 e88e7ccc9b9d310fb2dbc002f03e601fb9a6bdb1
src/main/resources/mapper/statisticsAnalysis/SalesStatisticsAnalysisMapper.xml
@@ -31,6 +31,7 @@
        o.id orderId,
        o.order_no,
        o.payment_time,
        c.parent_name flowerCategoryName,
        CONCAT(o.customer_province, ' ', o.customer_city, ' ', o.customer_region, ' ', o.customer_address) AS address,
        COALESCE((SELECT oic.num FROM t_order_item_check oic WHERE oic.order_item_id = oi.id AND oic.type = 'replace'),
        0) replaceNum,
@@ -44,6 +45,7 @@
        LEFT JOIN t_supplier_info si ON si.id = oi.supplier_id
        LEFT JOIN t_order o ON oi.order_id = o.id
        LEFT JOIN t_flower f on oi.flower_id = f.id
        LEFT JOIN t_flower_category c on c.id = f.category
        <include refid="flowerSaleWhere"></include>
    </sql>
@@ -60,11 +62,16 @@
        <if test="dto.registerTel!=null and dto.registerTel!=''">
            AND si.contact_tel LIKE CONCAT('%',#{dto.registerTel}, '%')
        </if>
        <if test="dto.contactTel!=null and dto.contactTel!=''">
            AND si.contact_tel LIKE CONCAT('%',#{dto.contactTel}, '%')
        </if>
        <if test="dto.stationId != null">
            AND oi.station_id = #{dto.stationId}
        </if>
        <if test="dto.flowerCategory != null">
            AND f.category = #{dto.flowerCategory}
            AND ( f.category = #{dto.flowerCategory} or f.category in (
            select id from t_flower_category where parent_id = #{dto.flowerCategory}
            ))
        </if>
        <if test="dto.flowerLevel != null and dto.flowerLevel != ''">
            AND oi.flower_level = #{dto.flowerLevel}
@@ -88,6 +95,9 @@
        <if test="dto.createEndDate != null">
            AND o.payment_time &lt; #{dto.createEndDate}
        </if>
        <if test="dto.orderField !=null and dto.orderField !=''">
            order by ${dto.orderField} ${dto.orderType}
        </if>
</sql>