<#list tableList as table>
-- ----------------------------
-- ${table.functionName}表
-- ----------------------------
DROP TABLE IF EXISTS `${table.tableName}`;
CREATE TABLE ${table.tableName}(
<#list table.columns as column>
    <#if column.isIncrement==1 >
        <#assign autoInc>AUTO_INCREMENT</#assign>
    <#else>
        <#assign autoInc></#assign>
    </#if>
    <#if column.isRequired==1 >
        <#assign Required>NOT NULL</#assign>
    <#else>
        <#assign Required></#assign>
    </#if>
    <#if column.isPrimaryKey==1 >
        <#assign Required>NOT NULL</#assign>
    </#if>
    <#if column.isRequired==1 >
        <#assign Required>NOT NULL</#assign>
    <#else>
        <#assign Required></#assign>
    </#if>
<#--    <#if column.javaType=="String" >
        <#assign Type>CHARACTER SET utf8 COLLATE utf8_general_ci</#assign>
    <#else>
        <#assign Type></#assign>
    </#if>-->
    <#if column.defaultValue??&& column.defaultValue!="">
        <#assign Default>DEFAULT '${column.defaultValue}'</#assign>
    <#else>
        <#assign Default></#assign>
    </#if>
    `${column.columnName}` ${column.columnType} ${Required}  ${autoInc} ${Default}  COMMENT '${column.columnComment}',
</#list>
PRIMARY KEY  (`${table.pkColumn.columnName}`)
    <#list table.columns as column>
        <#if column.isQuery==1 >
<#sep>,</#sep>KEY `${column.columnName}` (`${column.columnName}`) USING BTREE
        </#if>
    </#list>
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='${table.functionName}';
</#list>