嗨森逛服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hai-server/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperEx...

38 lines
1.4 KiB

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(b.total_price) is not null then sum(b.total_price) ELSE 0 end " +
" from high_child_order a, high_order b" +
" where goods_type = 3 " +
" and a.order_id = b.id" +
" and goods_id in (SELECT id from high_merchant_store where merchant_id = #{merId}) " +
" and b.order_status in (2,3,6,7)"})
BigDecimal countMerGasOilAmount(@Param("merId") Long merId);
@Select({
" SELECT ms.id, ms.store_name, ms.address," +
" (select " +
" case when sum(b.total_price) is not null then sum(b.total_price) else 0 end" +
" from high_child_order a, high_order b" +
" where a.order_id = b.id" +
" and goods_type = 3" +
" and goods_id = ms.id" +
" and b.order_status in (2,3,6,7)) countPrice" +
" from high_merchant_store ms where ms.merchant_id = #{merId}" +
" ORDER BY countPrice desc"
})
List<Map<String, Object>> selectStoreGasOilAmountByMer(@Param("merId") Long merId);
}