package com.hai.dao; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.math.BigDecimal; import java.util.List; import java.util.Map; /** * mapper扩展类 */ public interface HighMerchantAccountMapperExt { @Select({"select " + "case when sum(total_price) is not null then sum(total_price) ELSE 0 end " + "from high_child_order " + "where goods_type = 3 " + "and goods_id in (SELECT id from high_merchant_store where merchant_id = #{merId})" + "and child_orde_status in (2,3)"}) BigDecimal countMerGasOilAmount(@Param("merId") Long merId); @Select({ " SELECT a.id, a.store_name, a.address," + " (select " + " case when sum(total_price) is not null then sum(total_price) else 0 end " + " from high_child_order " + " where goods_type = 3 " + " and goods_id = a.id" + " and child_orde_status in (2,3)) countPrice" + " from high_merchant_store a where a.merchant_id = #{merId}" + " ORDER BY countPrice desc" }) List> selectStoreGasOilAmountByMer(@Param("merId") Long merId); }