xuhy
2024-09-19 f34453a6e807103e36e412ecef66b39e9ef1f233
ruoyi-system/src/main/resources/mapper/system/TOrderMealGoodsMapper.xml
@@ -33,17 +33,19 @@
        </where>
    </select>
    <select id="salesRanking" resultType="com.ruoyi.system.vo.SalesRankingVO">
        SELECT typeName,SUM(goodsSalePrice*goodsCount) AS salesVolume
        from t_order_meal_goods
        SELECT tomg.typeName,SUM(tomg.goodsSalePrice*goodsCount) AS salesVolume
        from t_order_meal_goods tomg
        left join t_order_meal tom on tomg.orderId=tom.id
        <where>
            <if test="ids != null and ids.size()>0">
                AND orderId IN
                AND tomg.orderId IN
                <foreach collection="ids" item="id" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
            AND tom.isCover = 1
        </where>
        GROUP BY typeName
        GROUP BY tomg.typeName
    </select>
</mapper>