package com.ylcm.sys.form;

import java.io.Serializable;

import org.apache.commons.lang.StringUtils;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 栏目管理表
 * </p>
 *
 * @author admin
 * @since 2020-07-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ad_platform")
@ApiModel(value="AdPlatform对象", description="栏目管理表")
public class AdPlatformForm implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "栏目名称")
    @TableField("platform_name")
    private String platformName;

    @ApiModelProperty(value = "栏目Logo")
    @TableField("img_url")
    private String imgUrl;

    @ApiModelProperty(value = "内容")
    @TableField("brand_name")
    private String brandName;
    
    @ApiModelProperty(value = "一级行业")
    @TableField("first_ind")
    private String firstInd;

    @ApiModelProperty(value = "二级行业")
    @TableField("second_ind")
    private String secondInd;
    
	/**
	 * 判断内容前后是否一致
	 */
	public boolean isCanSyscUpBrandName(String oldBrandName) {
		if (StringUtils.isBlank(oldBrandName) && StringUtils.isBlank(brandName)) {
			return false;
		} else if (StringUtils.isBlank(oldBrandName) && StringUtils.isNotBlank(brandName)) {
			return true;
		} else if (StringUtils.isNotBlank(oldBrandName) && StringUtils.isBlank(brandName)) {
			return true;
		} else if (!oldBrandName.equals(brandName)) {
			return true;
		}
		return false;
	}
}
