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

import ${basePackage}.frame.base.BaseUpdateRequest;
import javax.validation.constraints.NotBlank;
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>
<#if table.has('Dict')>
import ${basePackage}.frame.validation.Dict;
</#if>

/**
 * ${table.getCName()}UpdateRequest - ${table.tableComment}更新
 *
 * @author ${author?default("")}
 * @version 0.0.1
 * @since ${.now?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.isMust && !field.fieldType?contains("String")>
    @NotNull(message = "[${field.getFName()}]${field.fieldComment?default("")}不能为NULL")
    </#if>
    <#if field.isMust && field.fieldType?contains("String_")>
    @NotBlank(message = "[${field.getFName()}]${field.fieldComment?default("")}不能为空")
    </#if>
    <#if field.fieldType?contains("String_") && field.fieldType != 'String_super'>
    @Length(min = 0, max = ${field.fieldLength}, message = "[${field.getFName()}]${field.fieldComment?default("")}长度不合法(0-${field.fieldLength})")
    </#if>
    <#if field.fieldType?contains("Dict")>
    @Dict(name = "${field.getFieldName()}")
    </#if>
    private ${field.getFieldTypeJava()} ${field.getFName()};
</#if>
</#list>
<#list table.fields as field>
<#if !field.isSystem || field.fieldName == 'ID'>

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

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