package com.cyksj.model.views;

import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.SearchBean;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/*
 *项目名: netflix
 *文件名: ArticleFrontView
 *创建者: JavaZou
 *创建时间:2023/6/27 13:59
 */
@Getter
@Setter
@SearchBean(tables = "article a left join article_user_mark aum2 on aum2.article_id = a.id :user_id:",
		where = "a.status is true and a.deleted is true",
		groupBy = "a.id,a.author,a.head_img_url,a.tv_type,a.box_type,a.route_type,a.name,a.banner,a.img,a.update_time,a.dz_num,a.col_num")
public class ArticleFrontView {
	@DbField("a.id")
	private Long id;

	@DbField("a.name")
	private String name;

	@DbField("a.banner")
	private String banner;

	@DbField("a.author")
	private String author;

	@DbField("a.head_img_url")
	private String headImgUrl;

	@DbField("a.img")
	private String img;

	@DbField("a.update_time")
	private Date releaseTime;

	@DbField("a.tv_type")
	@JsonIgnore
	private Integer tvType;

	@DbField("a.box_type")
	@JsonIgnore
	private Integer boxType;

	@DbField("a.route_type")
	@JsonIgnore
	private Integer routeType;

	@DbField("a.dz_num")
	private Integer dzNum;

	@DbField("a.col_num")
	private Integer colNum;

	@DbField("if(count(if(aum2.id is not null and aum2.is_dz is true,1,NULL))>0, true,false)")
	private Boolean isDz = false;

	@DbField("if(count(if(aum2.id is not null and aum2.is_col is true,1,NULL))>0,true,false)")
	private Boolean isCol = false;
}
