package com.cyksj.model.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/*
 *项目名: netflix
 *文件名: ExcelCorpMsgBulkTaskSendRecordData
 *创建者: JavaZou
 *创建时间:2023/8/3 16:10
 */
@Getter
@Setter
@SearchBean(tables = "(select * from corp_msg_bulk_task_record where :task_id: :time:) cmr left join corp_user_send_record cr on cr.corp_msg_record_id = cmr.id",
		groupBy = "cmr.send_id")
public class ExcelCorpMsgBulkTaskSendRecordData {
	/**
	 * 总数
	 */
	@DbField("count(cr.id)")
	@ExcelProperty("总数")
	private Integer total;

	/**
	 * 送达
	 */
	@DbField("count(if(cr.status = 1,cr.id,null))")
	@ExcelProperty("已发送")
	private Integer send;

	/**
	 * 未送达
	 */
	@DbField("count(if(cr.status != 1,cr.id,null))")
	@ExcelProperty("未发送")
	private Integer notSend;

	@DbField("any_value(cmr.created_time)")
	@ExcelProperty("发送时间")
	private Date createTime;
}
