package com.cyksj.model.views;

import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/*
 *项目名: netflix
 *文件名: CorpMsgBulkTaskSendRecordView
 *创建者: JavaZou
 *创建时间:2023/6/21 11:42
 */
@Getter
@Setter
@SearchBean(tables = "(select * from corp_msg_bulk_task_record where :send_id:) cmr left join corp_user_send_record cr on cr.corp_msg_record_id = cmr.id" +
		" left join corp_follow cf on cf.userid = cmr.follow_id and cf.wx_corp_id = cmr.corp_id",
		groupBy = "cmr.msgid")
public class CorpMsgBulkTaskCorpFollowSendRecordView {

	@DbField("cmr.msgid")
	private String msgid;

	/**
	 * 总数
	 */
	@DbField("count(cr.id)")
	private Integer total;

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

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

	/**
	 * true已发送 一个未发
	 */
	@DbField("any_value(cmr.status)")
	private Boolean status;

	/**
	 * 客服
	 */
	@DbField("any_value(cf.name)")
	private String followName;

	@DbField("any_value(cmr.created_time)")
	private Date createTime;

}
