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 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 UserDao extends BaseMapper<UserEntity> {


    IPage<UserEntity> selectUserPage(@Param("page") Page<UserEntity> page, @Param("userEntity") UserEntity userEntity);

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

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

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

    List<UserEntity> selectRiderUserByOnLineFlag(String distance, String lng, String lat);

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

    int userMessage(String date, int type);


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


    IPage<UserEntity> selectUserList(Page<UserEntity> iPage, String userName);


    int updateCashDeposit(@Param("userId") Long userId,@Param("cashDeposit") Double cashDeposit);

    void updateMoney(Integer type, Long userId, Double money);



    int deleteCertification(Long userId);


    List<UserEntity> getNearByRider(Double range, Double lng, Double lat);

    int updateRateByCity(@Param("city") String city, @Param("riderRate") BigDecimal riderRate);

    Integer selectUserCount(Integer flag,String time,Integer userType,Integer phone);

    IPage<Map<String, Object>> selectInviterList(Page<Map<String, Object>> page,@Param("userId") Long userId);
}
