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

import com.gic.haoban.manage.api.dto.moment.QwMomentPlanAttendDTO;
import com.gic.haoban.manage.api.dto.moment.TaskDetailDTO;
import com.gic.haoban.manage.api.dto.moment.TaskListWxaDTO;
import com.gic.haoban.manage.api.qdto.moment.PlanClerkListQDTO;
import com.gic.haoban.manage.api.qdto.moment.TaskListWxaQDTO;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend;
import com.gic.haoban.manage.service.pojo.bo.moment.CountBO;
import org.apache.ibatis.annotations.Param;

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

public interface QwMomentPlanAttendMapper {

    TabQwMomentPlanAttend getById(Long attendId) ;

    void batchInsert(List<TabQwMomentPlanAttend> list) ;

    /**
     * 查询已经存在的导购
     * @param planId
     * @param clerkIdList
     * @return
     */
    List<String> listExistClerkIds(@Param("planId") Long planId , @Param("list") List<String> clerkIdList) ;

    List<QwMomentPlanAttendDTO> listClerk(@Param("planId")Long planId , @Param("statusFlag")Integer statusFlag);

    List<TabQwMomentPlanAttend> listForData(@Param("planId")Long planId);


    /**
     * 删除
     * @param planId
     * @param clerkIdList
     */
    void delClerks(@Param("planId") Long planId , @Param("list") List<String> clerkIdList) ;

    List<QwMomentPlanAttendDTO> list(PlanClerkListQDTO qdto);

    TaskDetailDTO taskDetail(@Param("planId") Long planId, @Param("clerkId") String execClerkId);

    List<TabQwMomentPlanAttend> getByStaff(@Param("planId") Long planId, @Param("staffId") String staffId);

    List<TaskListWxaDTO> taskListWxa(TaskListWxaQDTO qdto);

    void finishTask(@Param("attendId")Long attendId, @Param("sendTime")Date sendTime , @Param("staffId")  String staffId);

    void updateMomentId(@Param("id") Long id, @Param("momentId") String jobId);

    void updateFail(@Param("planId") Long planId, @Param("list") List<String> clerkIdList , @Param("reason") String reason) ;

    void updateSuccess(@Param("planId") Long planId, @Param("list") List<String> clerkIdList) ;

    void updateSuccessStaff(@Param("planId") Long planId, @Param("clerkId") String clerkId , @Param("staffId") String staffId) ;

    void updateQwData(@Param("planId") Long planId, @Param("clerkId") String clerkId, @Param("likeCount")int likeCount, @Param("commentCount")int commentCount);

    CountBO getQwCount(@Param("planId")Long planId);

    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 ) ;

}
