package ${packageName}.domain;

#foreach ($import in $importList)
import ${import};
#end
import lombok.Data;
#set($Entity="BaseEntity")
#if($table.crud || $table.sub)
#set($Entity="BaseEntity")
import com.aidex.common.core.domain.BaseEntity;
#elseif($table.tree)
#set($Entity="BaseTreeEntity")
import com.aidex.common.core.domain.BaseTreeEntity;
#elseif($table.treegrid)
#set($Entity="BaseTreeEntity")
import com.aidex.common.core.domain.BaseTreeEntity;
#end
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
##是否有日志字段
#foreach($column in $columns)
#if($column.isLog == "1")
import com.aidex.common.utils.log.annotation.FieldRemark;
import com.aidex.common.utils.log.annotation.LogField;
#break;
#end
#end
import com.aidex.common.annotation.Excel;

/**
 * ${functionName}对象 ${tableName}
 * @author ${functionAuthor}
 * @email ${functionAuthorEmail}
 * @date ${datetime}
 */
@Data
public class ${ClassName} extends ${Entity}<${ClassName}>
{
    private static final long serialVersionUID = 1L;

#foreach ($column in $columns)
#if(!$table.isSuperColumn($column.javaField))
    /** $column.columnComment */
#set($parentheseIndex=$column.columnComment.indexOf("（"))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($column.javaType == 'Date')
    @JsonFormat(pattern = "yyyy-MM-dd")
#end
#if($column.list)
#if(${column.dictType} != '')
    @Excel(name = "${comment}", dictType = "${column.dictType}")
#elseif($column.javaType == 'Date')
    @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
#else
    @Excel(name = "${comment}")
#end
#end
#if($column.isRequired == "1")
#if($column.javaType == 'String' )
    @NotBlank(message = "$column.columnComment不允许为空")
#end
#end
#if($column.isLog == "1")
    @LogField
    @FieldRemark(name = "$comment",field = "$column.javaField")
#end
    private $column.javaType $column.javaField;

#if($column.javaType == 'Date')
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
#set($AttrName=$column.javaField)
#else
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#end
    /** $column.columnComment开始 */
    private String begin${AttrName};

    /** $column.columnComment结束 */
    private String end${AttrName};
	
#elseif($column.htmlType == "user" || $column.htmlType == "dept")
    private $column.javaType ${column.javaField}Name;
#end
#end
#end
#foreach ($column in $columns)
#if(!$table.isSuperColumn($column.javaField))
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
#set($AttrName=$column.javaField)
#else
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#end
    public void set${AttrName}($column.javaType $column.javaField) 
    {
        this.$column.javaField = $column.javaField;
    }

    public $column.javaType get${AttrName}() 
    {
        return $column.javaField;
    }
#if($column.htmlType == "user" || $column.htmlType == "dept")
    public void set${AttrName}Name($column.javaType ${column.javaField}Name)
            {
            this.${column.javaField}Name = ${column.javaField}Name;
            }

    public $column.javaType get${AttrName}Name()
            {
            return ${column.javaField}Name;
            }
#end
#if($foreach.hasNext)

#end
#end
#end

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
#foreach ($column in $columns)
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
#set($AttrName=$column.javaField)
#else
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#end
            .append("${column.javaField}", get${AttrName}())
#end
            .toString();
    }
}
