package com.crm.manager.dao.mapper;

import com.crm.rely.backend.core.entity.user.info.UserInfoEntity;
import com.crm.rely.backend.core.entity.user.info.UserInfoEntrySearchEntity;
import com.crm.rely.backend.core.entity.user.info.UserInfoListEntity;
import com.crm.rely.backend.core.entity.user.info.UserInfoSearchEntity;
import com.crm.rely.backend.core.pojo.table.UserInfoTable;
import com.crm.rely.backend.core.pojo.view.UserInfoIbNoView;
import com.crm.rely.backend.core.pojo.view.UserInfoView;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by max on 2020/6/17.
 */
@Repository
public interface UserInfoDao {

    String getStampById(Long id);

    List<String> getStampListByIds(List<Long> ids);

    Integer searchByPageCount(UserInfoSearchEntity entity);

    List<UserInfoView> searchByPageList(UserInfoSearchEntity entity);

    UserInfoView getOne(Long id);

    List<UserInfoTable> findAllByRoleCode(@Param("roleCode") String roleCode, @Param("pId") Long pId);

    List<UserInfoTable> getAllByLeader();
    UserInfoTable getSuperAdminInfo();

    List<UserInfoTable> findAllByStamp(String stamp);

    String getMaxStampByPid(Long pid);

    void updateUserStampByBatch(List<UserInfoTable> tables);

    String findStampById(Long id);

    List<UserInfoTable> findAllAndSelfByStamp(String stamp);

    void updateShareByStamp(@Param("share") Float share, @Param("stamp") String stamp);

    UserInfoTable findFirstByIbNo(String ibNo);

    Integer existsByAreaId(Long areaId);

    List<UserInfoTable> findAllSalesAndSelfByStamp(String stamp);

    void batchUpdateIdStamp(List<UserInfoTable> tables);

    List<UserInfoTable> findAllByIbNoIn(List<String> ibNos);

    void updateUserBalanceById(UserInfoTable table);

    UserInfoTable getDataById(Long id);

    List<UserInfoTable> getDataByRoleId(Long roleId);

    UserInfoTable getDataByEmail(String email);

    Integer getEntryUserCount(UserInfoEntrySearchEntity entity);

    List<UserInfoView> getEntryUserList(UserInfoEntrySearchEntity entity);

    List<UserInfoView> getUserList(UserInfoListEntity entity);

    List<String> findAddIbByIbNoIn(List<String> addIbNo);
}
