123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- package cygx
- import "github.com/beego/beego/v2/client/orm"
- type RaiServeTypeResp struct {
- ServeTypeId int `description:"服务类型id"`
- ServeTypeName string `description:"服务类型名称"`
- }
- type RaiServeTypeListResp struct {
- List []*RaiServeTypeResp
- }
- // 服务类型列表
- func GetRaiServeTypeRespList(condition string) (items []*RaiServeTypeResp, err error) {
- o := orm.NewOrmUsingDB("hz_cygx")
- sql := `SELECT * FROM cygx_rai_serve_type WHERE 1= 1 `
- if condition != "" {
- sql += condition
- }
- sql += ` ORDER BY sort DESC LIMIT 100 `
- _, err = o.Raw(sql).QueryRows(&items)
- return
- }
- type RaiServeTagResp struct {
- TagType int `description:"标签类型"`
- TagId int `description:"标签ID"`
- TagName string `description:"标签名称"`
- Md5Key string `description:"加密key,前端找参数当唯一索引值使用"`
- }
- type RaiServeTagListResp struct {
- List []*RaiServeTagResp
- }
- type RaiServeCoverageRateResp struct {
- List []string
- }
- // 服务类型列表
- func GetRaiServeSearchTagRespList(keywords string) (items []*RaiServeTagResp, err error) {
- o := orm.NewOrmUsingDB("hz_cygx")
- sql := `SELECT
- 1 AS tag_type,
- i.industrial_management_id AS tag_id,
- i.industry_name AS tag_name,
- i.create_time
- FROM
- cygx_industrial_management AS i
- WHERE
- 1 = 1
- AND i.chart_permission_id IN ( 19, 20, 21, 22 )
- AND i.industry_name LIKE '%` + keywords + `%' UNION ALL
- SELECT
- 2 AS tag_type,
- s.industrial_subject_id AS tag_id,
- s.subject_name AS tag_name,
- s.create_time
- FROM
- cygx_industrial_subject AS s
- INNER JOIN cygx_industrial_management AS i ON i.industrial_management_id = s.industrial_management_id
- WHERE
- 1 = 1
- AND i.chart_permission_id IN ( 19, 20, 21, 22 )
- AND s.subject_name LIKE '%` + keywords + `%'
- ORDER BY
- create_time ASC `
- _, err = o.Raw(sql).QueryRows(&items)
- return
- }
- // 权益服务明细表
- type CygxRaiServeBillResp struct {
- Content string `comment:"服务内容说明"`
- ServeTypeName string `comment:"服务类型"`
- Mobile string `comment:"手机号"`
- Email string `comment:"邮箱"`
- RealName string `comment:"用户实际名称"`
- ServeCount float64 `comment:"服务量小计"`
- Tag string `comment:"标签,多个用 , 隔开"`
- IsKp int `comment:"是否是KP,1:是、0:否"`
- ViewTime string `comment:"浏览时间"`
- }
- type CygxRaiServeBillListResp struct {
- CompanyName string `comment:"公司名称"`
- List []*CygxRaiServeBillResp
- }
- // 列表
- func GetCygxRaiServeBillRespList(condition string, pars []interface{}) (items []*CygxRaiServeBillResp, err error) {
- o := orm.NewOrmUsingDB("hz_cygx")
- sql := `SELECT * FROM cygx_rai_serve_bill as art WHERE 1= 1 `
- if condition != "" {
- sql += condition
- }
- sql += ` ORDER BY bill_id DESC LIMIT 1000 `
- _, err = o.Raw(sql, pars).QueryRows(&items)
- return
- }
|