2020-08-19 10:41:19 +08:00
|
|
|
package template
|
2020-07-29 17:11:41 +08:00
|
|
|
|
2020-12-21 09:43:32 +08:00
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
var Vars = fmt.Sprintf(`
|
2020-07-29 17:11:41 +08:00
|
|
|
var (
|
2020-08-19 10:41:19 +08:00
|
|
|
{{.lowerStartCamelObject}}FieldNames = builderx.FieldNames(&{{.upperStartCamelObject}}{})
|
|
|
|
{{.lowerStartCamelObject}}Rows = strings.Join({{.lowerStartCamelObject}}FieldNames, ",")
|
2020-12-21 09:43:32 +08:00
|
|
|
{{.lowerStartCamelObject}}RowsExpectAutoSet = strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, {{if .autoIncrement}}"{{.originalPrimaryKey}}",{{end}} "%screate_time%s", "%supdate_time%s"), ",")
|
|
|
|
{{.lowerStartCamelObject}}RowsWithPlaceHolder = strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, "{{.originalPrimaryKey}}", "%screate_time%s", "%supdate_time%s"), "=?,") + "=?"
|
2020-07-29 17:11:41 +08:00
|
|
|
|
2020-08-19 10:41:19 +08:00
|
|
|
{{if .withCache}}{{.cacheKeys}}{{end}}
|
2020-07-29 17:11:41 +08:00
|
|
|
)
|
2020-12-21 09:43:32 +08:00
|
|
|
`, "`", "`", "`", "`", "`", "`", "`", "`")
|