package com.ylcm.sys.form;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ylcm.sys.domain.AdProduct;
import com.ylcm.sys.domain.AdTheatre;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang.StringUtils;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.ZoneOffset;

/**
 * 剧场数据管理
 * @author liuyu
 */
@Data
public class AdTheatreForm extends Page implements Serializable {
    private static final long serialVersionUID = -5118367123254849225L;

    @ApiModelProperty(value = "电视剧名")
    private String name;
    @ApiModelProperty(value = "类型：0产品 1栏目")
    private Integer type;
    @ApiModelProperty(value = "产品/栏目名称")
    private String typeName;
	@ApiModelProperty(value = "体裁")
    private String firstTheme;
	@ApiModelProperty(value = "细分体裁")
    private String secondTheme;
    @ApiModelProperty(value = "媒体等级")
    private Integer mediaRank;
	@ApiModelProperty(value = "播出媒体")
    private String mediaName;
	@ApiModelProperty(value = "集数min")
    private Integer mediaNumMin;
	@ApiModelProperty(value = "集数max")
    private Integer mediaNumMax;
	@ApiModelProperty(value = "播出日期min")
    private String showDateStart;
	@ApiModelProperty(value = "播出日期max")
    private String showDateEnd;
	@ApiModelProperty(value = "播出时间min")
    private String showTimeStart;
	@ApiModelProperty(value = "播出时间max")
    private String showTimeEnd;
	@ApiModelProperty(value = "进线预估min")
    private Integer jinxianMin;
	@ApiModelProperty(value = "进线预估max")
    private Integer jinxianMax;

    public LambdaQueryWrapper<AdTheatre> toAdTheatreQueryWrapper(){
		LambdaQueryWrapper<AdTheatre> queryWrapper = new LambdaQueryWrapper<>();
		if (StringUtils.isNotBlank(name)){
            queryWrapper.eq(AdTheatre::getName, name.trim());
		}
        queryWrapper.orderByDesc(AdTheatre::getId);
		return queryWrapper;
    }

    public void trim(){
        if (StringUtils.isNotBlank(name)){
            name = name.trim();
        }
        if (StringUtils.isNotBlank(typeName)){
            typeName = typeName.trim();
        }
    }
}
