Files
smartDriveEE/src/main/java/com/rj/mapper/LbOrderRowMapper.java
2026-06-19 21:13:56 +08:00

45 lines
2.0 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.rj.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rj.dto.LbBuyerTradeStats;
import com.rj.entity.LbOrderRow;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@Mapper
public interface LbOrderRowMapper extends BaseMapper<LbOrderRow> {
/**
* 按订单 id主键插入或更新跳过租户行拦截避免 listByIds 因 tenant_id 过滤漏判导致重复插入。
*/
@InterceptorIgnore(tenantLine = "true")
int upsertBatch(@Param("list") List<LbOrderRow> list);
/**
* 按租户与买家汇总:每位买家取 pay_time 最新(相同时取 id 最大)的已支付订单。
*/
List<LbBuyerTradeStats> selectLatestPaidStatsByTenantId(@Param("tenantId") String tenantId,
@Param("dataType") String dataType);
/**
* 按租户、买家ID列表和时间范围查询订单总金额。
*/
BigDecimal selectSumTotalMoneyByBuyerIdsAndTimeRange(@Param("tenantId") String tenantId,
@Param("buyerIds") List<String> buyerIds,
@Param("buyStartTime") String buyStartTime,
@Param("buyEndTime") String buyEndTime);
/**
* 按租户、买家ID列表和时间范围分组查询每个买家的订单总金额。
*/
List<Map<String, Object>> selectSumTotalMoneyGroupByBuyerIds(@Param("tenantId") String tenantId,
@Param("buyerIds") List<String> buyerIds,
@Param("buyStartTime") String buyStartTime,
@Param("buyEndTime") String buyEndTime);
}