diff --git a/generator-web/src/main/resources/templates/code-generator/mybatis/mybatis.ftl b/generator-web/src/main/resources/templates/code-generator/mybatis/mybatis.ftl index 3406a1c..5031716 100644 --- a/generator-web/src/main/resources/templates/code-generator/mybatis/mybatis.ftl +++ b/generator-web/src/main/resources/templates/code-generator/mybatis/mybatis.ftl @@ -1,89 +1,89 @@ - - - - - - <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> - <#list classInfo.fieldList as fieldItem > - - - - - - - <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> - <#list classInfo.fieldList as fieldItem > - ${fieldItem.columnName}<#if fieldItem_has_next>, - - - - - - INSERT INTO ${classInfo.tableName} - - <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> - <#list classInfo.fieldList as fieldItem > - <#if fieldItem.columnName != "id" > - - ${fieldItem.columnName}<#if fieldItem_has_next>, - ${r""} - - - - - - <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> - <#list classInfo.fieldList as fieldItem > - <#if fieldItem.columnName != "id" > - <#--<#if fieldItem.columnName="addtime" || fieldItem.columnName="updatetime" > - ${r""} - NOW()<#if fieldItem_has_next>, - ${r""} - <#else>--> - - ${r"#{"}${fieldItem.fieldName}${r"}"}<#if fieldItem_has_next>, - ${r""} - <#----> - - - - - - - - DELETE FROM ${classInfo.tableName} - WHERE id = ${r"#{id}"} - - - - UPDATE ${classInfo.tableName} - - <#list classInfo.fieldList as fieldItem > - <#if fieldItem.columnName != "id" && fieldItem.columnName != "AddTime" && fieldItem.columnName != "UpdateTime" > - ${fieldItem.columnName} = ${r"#{"}${fieldItem.fieldName}${r"}"}<#if fieldItem_has_next>,${r""} - - - - WHERE id = ${r"#{"}id${r"}"} - - - - - - - - - + + + + + + <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> + <#list classInfo.fieldList as fieldItem > + + + + + + + <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> + <#list classInfo.fieldList as fieldItem > + ${fieldItem.columnName}<#if fieldItem_has_next>, + + + + + + INSERT INTO ${classInfo.tableName} + + <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> + <#list classInfo.fieldList as fieldItem > + <#if fieldItem.columnName != "id" > + + ${fieldItem.columnName}<#if fieldItem_has_next>, + ${r""} + + + + + + <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0> + <#list classInfo.fieldList as fieldItem > + <#if fieldItem.columnName != "id" > + <#--<#if fieldItem.columnName="addtime" || fieldItem.columnName="updatetime" > + ${r""} + NOW()<#if fieldItem_has_next>, + ${r""} + <#else>--> + + ${r"#{"}${fieldItem.fieldName}${r"}"}<#if fieldItem_has_next>, + ${r""} + <#----> + + + + + + + + DELETE FROM ${classInfo.tableName} + WHERE id = ${r"#{id}"} + + + + UPDATE ${classInfo.tableName} + + <#list classInfo.fieldList as fieldItem > + <#if fieldItem.columnName != "id" && fieldItem.columnName != "AddTime" && fieldItem.columnName != "UpdateTime" > + ${fieldItem.columnName} = ${r"#{"}${fieldItem.fieldName}${r"}"}<#if fieldItem_has_next>,${r""} + + + + WHERE id = ${r"#{"}id${r"}"} + + + + + + + + + \ No newline at end of file