package ${basePackage}.pojo.vos.${lowerTableName};

import com.cm.common.annotation.CheckEmptyAnnotation;
import com.cm.common.annotation.CheckNumberAnnotation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 *
 * @ClassName: ${firstUpperTableName}VO
 * @Description: ${tableExplain}
 * @Author: ${author}
 * @Date: ${date}
 * @Version: ${version}
 **/
@ApiModel
public class ${firstUpperTableName}VO {

    <#list fieldList! as field>
    @ApiModelProperty(name = "${field.fieldName}", value = "${field.fieldExplain}")
        <#if field.fieldType == "join">
    @CheckEmptyAnnotation(name = "${field.fieldExplain}")
    private String ${field.fieldName};
        <#elseif field.fieldType == "number">
    @CheckNumberAnnotation(name = "${field.fieldExplain}")
    private Integer ${field.fieldName};
        <#elseif field.fieldType == "double">
    @CheckNumberAnnotation(name = "${field.fieldExplain}")
    private Double ${field.fieldName};
        <#elseif field.fieldType == "date">
    @CheckEmptyAnnotation(name = "${field.fieldExplain}", verifyType = "date")
    private String ${field.fieldName};
        <#elseif field.fieldType == "datetime">
    @CheckEmptyAnnotation(name = "${field.fieldExplain}", verifyType = "datetime")
    private String ${field.fieldName};
        <#else>
            <#if field.fieldType == "string">
                <#if field.verifyType?? && field.verifyType != "none">
                    <#if field.verifyType == "phone">
    @CheckEmptyAnnotation(name = "${field.fieldExplain}", verifyType = "phone")
                    <#elseif field.verifyType == "email">
    @CheckEmptyAnnotation(name = "${field.fieldExplain}", verifyType = "email")
                    <#elseif field.verifyType == "url">
    @CheckEmptyAnnotation(name = "${field.fieldExplain}", verifyType = "url")
                    <#elseif field.verifyType == "number">
    @CheckEmptyAnnotation(name = "${field.fieldExplain}", verifyType = "number")
                    <#elseif field.verifyType == "date">
    @CheckEmptyAnnotation(name = "${field.fieldExplain}", verifyType = "date")
                    <#elseif field.verifyType == "identity">
    @CheckEmptyAnnotation(name = "${field.fieldExplain}", verifyType = "identity")
                    <#elseif field.verifyType == "custom">
    @CheckEmptyAnnotation(name = "${field.fieldExplain}", verifyType = "custom", regex = "${field.verifyType}")
                    <#elseif field.verifyType == "required">
    @CheckEmptyAnnotation(name = "${field.fieldExplain}")
                    </#if>
                </#if>
            </#if>
    private String ${field.fieldName};
        </#if>
    </#list>

    <#list fieldList! as field>
        <#if field.fieldType == "join">
    public String get${field.firstUpperFieldName}() {
        return ${field.fieldName} == null ? "" : ${field.fieldName}.trim();
    }

    public void set${field.firstUpperFieldName}(String ${field.fieldName}) {
        this.${field.fieldName} = ${field.fieldName};
    }

        <#elseif field.fieldType == "number">
    public Integer get${field.firstUpperFieldName}() {
        return ${field.fieldName} == null ? 0 : ${field.fieldName};
    }

    public void set${field.firstUpperFieldName}(Integer ${field.fieldName}) {
        this.${field.fieldName} = ${field.fieldName};
    }

        <#elseif field.fieldType == "double">
    public Double get${field.firstUpperFieldName}() {
        return ${field.fieldName} == null ? 0D : ${field.fieldName};
    }

    public void set${field.firstUpperFieldName}(Double ${field.fieldName}) {
        this.${field.fieldName} = ${field.fieldName};
    }

        <#elseif field.fieldType == "date" || field.fieldType == "datetime">
    public String get${field.firstUpperFieldName}() {
        return ${field.fieldName} == null ? "" : ${field.fieldName}.trim();
    }

    public void set${field.firstUpperFieldName}(String ${field.fieldName}) {
        this.${field.fieldName} = ${field.fieldName};
    }

        <#else>
    public String get${field.firstUpperFieldName}() {
        return ${field.fieldName} == null ? "" : ${field.fieldName}.trim();
    }

    public void set${field.firstUpperFieldName}(String ${field.fieldName}) {
        this.${field.fieldName} = ${field.fieldName};
    }

        </#if>
    </#list>

}
