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

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.gic.haoban.manage.api.dto.chat.ChatOwnerTotalDTO;
import com.gic.haoban.manage.api.dto.chat.GroupChatPlanOwnerLogDTO;
import com.gic.haoban.manage.api.dto.qdto.chat.GroupChatPlanSearchQDTO;
import com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanOwnerLog;

/**
 * 
 * @ClassName: TabHaobanGroupChatPlanOwnerLogMapper
 * @Description: TODO
 * @Author 徐高华
 * @Date 2022年11月25日 15:29:51
 * @Modify
 * @CopyRight 
 */
public interface GroupChatPlanOwnerLogMapper {

    public int batchInsert(List<TabGroupChatPlanOwnerLog> entity);

    public int update(TabGroupChatPlanOwnerLog entity);

    public void deleteByStaffIds(@Param("planId") Long planId, @Param("staffIdList") List<String> staffIdList);

    public TabGroupChatPlanOwnerLog selectById(Long ownerLogId);

    /**
     * 放弃
     * @param id
     */
    void giveUp(@Param("id")Long id) ;

    public void updateSendCount(@Param("id") Long id, @Param("sendCount") int sendCount,
            @Param("failCount") int failCount, @Param("sendTime") Date sendTime);

    public List<GroupChatPlanOwnerLogDTO> listPage(GroupChatPlanSearchQDTO qdto);

    public List<Long> listForTimer(@Param("planId") Long planId);

    public List<TabGroupChatPlanOwnerLog> listForDoPlan(@Param("planId") Long planId, @Param("startItem") int startItem,
            @Param("pageSize") int pageSize);

    public List<ChatOwnerTotalDTO> listOwnerLogPageForWxaTotal(GroupChatPlanSearchQDTO qdto);

    public List<GroupChatPlanOwnerLogDTO> listOwnerLogPageForWxa(GroupChatPlanSearchQDTO qdto);

    public GroupChatPlanOwnerLogDTO getOwnerInfo(@Param("planId")Long planId, @Param("staffId")String staffId, @Param("clerkId")String clerkId, @Param("wxEnterpriseId")String wxEnterpriseId);

    /**
     * 查询社群群发待发送总数
     * @param enterpriseId gic企业id
     * @param clerkId 导购id
     * @param storeId 门店id
     * @return
     */
    Integer getTotalCount(@Param("enterpriseId")String enterpriseId,@Param("clerkId")String clerkId,@Param("storeId")String storeId);

    void updateExecType(@Param("planId")Long planId , @Param("execType")int execType) ;

    List<GroupChatPlanOwnerLogDTO> listForMsgid() ;

    List<GroupChatPlanOwnerLogDTO> listForCancelSend() ;

    void updateMsgid(@Param("id")Long id , @Param("msgid")String msgid) ;

    void staffSendResult(@Param("staffId")String staffId, @Param("planId")Long planId, @Param("sendTime")Date sendTime, @Param("failRemark")String failRemark ,  @Param("statusFlag")int statusFlag);

    int getTotalTask(@Param("enterpriseId")String enterpriseId , @Param("clerkId")String clerkId , @Param("time")Date time ) ;

    int getInvalidTask(@Param("enterpriseId")String enterpriseId , @Param("clerkId")String clerkId , @Param("time")Date time ) ;

    int getTaskNum(@Param("enterpriseId")String enterpriseId, @Param("clerkId")String clerkId, @Param("storeId")String storeId, @Param("staffId")String staffId);
}