package ${basePackage}.${moduleName}.req;

import ${basePackage}.frame.base.BaseUpdateRequest;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotEmpty;
<#if table.has('Date')>
import java.util.Date;
</#if>
<#list table.fields as field>
<#if field.fieldType.javaType() == "Enum">
import ${basePackage}.${moduleName}.enums.${field.getCName()};
</#if>
</#list>

/**
 * ${table.getCName()}UpdateRequest - ${table.tableComment}更新
 *
 * @author ${author?default("")}
 * @version 0.0.1
 * @since ${date?string("yyyy-MM-dd")}
 */
public class  ${table.getCName()}UpdateRequest extends BaseUpdateRequest {

<#list table.fields as field>
<#if !field.isSystem || field.fieldName == 'ID'>
    /**
     * ${field.fieldComment?default("")}
     */
<#if field.fieldType.javaType() == "String">
<#if field.fieldType != 'String_super'>
    @Length(min = 0, max = ${field.fieldLength}, message = "${field.fieldComment?default("")}长度不合法(0-${field.fieldLength})")
</#if>
<#if field.isMust>
    @NotEmpty(message = "${field.fieldComment?default("")}不能为空")
</#if>
<#else>
<#if field.isMust>
    @NotNull(message = "${field.fieldComment?default("")}不能为NULL")
</#if>
</#if>
<#if field.fieldType.javaType() == "Enum">
    private ${field.getCName()} ${field.getFName()};
<#else >
    private ${field.fieldType.javaType()} ${field.getFName()};
</#if>

</#if>
</#list>
<#list table.fields as field>
<#if !field.isSystem || field.fieldName == 'ID'>
<#if field.fieldType.javaType() == "Enum">

    public ${field.getCName()} ${field.getterName()}() {
        return this.${field.getFName()};
    }

    public void ${field.setterName()}(${field.getCName()} ${field.getFName()}) {
        this.${field.getFName()} = ${field.getFName()};
    }
<#else>

    public ${field.fieldType.javaType()} ${field.getterName()}() {
        return this.${field.getFName()};
    }

    public void ${field.setterName()}(${field.fieldType.javaType()} ${field.getFName()}) {
        this.${field.getFName()} = ${field.getFName()};
    }
</#if>
</#if>
</#list>
}
