1.统计报表-历史合伙人可查
2.小程序-花店:分类按照售罄放到最下面
3.小程序-合伙人:质检按照仓库排序
已修改3个文件
82 ■■■■ 文件已修改
src/main/resources/mapper/flower/FlowerMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/payment/DeliveryOrderMapper.xml 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/report/OrderReportMapper.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/flower/FlowerMapper.xml
@@ -198,7 +198,9 @@
                order by fzp.rank asc
            </when>
            <otherwise>
                order by f.price asc
                order by
                    CASE WHEN f.stock = 0 THEN 1  ELSE 0 END,
                f.price asc
            </otherwise>
        </choose>
    </select>
src/main/resources/mapper/payment/DeliveryOrderMapper.xml
@@ -164,6 +164,8 @@
        join t_order o on q.order_id = o.id
        join t_supplier_info s on s.id = q.supplier_id
        join t_station st on st.id = s.station_id
        left join t_warehouse w on o.warehouse_id=w.id
        left join t_warehouse_location wl on o.warehouse_location_id=wl.id
        WHERE q.deleted = 0 and o.deleted = 0
        and q.status in ('PENDING', 'ARRIVED', 'CHECKED')
        AND q.supplier_id = #{condition.supplierId}
@@ -205,37 +207,37 @@
        <if test="condition.endDate != null">
            AND o.payment_time &lt; #{condition.endDate}
        </if>
        order by w.seq,wl.seq asc
        <!-- ORDER BY q.arrive_time -->
     </select>
        ORDER BY q.arrive_time
    </select>
    <select id="statisticStationList" resultType="com.mzl.flower.dto.response.flower.StationStatisticDTO">
        SELECT
        s.station_id AS stationId,
        st.`name`,
        SUM( oi.num ) AS totalNum,
        SUM(CASE WHEN  o.`status` = 'CHECKED'  THEN oi.num ELSE 0 END) AS checkedSupplierCount,
        SUM(CASE WHEN  o.`status` = 'PENDING' or o.`status`= 'ARRIVED' THEN oi.num ELSE 0 END) AS uncheckedSupplierCount
        FROM t_delivery_order o
        LEFT JOIN t_delivery_order_item i ON o.id = i.delivery_id
        LEFT JOIN t_order_item oi ON oi.id = i.order_item_id
        LEFT JOIN t_supplier_info s ON s.id = o.supplier_id
        LEFT JOIN t_station st ON st.id = s.station_id
        LEFT JOIN t_order t ON t.id = i.order_id
        WHERE o.deleted = 0
        AND o.`status` IN ( 'PENDING', 'ARRIVED', 'CHECKED' )
        <if test="userId !=null and userId !=''">
            AND st.user_ids LIKE concat('%', #{userId},'%')
        </if>
        <if test="name !=null and name !=''">
            AND ( s.id LIKE concat('%', #{name},'%')  OR
            s.contact_tel LIKE concat('%', #{name},'%') OR
            s.`name` LIKE concat('%', #{name},'%') OR
            st.`name` LIKE concat('%', #{name},'%') OR
            t.warehouse_location_code LIKE concat('%', #{name},'%')
            )
        </if>
<!--        <if test="startDate != null">-->
     <select id="statisticStationList" resultType="com.mzl.flower.dto.response.flower.StationStatisticDTO">
         SELECT
         s.station_id AS stationId,
         st.`name`,
         SUM( oi.num ) AS totalNum,
         SUM(CASE WHEN  o.`status` = 'CHECKED'  THEN oi.num ELSE 0 END) AS checkedSupplierCount,
         SUM(CASE WHEN  o.`status` = 'PENDING' or o.`status`= 'ARRIVED' THEN oi.num ELSE 0 END) AS uncheckedSupplierCount
         FROM t_delivery_order o
         LEFT JOIN t_delivery_order_item i ON o.id = i.delivery_id
         LEFT JOIN t_order_item oi ON oi.id = i.order_item_id
         LEFT JOIN t_supplier_info s ON s.id = o.supplier_id
         LEFT JOIN t_station st ON st.id = s.station_id
         LEFT JOIN t_order t ON t.id = i.order_id
         WHERE o.deleted = 0
         AND o.`status` IN ( 'PENDING', 'ARRIVED', 'CHECKED' )
         <if test="userId !=null and userId !=''">
             AND st.user_ids LIKE concat('%', #{userId},'%')
         </if>
         <if test="name !=null and name !=''">
             AND ( s.id LIKE concat('%', #{name},'%')  OR
             s.contact_tel LIKE concat('%', #{name},'%') OR
             s.`name` LIKE concat('%', #{name},'%') OR
             st.`name` LIKE concat('%', #{name},'%') OR
             t.warehouse_location_code LIKE concat('%', #{name},'%')
             )
         </if>
 <!--        <if test="startDate != null">-->
<!--            AND o.create_time &gt; #{startDate}-->
<!--        </if>-->
<!--        <if test="endDate != null">-->
src/main/resources/mapper/report/OrderReportMapper.xml
@@ -47,9 +47,7 @@
            and o.payment_time &lt; #{dto.endDate}
        </if>
        <if test="dto.partnerId != null">
            and o.create_by in (
            select user_id from t_customer_info where partner_id=#{dto.partnerId}
            )
            and o.partner_id=#{dto.partnerId}
        </if>
        ) t
@@ -96,9 +94,7 @@
                    and o.payment_time &lt; #{dto.endDate}
                </if>
                <if test="dto.partnerId != null">
                    and o.create_by in (
                        select user_id from t_customer_info where partner_id=#{dto.partnerId}
                    )
                    and o.partner_id=#{dto.partnerId}
                </if>
        ) t
@@ -130,9 +126,7 @@
            and o.payment_time &lt; #{dto.endDate}
        </if>
        <if test="dto.partnerId != null">
            and o.create_by in (
            select user_id from t_customer_info where partner_id=#{dto.partnerId}
            )
            and o.partner_id=#{dto.partnerId}
        </if>
    </select>
@@ -159,9 +153,7 @@
            and o.payment_time &lt; #{dto.endDate}
        </if>
        <if test="dto.partnerId != null">
            and o.create_by in (
            select user_id from t_customer_info where partner_id=#{dto.partnerId}
            )
            and o.partner_id=#{dto.partnerId}
        </if>
    </select>