Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
<Statement Id="IsExist">
Select Count(1) From @table.Name T
<Include RefId="QueryParams" />
</Statement>

</Statement>
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

<!--获取分页数据-->
<Statement Id="QueryByPage" @queryStatementResultMap>
Select
<Include RefId="AllCols"/>
Select
<Include RefId="AllCols" />
From @table.Name As T
<Include RefId="QueryParams" />
<Switch Prepend="Order By" Property="OrderBy">
<Default>
T.@pkCol.Name Desc
</Default>
</Switch>
Limit @(dbPrefix)PageSize Offset @(dbPrefix)Offset
Limit @(dbPrefix)PageSize Offset @(dbPrefix)Offset
</Statement>
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,12 @@
@Include("SqlMap-ResultMaps.cshtml", Model)
<Statements>
@Include("SqlMap-Columns.cshtml", Model)

<Statement Id="QueryParams">
<Where>
@foreach (var col in table.Columns)
{
<IsNotEmpty Prepend="And" Property="@col.ConvertedName">
T.@col.Name = @dbPrefix@col.ConvertedName
</IsNotEmpty>
}
</Where>
</Statement>
@Include("SqlMap-WhereQueryParams.cshtml", Model)
@Include("./CURD/SqlMap-Insert.cshtml", Model)
@Include("./CURD/SqlMap-Delete.cshtml", Model)
@Include("./CURD/SqlMap-Update.cshtml", Model)
@Include("./CURD/SqlMap-Query.cshtml", Model)

<!--获取分页数据-->
<Statement Id="QueryByPage" @(queryStatementResultMap)>
Select
<Include RefId="AllCols" />
From @table.Name As T
<Include RefId="QueryParams" />
<Switch Prepend="Order By" Property="OrderBy">
<Default>
T.@pkCol.Name Desc
</Default>
</Switch>
Limit @(dbPrefix)Offset,@(dbPrefix)PageSize
</Statement>
@Include("./CURD/SqlMap-QueryByPage.cshtml", Model)
@Include("./CURD/SqlMap-GetRecord.cshtml", Model)
@Include("./CURD/SqlMap-GetEntity.cshtml", Model)
@Include("./CURD/SqlMap-IsExist.cshtml", Model)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,7 @@
@Include("SqlMap-ResultMaps.cshtml", Model)
<Statements>
@Include("SqlMap-Columns.cshtml", Model)

<Statement Id="QueryParams">
<Where>
@foreach (var col in table.Columns)
{
<IsNotEmpty Prepend="And" Property="@col.ConvertedName">
T.@col.Name = @dbPrefix@col.ConvertedName
</IsNotEmpty>
}
</Where>
</Statement>
@Include("SqlMap-WhereQueryParams.cshtml", Model)
@Include("./CURD/SqlMap-Insert.cshtml", Model)
@Include("./CURD/SqlMap-Delete.cshtml", Model)
@Include("./CURD/SqlMap-Update.cshtml", Model)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,12 @@
@Include("SqlMap-ResultMaps.cshtml", Model)
<Statements>
@Include("SqlMap-Columns.cshtml", Model)

<Statement Id="QueryParams">
<Where>
@foreach (var col in table.Columns)
{
<IsNotEmpty Prepend="And" Property="@col.ConvertedName">
T.@col.Name = @dbPrefix@col.ConvertedName
</IsNotEmpty>
}
</Where>
</Statement>
@Include("SqlMap-WhereQueryParams.cshtml", Model)
@Include("./CURD/SqlMap-Insert.cshtml", Model)
@Include("./CURD/SqlMap-Delete.cshtml", Model)
@Include("./CURD/SqlMap-Update.cshtml", Model)
@Include("./CURD/SqlMap-Query.cshtml", Model)

<!--获取分页数据-->
<Statement Id="QueryByPage" @queryStatementResultMap>
Select
<Include RefId="AllCols" />
From @table.Name As T
<Include RefId="QueryParams" />
<Switch Prepend="Order By" Property="OrderBy">
<Default>
T.@pkCol.Name Desc
</Default>
</Switch>
Limit @(dbPrefix)PageSize Offset @(dbPrefix)Offset
</Statement>
@Include("./CURD/SqlMap-QueryByPage.cshtml", Model)
@Include("./CURD/SqlMap-GetRecord.cshtml", Model)
@Include("./CURD/SqlMap-GetEntity.cshtml", Model)
@Include("./CURD/SqlMap-IsExist.cshtml", Model)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,12 @@
@Include("SqlMap-ResultMaps.cshtml", Model)
<Statements>
@Include("SqlMap-Columns.cshtml", Model)

<Statement Id="QueryParams">
<Where>
@foreach (var col in table.Columns)
{
<IsNotEmpty Prepend="And" Property="@col.ConvertedName">
T.@col.Name = @dbPrefix@col.ConvertedName
</IsNotEmpty>
}
</Where>
</Statement>
@Include("SqlMap-WhereQueryParams.cshtml", Model)
@Include("./CURD/SqlMap-Insert.cshtml", Model)
@Include("./CURD/SqlMap-Delete.cshtml", Model)
@Include("./CURD/SqlMap-Update.cshtml", Model)
@Include("./CURD/SqlMap-Query.cshtml", Model)

<!--获取分页数据-->
<Statement Id="QueryByPage" @queryStatementResultMap>
Select
<Include RefId="AllCols" />
From @table.Name As T
<Include RefId="QueryParams" />
<Switch Prepend="Order By" Property="OrderBy">
<Default>
T.@pkCol.Name Desc
</Default>
</Switch>
Limit @(dbPrefix)PageSize Offset @(dbPrefix)Offset
</Statement>
@Include("./CURD/SqlMap-QueryByPage.cshtml", Model)
@Include("./CURD/SqlMap-GetRecord.cshtml", Model)
@Include("./CURD/SqlMap-GetEntity.cshtml", Model)
@Include("./CURD/SqlMap-IsExist.cshtml", Model)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,7 @@
@Include("SqlMap-ResultMaps.cshtml", Model)
<Statements>
@Include("SqlMap-Columns.cshtml", Model)

<Statement Id="QueryParams">
<Where>
@foreach (var col in table.Columns)
{
<IsNotEmpty Prepend="And" Property="@col.ConvertedName">
T.@col.Name = @dbPrefix@col.ConvertedName
</IsNotEmpty>
}
</Where>
</Statement>
@Include("SqlMap-WhereQueryParams.cshtml", Model)
@Include("./CURD/SqlMap-Insert.cshtml", Model)
@Include("./CURD/SqlMap-Delete.cshtml", Model)
@Include("./CURD/SqlMap-Update.cshtml", Model)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@using SmartCode
@using SmartCode.Db
@inherits SmartCode.TemplateEngine.Impl.RazorCoreTemplate<BuildContext>
@{
var dbSource = Model.GetDataSource<DbSource>();
var table = Model.GetCurrentTable();
var dbPrefix = dbSource.DbProvider.ParameterPrefix;
}

<Statement Id="QueryParams">
<Where>
@foreach (var col in table.Columns)
{
<IsNotEmpty Prepend="And" Property="@col.ConvertedName">
T.@col.Name = @dbPrefix@col.ConvertedName
</IsNotEmpty>
}
</Where>
</Statement>
11 changes: 7 additions & 4 deletions 11 src/SmartCode.Generator/RazorTemplates/ETL/ToMysqlTable.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
@using SmartCode
@using System
@using System.Collections.Generic
@using System.Linq
@using SmartCode
@using SmartCode.Db
@model BuildContext
@inherits SmartCode.TemplateEngine.Impl.RazorCoreTemplate<BuildContext>
@{
var project = Model.Project;
var dbSource = Model.GetDataSource<DbSource>();
Expand Down Expand Up @@ -63,7 +66,7 @@ DataSource:
AutoIncrement: @(PKColumn.AutoIncrement ? "true" : "false")
@if (!String.IsNullOrEmpty(modifyTime))
{
<text>@Html.PadLeft(4)ModifyTime: @modifyTime</text>
<text>@PadLeft(4)ModifyTime: @modifyTime</text>
}


Expand Down Expand Up @@ -113,6 +116,6 @@ Build:
<text>{Column: @col.Name,Mapping: @col.ConvertedName}</text>
if (colIndex < table.Columns.Count() - 1)
{@(",")}
@Html.NewLine()
@NewLine()
}
]
11 changes: 7 additions & 4 deletions 11 src/SmartCode.Generator/RazorTemplates/ETL/ToPGBuild.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
@using SmartCode
@using System
@using System.Collections.Generic
@using System.Linq
@using SmartCode
@using SmartCode.Db
@model BuildContext
@inherits SmartCode.TemplateEngine.Impl.RazorCoreTemplate<BuildContext>
@{
var project = Model.Project;
var dbSource = Model.GetDataSource<DbSource>();
Expand Down Expand Up @@ -59,7 +62,7 @@ DataSource:
AutoIncrement: @(PKColumn.AutoIncrement ? "true" : "false")
@if (!String.IsNullOrEmpty(modifyTime))
{
<text>@Html.PadLeft(4)ModifyTime: @modifyTime</text>
<text>@PadLeft(4)ModifyTime: @modifyTime</text>
}


Expand Down Expand Up @@ -107,6 +110,6 @@ Build:
<text>{Column: @col.Name,Mapping: @col.ConvertedName}</text>
if (colIndex < table.Columns.Count() - 1)
{@(",")}
@Html.NewLine()
@NewLine()
}
]
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
@using SmartCode
@model BuildContext
@inherits SmartCode.TemplateEngine.Impl.RazorCoreTemplate<BuildContext>
@{
Layout = "_JavaLayout.cshtml";
var project = Model.Project;
}

@Include("Copyright.cshtml", Model)

package @(project.Module).entity;

Expand Down
5 changes: 2 additions & 3 deletions 5 src/SmartCode.Generator/RazorTemplates/Java/AppConfig.cshtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
@using SmartCode
@model BuildContext
@inherits SmartCode.TemplateEngine.Impl.RazorCoreTemplate<BuildContext>
@{
Layout = "_JavaLayout.cshtml";
var project = Model.Project;
var buildTask = Model.Build;
}

@Include("Copyright.cshtml", Model)

package @(project.Module).server.config;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@using SmartCode
@model BuildContext
@inherits SmartCode.TemplateEngine.Impl.RazorCoreTemplate<BuildContext>
@{
Layout = "_JavaLayout.cshtml";
var project = Model.Project;

var appName = "Demo";
Expand All @@ -12,6 +11,7 @@
}
var appClassName = $"{appName}Application";
}
@Include("Copyright.cshtml", Model)

package @(project.Module).server;

Expand Down
7 changes: 4 additions & 3 deletions 7 src/SmartCode.Generator/RazorTemplates/Java/Controller.cshtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@using System
@using SmartCode
@model BuildContext
@inherits SmartCode.TemplateEngine.Impl.RazorCoreTemplate<BuildContext>
@{
Layout = "_JavaLayout.cshtml";
var project = Model.Project;
var buildTask = Model.Build;
var table = Model.GetCurrentTable();
Expand All @@ -22,6 +22,7 @@
throw new ArgumentException("can not find Project -> BuildTasks -> Service .");
}
}
@Include("Copyright.cshtml", Model)

package @(project.Module).@buildTask.Module;

Expand All @@ -33,7 +34,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import @(project.Module).@(serviceBuild.Module).@serviceName;

@Html.NewLine()
@NewLine()
@@RestController
@@RequestMapping("@entityCamelName")
public class @controllerName {
Expand Down
15 changes: 8 additions & 7 deletions 15 src/SmartCode.Generator/RazorTemplates/Java/Copyright.cshtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
@using SmartCode
@model BuildContext
@using System
@using SmartCode
@inherits SmartCode.TemplateEngine.Impl.RazorCoreTemplate<BuildContext>
@{
var project = Model.Project;
}
/*******************************
* @@author @project.Author
* @@date @DateTime.Now.ToString("yyyy-MM-dd HH:mm")
* Code Generate By SmartCode
* Code Generate Github : https://github.com/Ahoo-Wang/SmartCode
*******************************/
* @@author @project.Author
* @@date @DateTime.Now.ToString("yyyy-MM-dd HH:mm")
* Code Generate By SmartCode
* Code Generate Github : https://github.com/Ahoo-Wang/SmartCode
*******************************/
9 changes: 5 additions & 4 deletions 9 src/SmartCode.Generator/RazorTemplates/Java/Entity.cshtml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
@using SmartCode
@using System
@using System.Collections.Generic
@using SmartCode
@using SmartCode.Generator.Extensions
@model BuildContext
@inherits SmartCode.TemplateEngine.Impl.RazorCoreTemplate<BuildContext>
@{
Layout = "_JavaLayout.cshtml";
var project = Model.Project;
var buildTask = Model.Build;
var table = Model.GetCurrentTable();
Expand Down Expand Up @@ -57,7 +58,7 @@
}

}

@Include("Copyright.cshtml", Model)

package @(project.Module).@buildTask.Module;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
@using SmartCode
@using SmartCode.Db;
@using SmartCode.Generator.Extensions
@model BuildContext
@inherits SmartCode.TemplateEngine.Impl.RazorCoreTemplate<BuildContext>
@{
Layout = "_JavaLayout.cshtml";
var project = Model.Project;
var buildTask = Model.Build;
var table = Model.GetCurrentTable();
Expand All @@ -17,4 +16,5 @@
var dbSource = Model.GetDataSource<DbSource>();

}
@Include("Copyright.cshtml", Model)

3 changes: 1 addition & 2 deletions 3 src/SmartCode.Generator/RazorTemplates/Java/Pom-Api.cshtml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@using SmartCode
@model BuildContext
@inherits SmartCode.TemplateEngine.Impl.RazorCoreTemplate<BuildContext>

@{
Layout = null;
var project = Model.Project;
}

Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.