template.singlehtml.include.table.ftl Maven / Gradle / Ivy
[#ftl]
[#macro drawtable table]
表格${table.qualifiedName?lower_case}
- 表格说明
[#t/]
表名 [#t/]
主键 [#t/]
注释 [#t/]
[#t/]
${table.qualifiedName?lower_case} [#t/]
[#if table.primaryKey??][#list table.primaryKey.columns as c]${c.value?lower_case}[#if c_has_next],[/#if][/#list][/#if] [#t/]
${table.comment!} [#t/]
- 表格中的列
[#t/]
序号 [#t/]
字段名 [#t/]
字段类型 [#t/]
是否可空 [#t/]
描述 [#t/]
引用表 [#t/]
[#list table.columns as col]
[#t/]
${col_index+1} [#t/]
${col.name.value?lower_case} [#t/]
${col.sqlType.name?lower_case} [#t/]
${col.nullable?string("是","否")} [#t/]
${col.comment!} [#t/]
[#assign finded=false][#t/]
[#list table.foreignKeys as fk]
[#if !finded]
[#list fk.columns as fcol]
[#if fcol.value==col.name]
[#assign fkt=fk.referencedTable/]
${fk.referencedTable.qualifiedName?lower_case}[#assign finded=true][#break/]
[/#if]
[/#list]
[/#if]
[/#list]
[#t/]
[/#list]
[#if table.uniqueKeys?size>0]
- 表格中唯一约束
序号 [#t/]
约束名 [#t/]
约束字段 [#t/]
[#list table.uniqueKeys as uk]
[#t/]
${uk_index+1} [#t/]
${uk.name.value?lower_case} [#t/]
[#list uk.columns as c]${c.value?lower_case}[#if c_has_next],[/#if][/#list] [#t/]
[/#list]
[/#if]
[#if table.indexes?size>0]
- 表格的索引
索引名 [#t/]
索引字段 [#t/]
是否唯一 [#t/]
[#list table.indexes as idx]
[#t/]
${idx.name.value?lower_case} [#t/]
[#list idx.columns as c]${c.value?lower_case}[#if c_has_next],[/#if][/#list] [#t/]
${idx.unique?string("是","否")} [#t/]
[/#list]
[/#if]
[/#macro]
© 2015 - 2024 Weber Informatics LLC | Privacy Policy