sys_export_template.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // 自动生成模板SysExportTemplate
  2. package system
  3. import (
  4. "server/global"
  5. )
  6. // 导出模板 结构体 SysExportTemplate
  7. type SysExportTemplate struct {
  8. global.GVA_MODEL
  9. DBName string `json:"dbName" form:"dbName" gorm:"column:db_name;comment:数据库名称;"` //数据库名称
  10. Name string `json:"name" form:"name" gorm:"column:name;comment:模板名称;"` //模板名称
  11. TableName string `json:"tableName" form:"tableName" gorm:"column:table_name;comment:表名称;"` //表名称
  12. TemplateID string `json:"templateID" form:"templateID" gorm:"column:template_id;comment:模板标识;"` //模板标识
  13. TemplateInfo string `json:"templateInfo" form:"templateInfo" gorm:"column:template_info;type:text;"` //模板信息
  14. Limit int `json:"limit" form:"limit" gorm:"column:limit;comment:导出限制"`
  15. Order string `json:"order" form:"order" gorm:"column:order;comment:排序"`
  16. Conditions []Condition `json:"conditions" form:"conditions" gorm:"foreignKey:TemplateID;references:TemplateID;comment:条件"`
  17. JoinTemplate []JoinTemplate `json:"joinTemplate" form:"joinTemplate" gorm:"foreignKey:TemplateID;references:TemplateID;comment:关联"`
  18. }
  19. type JoinTemplate struct {
  20. global.GVA_MODEL
  21. TemplateID string `json:"templateID" form:"templateID" gorm:"column:template_id;comment:模板标识"`
  22. JOINS string `json:"joins" form:"joins" gorm:"column:joins;comment:关联"`
  23. Table string `json:"table" form:"table" gorm:"column:table;comment:关联表"`
  24. ON string `json:"on" form:"on" gorm:"column:on;comment:关联条件"`
  25. }
  26. func (JoinTemplate) TableName() string {
  27. return "sys_export_template_join"
  28. }
  29. type Condition struct {
  30. global.GVA_MODEL
  31. TemplateID string `json:"templateID" form:"templateID" gorm:"column:template_id;comment:模板标识"`
  32. From string `json:"from" form:"from" gorm:"column:from;comment:条件取的key"`
  33. Column string `json:"column" form:"column" gorm:"column:column;comment:作为查询条件的字段"`
  34. Operator string `json:"operator" form:"operator" gorm:"column:operator;comment:操作符"`
  35. }
  36. func (Condition) TableName() string {
  37. return "sys_export_template_condition"
  38. }