company_product.go 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. package company_product
  2. import "time"
  3. // CompanyProduct [...]
  4. type CompanyProduct struct {
  5. CompanyProductID int `gorm:"primaryKey;column:company_product_id;type:int(11);not null" json:"-"`
  6. CompanyID int `gorm:"uniqueIndex:idx_company_id_product_id;column:company_id;type:int(11);default:0" json:"companyId"` // 客户id
  7. ProductID int `gorm:"uniqueIndex:idx_company_id_product_id;column:product_id;type:int(11);default:0" json:"productId"` // 产品id
  8. ProductName string `gorm:"column:product_name;type:varchar(30);default:''" json:"productName"`
  9. CompanyName string `gorm:"column:company_name;type:varchar(100);default:''" json:"companyName"` // 客户名称
  10. Source string `gorm:"column:source;type:varchar(100);default:''" json:"source"` // 来源
  11. Reasons string `gorm:"column:reasons;type:varchar(255);default:''" json:"reasons"` // 新增理由
  12. Status string `gorm:"column:status;type:enum('试用','永续','冻结','流失','正式','潜在')" json:"status"` // 客户状态
  13. IndustryID int `gorm:"column:industry_id;type:int(11)" json:"industryId"` // 行业id
  14. IndustryName string `gorm:"column:industry_name;type:varchar(50);default:''" json:"industryName"` // 行业名称
  15. SellerID int `gorm:"column:seller_id;type:int(11);default:0" json:"sellerId"` // 所属销售id
  16. SellerName string `gorm:"column:seller_name;type:varchar(50);default:''" json:"sellerName"` // 所属销售名称
  17. GroupID int `gorm:"column:group_id;type:int(11);default:0" json:"groupId"` // 所属销售分组id
  18. DepartmentID int `gorm:"column:department_id;type:int(11);default:0" json:"departmentId"` // 所属销售部门id
  19. IsSuspend int8 `gorm:"primaryKey;column:is_suspend;type:tinyint(4);not null;default:0" json:"-"` // 1:暂停,0:启用
  20. SuspendTime time.Time `gorm:"column:suspend_time;type:datetime" json:"suspendTime"` // 暂停/启用时间
  21. TryOutTime time.Time `gorm:"column:try_out_time;type:datetime" json:"tryOutTime"` // 正式转试用时间
  22. RenewalReason string `gorm:"column:renewal_reason;type:varchar(255);default:''" json:"renewalReason"` // 正式转试用后的续约情况说明
  23. FreezeTime time.Time `gorm:"column:freeze_time;type:datetime" json:"freezeTime"` // 冻结时间
  24. FreezeReason string `gorm:"column:freeze_reason;type:varchar(255);default:''" json:"freezeReason"` // 冻结理由
  25. Remark string `gorm:"column:remark;type:varchar(255);default:''" json:"remark"` // 备注信息
  26. StartDate time.Time `gorm:"column:start_date;type:date" json:"startDate"` // 开始日期
  27. EndDate time.Time `gorm:"column:end_date;type:date" json:"endDate"` // 结束日期
  28. ContractEndDate time.Time `gorm:"index:idx_contract_end_date;column:contract_end_date;type:date" json:"contractEndDate"` // 合同结束日期
  29. CreateTime time.Time `gorm:"column:create_time;type:datetime" json:"createTime"` // 创建时间
  30. ModifyTime time.Time `gorm:"column:modify_time;type:datetime" json:"modifyTime"` // 修改时间
  31. LoseReason string `gorm:"column:lose_reason;type:varchar(255);default:''" json:"loseReason"` // 流失原因
  32. LossTime time.Time `gorm:"column:loss_time;type:datetime" json:"lossTime"` // 流失时间
  33. ApproveStatus string `gorm:"column:approve_status;type:enum('待审批','已审批','驳回','已撤回')" json:"approveStatus"` // 审批状态
  34. CompanyType string `gorm:"column:company_type;type:varchar(20);default:''" json:"companyType"` // 客户类型:ficc,权益,合作伙伴
  35. FreezeStartDate time.Time `gorm:"column:freeze_start_date;type:date" json:"freezeStartDate"` // 冻结开始日期
  36. FreezeEndDate time.Time `gorm:"column:freeze_end_date;type:date" json:"freezeEndDate"` // 冻结结束日期
  37. CustomType int8 `gorm:"column:custom_type;type:tinyint(4);default:0" json:"customType"` // 1:合作伙伴,2:公募,3:私募
  38. FormalTime time.Time `gorm:"column:formal_time;type:datetime" json:"formalTime"` // 转正时间
  39. OpenCode string `gorm:"column:open_code;type:varchar(64);default:''" json:"openCode"` // 开放给第三方的编码,不让第三方定位我们的客户信息
  40. }
  41. // TableName get sql table name.获取数据库表名
  42. func (m *CompanyProduct) TableName() string {
  43. return "company_product"
  44. }
  45. // CompanyProductColumns get sql column name.获取数据库列名
  46. var CompanyProductColumns = struct {
  47. CompanyProductID string
  48. CompanyID string
  49. ProductID string
  50. ProductName string
  51. CompanyName string
  52. Source string
  53. Reasons string
  54. Status string
  55. IndustryID string
  56. IndustryName string
  57. SellerID string
  58. SellerName string
  59. GroupID string
  60. DepartmentID string
  61. IsSuspend string
  62. SuspendTime string
  63. TryOutTime string
  64. RenewalReason string
  65. FreezeTime string
  66. FreezeReason string
  67. Remark string
  68. StartDate string
  69. EndDate string
  70. ContractEndDate string
  71. CreateTime string
  72. ModifyTime string
  73. LoseReason string
  74. LossTime string
  75. ApproveStatus string
  76. CompanyType string
  77. FreezeStartDate string
  78. FreezeEndDate string
  79. CustomType string
  80. FormalTime string
  81. OpenCode string
  82. }{
  83. CompanyProductID: "company_product_id",
  84. CompanyID: "company_id",
  85. ProductID: "product_id",
  86. ProductName: "product_name",
  87. CompanyName: "company_name",
  88. Source: "source",
  89. Reasons: "reasons",
  90. Status: "status",
  91. IndustryID: "industry_id",
  92. IndustryName: "industry_name",
  93. SellerID: "seller_id",
  94. SellerName: "seller_name",
  95. GroupID: "group_id",
  96. DepartmentID: "department_id",
  97. IsSuspend: "is_suspend",
  98. SuspendTime: "suspend_time",
  99. TryOutTime: "try_out_time",
  100. RenewalReason: "renewal_reason",
  101. FreezeTime: "freeze_time",
  102. FreezeReason: "freeze_reason",
  103. Remark: "remark",
  104. StartDate: "start_date",
  105. EndDate: "end_date",
  106. ContractEndDate: "contract_end_date",
  107. CreateTime: "create_time",
  108. ModifyTime: "modify_time",
  109. LoseReason: "lose_reason",
  110. LossTime: "loss_time",
  111. ApproveStatus: "approve_status",
  112. CompanyType: "company_type",
  113. FreezeStartDate: "freeze_start_date",
  114. FreezeEndDate: "freeze_end_date",
  115. CustomType: "custom_type",
  116. FormalTime: "formal_time",
  117. OpenCode: "open_code",
  118. }