colname add ``

给导出列名添加``符
This commit is contained in:
xxj
2021-02-19 18:03:04 +08:00
parent ea7c73db90
commit 0e2a3e4553
4 changed files with 7 additions and 5 deletions

View File

@@ -189,7 +189,7 @@ func GenFListIndex(info FList, status int) string {
{
var strs []string
for _, v := range info.Kem {
strs = append(strs, fmt.Sprintf("%v = ?", v.ColName))
strs = append(strs, fmt.Sprintf("`%v` = ?", v.ColName))
}
return strings.Join(strs, " AND ")
}

View File

@@ -106,6 +106,7 @@ type EmInfo struct {
Notes string // 注释
Type string // 类型
ColName string // 列名
ColNameEx string // `列名`
ColStructName string // 列结构体
}

View File

@@ -297,6 +297,7 @@ func (m *_Model) generateFunc() (genOut []GenOutInfo) {
Notes: fixNotes(el.Notes),
Type: typeName, // Type.类型标记
ColName: el.Name,
ColNameEx: fmt.Sprintf("`%v`", el.Name),
ColStructName: getCamelName(el.Name),
})
if v2, ok := cnf.EImportsHead[typeName]; ok {