package ${packageName}.pojo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
#foreach ($import in $importList)
import ${import};
#end
import lombok.Data;
import cn.gov.customs.wxjy.common.annotation.Excel;
#if($table.crud || $table.sub)
import cn.gov.customs.wxjy.common.core.domain.BaseEntity;
#elseif($table.tree)
import cn.gov.customs.wxjy.common.core.domain.TreeEntity;
#end

/**
 * ${functionName}对象 ${tableName}
 *
 * @author ${author}
 * @date ${datetime}
 */
#if($table.crud || $table.sub)
    #set($Entity="BaseEntity")
#elseif($table.tree)
    #set($Entity="TreeEntity")
#end
@Data
public class ${ClassName} extends ${Entity} {
private static final long serialVersionUID = 1L;

#foreach ($column in $columns)
#if(!$table.isSuperColumn($column.javaField))
    /** $column.columnComment */
    #set($isCamelCase = false)
    #foreach ($c in $column.javaField.toCharArray())
        #if ($c.isUpperCase())
            #set($isCamelCase = true)
        #end
    #end
    #if (!$isCamelCase)
        #set($processedField = ${column.javaField.toLowerCase()})
    #end
    #if($column.list)
    #set($parentheseIndex=$column.columnComment.indexOf("（"))
    #if($parentheseIndex != -1)
        #set($comment=$column.columnComment.substring(0, $parentheseIndex))
    #else
        #set($comment=$column.columnComment)
    #end
    #if($parentheseIndex != -1)
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    #elseif($column.javaType == 'Date')
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
    #elseif($column.javaType == 'DateTime')
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    #elseif($column.javaType == 'Long')
    @JsonSerialize(using= ToStringSerializer.class)
    @Excel(name = "${comment}")
    #else
    @Excel(name = "${comment}")
    #end
##    #elseif($column.columnName == 'id')
    #elseif($column.columnName.length()>= 2 && $column.columnName.substring(0, 2).toUpperCase() == 'PK')
    @JsonSerialize(using= ToStringSerializer.class)
    #end
    private $column.javaType $column.javaField;

    #end
#end
#if($table.sub)
    /** $table.subTable.functionName信息 */
    private List<${subClassName}> ${subclassName}List;

#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;
##            }
##    #end
###end
##
###if($table.sub)
##public List<${subClassName}> get${subClassName}List()
##        {
##        return ${subclassName}List;
##        }
##
##public void set${subClassName}List(List<${subClassName}> ${subclassName}List)
##        {
##        this.${subclassName}List = ${subclassName}List;
##        }
##
###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
##    #if($table.sub)
##            .append("${subclassName}List", get${subClassName}List())
##    #end
##        .toString();
##    }
}
