package com.gic.haoban.manage.service.dao.mapper;

import com.gic.haoban.manage.api.dto.OpenStaffListDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.qdto.OpenStaffPageQDTO;
import com.gic.haoban.manage.service.entity.TabOpenStaff;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OpenStaffMapper {

    /**
     * 根据主键删除
     */
    int deleteByPrimaryKey(@Param("id") Long id);

    /**
     * 插入一条记录
     */
    int insert(TabOpenStaff record);

    int update(TabOpenStaff tab) ;

    TabOpenStaff getByStaffId(@Param("staffId")String staffId) ;

    TabOpenStaff getByUUID(@Param("uuid") String uuid) ;

    void updateValidFlag(@Param("uuid")String uuid);

    TabOpenStaff getById(Long openStaffId);

    void update2QrcodeFlag(@Param("id") Long openStaffId);

    void update2Qrcode(@Param("id") Long id , @Param("qrCode")String qrcode , @Param("key")String key) ;

    void updateLoginStep(@Param("id")Long openStaffId, @Param("step")int step);

    List<OpenStaffListDTO> list(OpenStaffPageQDTO qdto);

    TabOpenStaff getByQwUserId(@Param("qwUserId")Long qwUserId);

    List<String> listAllStaffId(String wxEnterpriseId);

    List<StaffClerkRelationDTO> listOpenStaffByClerk(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId, @Param("list")List<String> clerkIdList);

    List<StaffClerkRelationDTO> listOpenStaffByStore(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId, @Param("list")List<String> storeIdList);

    List<TabOpenStaff> listAllOnline(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId) ;

    List<String> listOpenStoreId(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId);

    void updateStopTime(@Param("id") Long openStaffId, @Param("type") int type, @Param("time") int time);

    int getNum(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId , @Param("status")int status) ;

    int updateByAutoLogin(@Param("id") Long openStaffId ,@Param("uuid") String uuid) ;

    List<TabOpenStaff> listAllOnlineEnterprise() ;

}