package com.xhpc.card.mapper;

import com.xhpc.card.pojo.TIccardDevice;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TIccardDeviceMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(TIccardDevice record);

    int insertSelective(TIccardDevice record);

    TIccardDevice selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TIccardDevice record);

    int updateByPrimaryKey(TIccardDevice record);

    /**
     * 查询所有记录
     *
     * @return 返回一个装着所有记录的集合
     * @author WH
     * @date 2022/1/25 17:07
     * @since version-1.0
     */
    List<TIccardDevice> selectAll();

    /**
     * 更新卡授权设备为删除状态
     *
     * @param deviceId the id of card grant device
     * @author WH
     * @date 2022/1/26 10:48
     * @since version-1.0
     */
    void updateCardDeviceStatusIsDel(Integer deviceId);

    void deleteIccardDeviceId(Integer deviceId);
    /**
     * query specified card grant device delete status
     *
     * @param deviceId specified card grant device id
     * @return specified card grant device record
     * @author WH
     * @date 2022/1/26 11:03
     * @since version-1.0
     */
    TIccardDevice selectDeletedStatusByDeviceId(Integer deviceId);

    /**
     * 分页查询所有记录
     *
     * @param currentPage 当前页数
     * @param items       每页的条数
     * @return 返回一个装着所有记录的集合
     * @author WH
     * @date 2022/1/25 17:07
     * @since version-1.0
     */
    List<TIccardDevice> selectAllByPage(@Param("currentPage") Long currentPage, @Param("items") Long items);

}