contract_service_detail.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package contract_service_detail
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. //合同的服务内容详情,表单数据
  7. type ContractServiceDetail struct {
  8. Id int `orm:"column(id);pk"`
  9. ContractServiceId int `description:"合同服务id"`
  10. ContractId int `description:"合同id"`
  11. ServiceTemplateId int `description:"服务模板id"`
  12. Col1 string `orm:"column(col_1)"description:"第1列数据"`
  13. Col2 string `orm:"column(col_2)"description:"第2列数据"`
  14. Col3 string `orm:"column(col_3)"description:"第3列数据"`
  15. Col4 string `orm:"column(col_4)"description:"第4列数据"`
  16. Col5 string `orm:"column(col_5)"description:"第5列数据"`
  17. Col6 string `orm:"column(col_6)"description:"第6列数据"`
  18. Col7 string `orm:"column(col_7)"description:"第7列数据"`
  19. CreateTime time.Time `description:"数据添加时间"`
  20. }
  21. //根据服务模板id获取对应的套餐表格数据详情
  22. func GetContractServiceDetailByTemplateId(serviceTemplateId int) (list []*ContractServiceDetail, err error) {
  23. o := orm.NewOrm()
  24. sql := `select * from contract_service_detail where service_template_id = ? and contract_service_id = 0 order by id asc`
  25. _, err = o.Raw(sql, serviceTemplateId).QueryRows(&list)
  26. return
  27. }
  28. //根据合同服务id获取对应的套餐表格数据详情
  29. func GetContractServiceDetailListByServiceId(contractServiceId int) (list []*ContractServiceDetail, err error) {
  30. o := orm.NewOrm()
  31. sql := `select * from contract_service_detail where contract_service_id = ? order by id asc`
  32. _, err = o.Raw(sql, contractServiceId).QueryRows(&list)
  33. return
  34. }