package com.xhpc.card.mapper;

import com.xhpc.card.domain.SearchCardUserQueryCondition;
import com.xhpc.card.pojo.XhpcCustomersPersonnel;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface XhpcCustomersPersonnelMapper {

    int deleteByPrimaryKey(Long customersPersonnelId);

    int insert(XhpcCustomersPersonnel record);

    int insertSelective(XhpcCustomersPersonnel record);

    XhpcCustomersPersonnel selectByPrimaryKey(Long customersPersonnelId);

    int updateByPrimaryKeySelective(XhpcCustomersPersonnel record);

    int updateByPrimaryKey(XhpcCustomersPersonnel record);

    /**
     * 查询所有记录
     *
     * @author WH
     * @date 2022/1/28 15:42
     * @since version-1.0
     */
    List<XhpcCustomersPersonnel> selectAll();

    /**
     * 根据条件查询所有记录
     *
     * @author WH
     * @date 2022/2/8 14:39
     * @since version-1.0
     */
    List<XhpcCustomersPersonnel> selectByCondition(@Param("queryCondition") SearchCardUserQueryCondition queryCondition, @Param("userIdList") List<Integer> userIdList);

    /**
     * 根据条件查询所有记录个数
     *
     * @author WH
     * @date 2022/2/8 14:43
     * @since version-1.0
     */
    Long selectCount(@Param("queryCondition") SearchCardUserQueryCondition queryCondition, @Param("userIdList") List<Integer> userIdList);

    /**
     * 根据运营商id、分页条件、查询对应的记录
     *
     * @param operatorId  运营商id
     * @param currentPage 当前页码
     * @param items       当前要显示的条数
     * @return 对应的记录
     */
    List<XhpcCustomersPersonnel> selectByOperatorId(@Param("operatorId") Long operatorId, @Param("currentPage") Long currentPage, @Param("items") Long items, @Param("userIdList") List<Integer> userIdList);

    /**
     * 根据运营商id，查询符合条件的总条数
     *
     * @param operatorId
     * @return
     */
    Long selectCountByOperatorId(@Param("operatorId") Long operatorId, @Param("userIdList") List<Integer> userIdList);

    /**
     * query record by user account
     *
     * @param userAccount
     * @return
     */
    XhpcCustomersPersonnel selectByAccount(String userAccount);

}