package com.xinelu.manage.mapper.shortmessagesendrecord;

import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
import com.xinelu.manage.dto.billinfo.BillInfoDto;
import com.xinelu.manage.dto.statistics.FollowUpRateDto;
import com.xinelu.manage.vo.shortmessagesendrecord.ShortMessageSendRecordVo;
import com.xinelu.manage.vo.statistics.MessageSendVo;
import com.xinelu.manage.vo.statistics.PushCount;
import com.xinelu.manage.vo.subscribemessagesendrecord.RecordNum;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 短信发送结果记录Mapper接口
 *
 * @author xinelu
 * @date 2024-07-30
 */
public interface ShortMessageSendRecordMapper {
    /**
     * 查询短信发送结果记录
     *
     * @param id 短信发送结果记录主键
     * @return 短信发送结果记录
     */
    ShortMessageSendRecord selectShortMessageSendRecordById(Long id);

    /**
     * 查询短信发送结果记录列表
     *
     * @param shortMessageSendRecord 短信发送结果记录
     * @return 短信发送结果记录集合
     */
    List<ShortMessageSendRecord> selectShortMessageSendRecordList(ShortMessageSendRecord shortMessageSendRecord);

    /**
     * 查询短信发送结果记录列表
     *
     * @param shortMessageSendRecord 短信发送结果记录
     * @return 短信发送结果记录集合
     */
    List<ShortMessageSendRecordVo> selectShortMessageSendRecords(ShortMessageSendRecordVo shortMessageSendRecord);

    /**
     * 新增短信发送结果记录
     *
     * @param shortMessageSendRecord 短信发送结果记录
     * @return 结果
     */
    int insertShortMessageSendRecord(ShortMessageSendRecord shortMessageSendRecord);

    /**
     * 修改短信发送结果记录
     *
     * @param shortMessageSendRecord 短信发送结果记录
     * @return 结果
     */
    int updateShortMessageSendRecord(ShortMessageSendRecord shortMessageSendRecord);

    /**
     * 删除短信发送结果记录
     *
     * @param id 短信发送结果记录主键
     * @return 结果
     */
    int deleteShortMessageSendRecordById(Long id);

    /**
     * 批量删除短信发送结果记录
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteShortMessageSendRecordByIds(Long[] ids);

    /**
     * 节点推送数量
     *
     * @param manageRouteNodeIds 节点id
     * @return RecordNum
     */
    List<RecordNum> selectShortMessageRecordCountByManageRouteNodeIds(@Param("manageRouteNodeIds") List<Long> manageRouteNodeIds);

	List<MessageSendVo> getStatisticNum(FollowUpRateDto queryDto);

    /**
     * 根据账单id查询短信推送记录
     *
     * @param billId 账单id
     * @return BillInfoDto
     */
    List<BillInfoDto> selectShortMessageRecordByBillId(Long billId);

    /**
     * 批量新增短信发送结果记录
     *
     * @param shortMessageSendRecords 短信发送结果记录
     * @return 结果
     */
    int insertShortMessageSendRecords(List<ShortMessageSendRecord> shortMessageSendRecords);

    /**
     * 短信推送统计
     */
    PushCount messageCount();

    /**
     * 根据时间查询发送成功的账单
     *
     * @param startMonth 开始时间
     * @param endMonth   结束时间
     * @return PhoneDialRecord
     */
    List<ShortMessageSendRecord> selectRecordBySendTime(@Param("startMonth") LocalDateTime startMonth, @Param("endMonth") LocalDateTime endMonth);

    /**
     * 根据ids修改账单id
     *
     * @param ids
     * @param billId
     * @return int
     */
    int updateShortMessageSendRecordByIds(@Param("ids") List<Long> ids , @Param("billId") Long billId);

    /**
     * 根据任务明细id查询短信推送记录
     *
     * @param nodeId 任务明细id
     * @return int
     */
    int selectSendRecordCountByNodeId(Long nodeId);
}