reactor sql generation

This commit is contained in:
anqiansong
2020-08-12 14:09:49 +08:00
parent f226ffb57c
commit c519345924
19 changed files with 497 additions and 33 deletions

View File

@@ -14,7 +14,7 @@ func genFineOneByField(table Table, withCache bool) (string, error) {
var list []string
camelTableName := table.Name.Snake2Camel()
for _, field := range table.Fields {
if field.IsPrimaryKey {
if field.IsPrimaryKey || !field.IsKey {
continue
}
camelFieldName := field.Name.Snake2Camel()
@@ -25,7 +25,7 @@ func genFineOneByField(table Table, withCache bool) (string, error) {
"withCache": withCache,
"cacheKey": table.CacheKey[field.Name.Source()].KeyExpression,
"cacheKeyVariable": table.CacheKey[field.Name.Source()].Variable,
"primaryKeyLeft": table.CacheKey[table.Name.Source()].Left,
"primaryKeyLeft": table.CacheKey[table.PrimaryKey.Name.Source()].Left,
"lowerStartCamelObject": stringx.From(camelTableName).LowerStart(),
"lowerStartCamelField": stringx.From(camelFieldName).LowerStart(),
"upperStartCamelPrimaryKey": table.PrimaryKey.Name.Snake2Camel(),