package com.sqx.modules.app.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqx.modules.app.entity.UserEntity;
import com.sqx.modules.artificer.vo.UserArtificerVO;
import com.sqx.modules.material.entity.Material;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 用户
 */
@Mapper
public interface UserDao extends BaseMapper<UserEntity> {


    IPage<UserEntity> selectUserPage(Page<UserEntity> page, String search, Integer sex, String platform,
                                     Integer isAuthentication, String sysPhone, Integer status,
                                     String userName,String invitationCode,String inviterCode,
                                     Integer member,Integer ordersCount,Integer isAgency,Integer isShop,String artificerName);

    int queryInviterCount(@Param("inviterCode") String inviterCode);

    int queryUserCount(@Param("type") int type, @Param("date") String date,@Param("isAuthentication") Integer isAuthentication,@Param("phone") Integer phone);

    Double queryPayMoney(@Param("type") int type, @Param("date") String date);

    IPage<Map<String, Object>> queryCourseOrder(Page iPage, @Param("type") int type, @Param("date") String date);

    int userMessage(String date, int type);

    int insertUser(UserEntity userEntity);

    IPage<Map<String, Object>> takingOrdersMessage(Page<Map<String, Object>> iPage, @Param("type") Long type, @Param("date") String date);

    int updateUserClientIdIsNull(String clientid);

    int updateUserConsortiaIdIsNull(Long userId);

    int updateUserClientIdIsNullByClientId(Long consortiaId);

    int userPlatform(String platform,String date,Integer type);

    IPage<Map<String,Object>> selectAgencyOrdersMoneyList(Page<Map<String,Object>> page,String userName,String phone,String startTime,String endTime);


    List<UserArtificerVO> getArtificerInfo();

    IPage<UserEntity> merchantPromotion(IPage<UserEntity> pages,@Param("userEntity")UserEntity userEntity);
}
