1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- package cygx
- import (
- "github.com/beego/beego/v2/client/orm"
- "github.com/rdlucklib/rdluck_tools/paging"
- "time"
- )
- type CygxRaiServeCompany struct {
- ServeCompanyId int `comment:"ServeCompanyId 主键ID"`
- CompanyId int `comment:"公司ID"`
- CompanyName string `comment:"公司名称"`
- CreateTime time.Time `comment:"创建时间"`
- Money float64 `comment:"合同金额"`
- ServeCoverageRate string `comment:"近四周服务覆盖率"`
- SellerId int `comment:"所属销售id"`
- SellerName string `comment:"所属销售名称"`
- StartDate string `comment:"开始日期"`
- EndDate string `comment:"结束日期"`
- ShareSeller string `comment:"共享销售"`
- ShareSellerId int `comment:"共享销售员id"`
- Status string `comment:"客户状态"`
- PermissionName string `comment:"权限名"`
- }
- type CygxRaiServeCompanyResp struct {
- CompanyId int `comment:"公司ID"`
- CompanyName string `comment:"公司名称"`
- IsRed bool `comment:"是否标红"`
- Money float64 `comment:"合同金额"`
- ServeCoverageRate string `comment:"近四周服务覆盖率"`
- SellerId int `comment:"所属销售id"`
- SellerName string `comment:"所属销售名称"`
- StartDate string `comment:"开始日期"`
- EndDate string `comment:"结束日期"`
- ShareSeller string `comment:"共享销售"`
- ShareSellerId int `comment:"共享销售员id"`
- Status string `comment:"客户状态"`
- PermissionName string `comment:"权限名"`
- ThisWeekAmount int `comment:"本周互动量"`
- LastWeekAmount int `comment:"上周互动量"`
- TwoWeekAmount int `comment:"上上周互动量"`
- ThreeWeekAmount int `comment:"上三周互动量"`
- }
- type CygxRaiServeCompanyListResp struct {
- Paging *paging.PagingItem `description:"分页数据"`
- List []*CygxRaiServeCompanyResp
- }
- func GetCygxRaiServeCompanyCount(condition string, pars []interface{}) (count int, err error) {
- sqlCount := ` SELECT COUNT(1) AS count FROM cygx_rai_serve_company as art WHERE 1= 1 `
- if condition != "" {
- sqlCount += condition
- }
- o := orm.NewOrmUsingDB("hz_cygx")
- err = o.Raw(sqlCount, pars).QueryRow(&count)
- return
- }
- // 列表
- func GetCygxRaiServeCompanyList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxRaiServeCompany, err error) {
- o := orm.NewOrmUsingDB("hz_cygx")
- sql := `SELECT * FROM cygx_rai_serve_company as art WHERE 1= 1 `
- if condition != "" {
- sql += condition
- }
- sql += ` LIMIT ?,?`
- _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
- return
- }
|