/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.dao;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.bean.model.User;
import com.yami.shop.bean.po.EnterpriseUserLogPo;
import com.yami.shop.bean.po.EnterpriseUserPo;
import com.yami.shop.bean.vo.EnterpriseUserVo;
import com.yami.shop.bean.vo.UserPointsVO;
import com.yami.shop.common.util.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper extends BaseMapper<User> {

	User getUserByBizUserId(@Param("appId")Integer appId, @Param("bizUserId")String bizUserId);

    void setUserLevelBylevelId(@Param("level")Integer level);

    List<User> selectMemberByEndTime(@Param("endOfDay") DateTime endOfDay);

    void setMaxUserLevelBylevelId(@Param("level")Integer level,@Param("minNeedGrowth")Integer minNeedGrowth, @Param("maxNeedGrowth")Integer maxNeedGrowth);

    void updateBatchById(@Param("userList") List<User> userList);

    IPage<User> getUserPage(PageParam<User> page, @Param("user") User user);

    IPage<UserPointsVO> statisticsList(PageParam<User> pageParam, @Param("user")User user);

    IPage<EnterpriseUserVo> enterpriseUserList(@Param("page") PageParam<EnterpriseUserPo> page, @Param("po") EnterpriseUserPo po);

    void addUserLog(@Param("operator") String operator, @Param("batchNo") String batchNo,@Param("status") String status,
                    @Param("channel") String channel,@Param("realName") String realName,@Param("phone") String phone,@Param("userAttrType") String userAttrType );

    IPage<EnterpriseUserLogPo> enterpriseUserLogList(@Param("page") PageParam<EnterpriseUserLogPo> page);

    IPage<User> userList(@Param("page") PageParam<User> page, @Param("user") User user);

    List<EnterpriseUserLogPo> enterpriseUserLogErrList(String batchNo);

    List<EnterpriseUserVo> exportList( @Param("po")EnterpriseUserPo po);

    Double test(String userId);
}
