101 lines
2.6 KiB
Plaintext
101 lines
2.6 KiB
Plaintext
package ${cfg.paramPackage};
|
|||
|
|
|
||
|
|
<#--<#list table.importPackages as pkg>-->
|
||
|
|
<#--import ${pkg};-->
|
||
|
|
<#--</#list>-->
|
||
|
|
<#if swagger2>
|
||
|
|
import io.swagger.annotations.ApiModel;
|
||
|
|
import io.swagger.annotations.ApiModelProperty;
|
||
|
|
</#if>
|
||
|
|
<#if entityLombokModel>
|
||
|
|
import lombok.Data;
|
||
|
|
</#if>
|
||
|
|
<#if cfg.superQueryParamsClass??>
|
||
|
|
import ${cfg.superQueryParamsClass};
|
||
|
|
import lombok.EqualsAndHashCode;
|
||
|
|
import lombok.ToString;
|
||
|
|
</#if>
|
||
|
|
|
||
|
|
/**
|
||
|
|
* ${table.comment!}
|
||
|
|
* @author ${author}
|
||
|
|
* @date ${date}
|
||
|
|
*/
|
||
|
|
<#if entityLombokModel>
|
||
|
|
@Data
|
||
|
|
<#if cfg.superQueryParamsClass??>
|
||
|
|
@EqualsAndHashCode(callSuper = true)
|
||
|
|
@ToString(callSuper = true)
|
||
|
|
</#if>
|
||
|
|
</#if>
|
||
|
|
<#if swagger2>
|
||
|
|
@ApiModel(value = "${entity}查询对象", description = "${table.comment!}")
|
||
|
|
</#if>
|
||
|
|
<#if cfg.superQueryParamsClass??>
|
||
|
|
public class ${entity}${cfg.queryParamsSuffix} extends ${cfg.superQueryParamsName} {
|
||
|
|
<#else>
|
||
|
|
public class ${entity}${cfg.queryParamsSuffix} implements Serializable {
|
||
|
|
</#if>
|
||
|
|
<#-- ---------- BEGIN 字段循环遍历 ---------->
|
||
|
|
<#list table.fields as field>
|
||
|
|
<#--逻辑删除字段不生成-->
|
||
|
|
<#if (logicDeleteFieldName!"") != field.name>
|
||
|
|
|
||
|
|
<#if field.keyFlag>
|
||
|
|
<#assign keyPropertyName="${field.propertyName}"/>
|
||
|
|
</#if>
|
||
|
|
<#if field.comment!?length gt 0>
|
||
|
|
<#if swagger2>
|
||
|
|
@ApiModelProperty(value = "${field.comment}")
|
||
|
|
<#else>
|
||
|
|
/**
|
||
|
|
* ${field.comment}
|
||
|
|
*/
|
||
|
|
</#if>
|
||
|
|
</#if>
|
||
|
|
private ${field.propertyType} ${field.propertyName};
|
||
|
|
</#if>
|
||
|
|
</#list>
|
||
|
|
<#------------ END 字段循环遍历 ---------->
|
||
|
|
<#if !entityLombokModel>
|
||
|
|
|
||
|
|
<#list table.fields as field>
|
||
|
|
<#if field.propertyType == "boolean">
|
||
|
|
<#assign getprefix="is"/>
|
||
|
|
<#else>
|
||
|
|
<#assign getprefix="get"/>
|
||
|
|
</#if>
|
||
|
|
public ${field.propertyType} ${getprefix}${field.capitalName}() {
|
||
|
|
return ${field.propertyName};
|
||
|
|
}
|
||
|
|
|
||
|
|
<#if entityBuilderModel>
|
||
|
|
public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
|
||
|
|
<#else>
|
||
|
|
public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
|
||
|
|
</#if>
|
||
|
|
this.${field.propertyName} = ${field.propertyName};
|
||
|
|
<#if entityBuilderModel>
|
||
|
|
return this;
|
||
|
|
</#if>
|
||
|
|
}
|
||
|
|
</#list>
|
||
|
|
</#if>
|
||
|
|
<#if !entityLombokModel>
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public String toString() {
|
||
|
|
return "${entity}{" +
|
||
|
|
<#list table.fields as field>
|
||
|
|
<#if field_index==0>
|
||
|
|
"${field.propertyName}=" + ${field.propertyName} +
|
||
|
|
<#else>
|
||
|
|
", ${field.propertyName}=" + ${field.propertyName} +
|
||
|
|
</#if>
|
||
|
|
</#list>
|
||
|
|
"}";
|
||
|
|
}
|
||
|
|
</#if>
|
||
|
|
|
||
|
|
}
|