package com.chaozhanggui.dao.system.dao;

import com.chaozhanggui.dao.system.entity.TbPlussUserPromotion;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

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

@Component
@Mapper
public interface TbPlussUserPromotionMapper {
    int deleteByPrimaryKey(Integer userId);

    int insert(TbPlussUserPromotion record);

    int insertSelective(TbPlussUserPromotion record);

    TbPlussUserPromotion selectByPrimaryKey(Integer userId);

    int updateByPrimaryKeySelective(TbPlussUserPromotion record);

    int updateByPrimaryKey(TbPlussUserPromotion record);

    List<Map<String,Object>> selectByUserIdOrAgecyCode(@Param("userId") String userId,@Param("userType") String userType,@Param("agencyCode") String agencyCode,@Param("isExtend") String isExtend);



    List<Map<String,Object>> selectOrderByUserIdOrAgecyCode(@Param("userId") String userId,@Param("userType") String userType,@Param("agencyCode") String agencyCode,@Param("isExtend") String isExtend, @Param("merchantCode") String merchantCode,
                                                            @Param("status") String status, @Param("merchantType") String merchantType,@Param("reqUserId") String reqUserId,@Param("phone")String phone);

    Map<String,Object> selectByUserId(String userId);

    Integer selectCountByUserId(String userId);


    BigDecimal selectMaxFeeByUserId(String userId);

    TbPlussUserPromotion selectByParentUserId(String userId);

    TbPlussUserPromotion selectUserProByUserId(String userId);

    Map<String,Integer> selectCount(String userId);

    List<Map<String,Object>> selectMarkByUserId(@Param("userId") String userId,@Param("phone") String phone,@Param("name") String name);


    List<Map<String,Object>> selectDeviceStok(@Param("userId") String userId,@Param("merchantCode") String merchantCode);


    TbPlussUserPromotion selectUserPromotionByUserId(@Param("userId") String userId,@Param("orderUserId") String orderUserId);

    Map<String,BigDecimal> selectPromotionByUserId(String userId);

    List<Map<String,Object>> selectOrdersByUserId(@Param("userId") String userId, @Param("orderNumber") String orderNumber);

    Map<String,Object> selectCountNumByUserId(String userId);
}