package com.cyksj.mapper.manage.distribute;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cyksj.model.entity.DistributeMoneyApply;
import com.cyksj.model.entity.User;
import com.cyksj.model.entity.UserDistribute;
import com.cyksj.model.views.CpsOrderDataStatisticsView;
import com.cyksj.model.views.UserDistributeViews;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/*
 *项目名: netflix
 *文件名: UserDistributeMapper
 *创建者: JavaZou
 *创建时间:2022/11/14 12:18
 */
public interface UserDistributeMapper extends BaseMapper<UserDistribute> {
	Integer count(Long userId);

	Integer countUserNum(Long userId);

	BigDecimal getHasPayOrdersBySharedId(@Param("userId") Long userId, @Param("noOrderStatus") List<String> noOrderStatus, @Param("startTime") String startTime, @Param("endTime") String endTime);

	BigDecimal countHasPayBySharedId(@Param("userId") Long userId, @Param("noOrderStatus") List<String> noOrderStatus, @Param("startTime") String startTime, @Param("endTime") String endTime);

	String selectSoldMaxGoods(Long userId);

	UserDistributeViews getApplyDetailByUserId(Long userId);

	User getUserDistributeDetail(@Param("loginPhone") String loginPhone, @Param("email") String email);

	Integer getDistributeGoodsRateByUidAndGid(@Param("userId") Long userId, @Param("goodsId") Long goodsId);

	DistributeMoneyApply selectRelationBusiness(Long userId);

	CpsOrderDataStatisticsView selectOrderBrokenLineMoney(@Param("cpsUserId") long cpsUserId, @Param("first") String first, @Param("end") String end);
}
