From b387240235caf541e7bb756e854dbc781c4af4bf Mon Sep 17 00:00:00 2001 From: thj <18883325829@163.com> Date: Fri, 1 Oct 2021 11:15:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E6=9C=9F=20:=202021?= =?UTF-8?q?-10-01=20=E8=83=8C=E6=99=AF=20:=20=E5=BD=93=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=20mybatis=E7=BB=84=E4=BB=B6=E7=94=9F=E6=88=90=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=97=B6,=E5=90=84=E4=B8=AA=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=B9=8B=E9=97=B4=E5=AF=B9=E4=BA=8E=E5=AE=9E=E4=BD=93=E7=B1=BB?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=90=8D=E7=A7=B0=E4=B8=8D=E4=B8=80=E8=87=B4?= =?UTF-8?q?,=E9=9C=80=E8=A6=81=E6=89=8B=E5=8A=A8=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81=20=E4=BF=AE=E6=94=B9=20:?= =?UTF-8?q?=20=20=20=20=201=20mybatis.ftl=20=E7=BB=9F=E4=B8=80=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20=E4=B8=8D=E5=B8=A6=20Entity=20=E7=9A=84=20=E5=AE=9E?= =?UTF-8?q?=E4=BD=93=E7=B1=BB,=E4=BF=9D=E8=AF=81=20mybatis=E6=89=80?= =?UTF-8?q?=E6=9C=89=E7=BB=84=E4=BB=B6=E5=8A=9F=E8=83=BD=E4=BF=9D=E6=8C=81?= =?UTF-8?q?=E4=B8=80=E8=87=B4,=E9=81=BF=E5=85=8D=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../code-generator/mybatis/mybatis.ftl | 176 +++++++++--------- 1 file changed, 88 insertions(+), 88 deletions(-) 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