|
@@ -25,7 +25,7 @@ type IndustrialManagementCount struct {
|
|
|
IndustrialManagementId int `orm:"column(industrial_management_id);pk" description:"产业id"`
|
|
|
}
|
|
|
|
|
|
-//获取产业置顶数量分类列表
|
|
|
+// 获取产业置顶数量分类列表
|
|
|
func GetIndustrialManagemenCountTop(sqlChartPermissionId string, uid int, condition string) (items []*IndustrialManagementCount, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -41,7 +41,7 @@ func GetIndustrialManagemenCountTop(sqlChartPermissionId string, uid int, condit
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取产业不置顶数量
|
|
|
+// 获取产业不置顶数量
|
|
|
func GetIndustrialManagemenCountNoTop(sqlChartPermissionId string, uid int, condition string) (items []*IndustrialManagementCount, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -57,7 +57,7 @@ func GetIndustrialManagemenCountNoTop(sqlChartPermissionId string, uid int, cond
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//产业列表
|
|
|
+// 产业列表
|
|
|
func GetIndustrialManagementAll(uid int, condition, orderSrt string, startSize, pageSize int) (items []*IndustrialManagement, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -83,7 +83,7 @@ func GetIndustrialManagementAll(uid int, condition, orderSrt string, startSize,
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//产业列表
|
|
|
+// 产业列表
|
|
|
func GetIndustrialManagementAllCount(condition string) (count int, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -105,7 +105,7 @@ func GetIndustrialManagementAllCount(condition string) (count int, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//产业列表 -置顶
|
|
|
+// 产业列表 -置顶
|
|
|
func GetIndustrialManagementTopAll(uid int, condition string, startSize, pageSize int) (items []*IndustrialManagement, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -130,7 +130,7 @@ func GetIndustrialManagementTopAll(uid int, condition string, startSize, pageSiz
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//标的列表
|
|
|
+// 标的列表
|
|
|
func GetIndustrialSubjectAll(IndustrialManagementId int) (items []*IndustrialSubject, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM cygx_industrial_subject WHERE industrial_management_id = ? `
|
|
@@ -138,7 +138,7 @@ func GetIndustrialSubjectAll(IndustrialManagementId int) (items []*IndustrialSub
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//标的列表
|
|
|
+// 标的列表
|
|
|
func GetIndustrialSubjectAllByIndustrialId(industrialIdArr []int) (items []*IndustrialSubject, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM cygx_industrial_subject WHERE industrial_management_id IN (` + utils.GetOrmInReplace(len(industrialIdArr)) + `) `
|
|
@@ -146,7 +146,7 @@ func GetIndustrialSubjectAllByIndustrialId(industrialIdArr []int) (items []*Indu
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//分析师列表
|
|
|
+// 分析师列表
|
|
|
func GetIndustrialAnalystAll(IndustrialManagementId int) (items []*IndustrialAnalyst, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM cygx_industrial_analyst where industrial_management_id = ? `
|
|
@@ -154,7 +154,7 @@ func GetIndustrialAnalystAll(IndustrialManagementId int) (items []*IndustrialAna
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取产业数量
|
|
|
+// 获取产业数量
|
|
|
func GetIndustrialManagementCount(IndustrialManagementId int) (count int, err error) {
|
|
|
sqlCount := ` SELECT COUNT(1) AS count FROM cygx_industrial_management WHERE industrial_management_id=? `
|
|
|
o := orm.NewOrm()
|
|
@@ -169,7 +169,7 @@ func GetIndustrialManagementDetail(industrialManagementId int) (items *Industria
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取该产业下最新的文章详情
|
|
|
+// 获取该产业下最新的文章详情
|
|
|
func GetIndustrialNewArticleDetail(industrialManagementId int) (item *ArticleDetail, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -194,7 +194,7 @@ func GetIndustrialNewArticleDetail(industrialManagementId int) (item *ArticleDet
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//修改产业是否属于新标签
|
|
|
+// 修改产业是否属于新标签
|
|
|
func UpdateIndustrialIsNewLabel() (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
resultTime := time.Now().AddDate(0, -2, 0).Format(utils.FormatDateTime)
|
|
@@ -209,7 +209,7 @@ type IndustrialManagementId struct {
|
|
|
IndustrialManagementId string `description:"产业Id"`
|
|
|
}
|
|
|
|
|
|
-//获取归类产业报告数量大于10的
|
|
|
+// 获取归类产业报告数量大于10的
|
|
|
func GetIndustrialMorethan10() (items []*IndustrialManagementId, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM
|
|
@@ -219,7 +219,7 @@ func GetIndustrialMorethan10() (items []*IndustrialManagementId, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//修改产业是否属于深度标签
|
|
|
+// 修改产业是否属于深度标签
|
|
|
func UpdateIndustrialIsDeepLabel(idStr string) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
msql := `UPDATE cygx_industrial_management
|
|
@@ -266,7 +266,7 @@ type IndustrialManagementIdName struct {
|
|
|
IsReport string `description:"1观点,0纪要"`
|
|
|
}
|
|
|
|
|
|
-//获取归类产业报告数量大于10的
|
|
|
+// 获取归类产业报告数量大于10的
|
|
|
func GetIndustrialManagementIds() (items []*IndustrialManagementIdInt, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
//sql := `SELECT a.industrial_management_id FROM
|
|
@@ -282,12 +282,12 @@ func GetIndustrialManagementIds() (items []*IndustrialManagementIdInt, err error
|
|
|
|
|
|
func GetcygxIndustrialSubject(industrialManagementId int) (items []*IndustrialSubject, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
- sql := `SELECT subject_name FROM cygx_industrial_subject WHERE industrial_management_id = ?`
|
|
|
+ sql := `SELECT subject_name,industrial_subject_id FROM cygx_industrial_subject WHERE industrial_management_id = ?`
|
|
|
_, err = o.Raw(sql, industrialManagementId).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//通过名称获取
|
|
|
+// 通过名称获取
|
|
|
func GetcygxIndustrialSubjectByName(name string) (industrial_management_id string, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := ` SELECT industrial_subject_id FROM cygx_industrial_subject WHERE subject_name = ?`
|
|
@@ -327,7 +327,7 @@ func UpdateIndustrialManagementArtReadNum(num, industrialManagementId int) (err
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//更新产业布局时间
|
|
|
+// 更新产业布局时间
|
|
|
func UpdateIndustrialManagementLayoutTime(layoutTime string, industrialManagementId int) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `UPDATE cygx_industrial_management SET layout_time = ? WHERE industrial_management_id = ?`
|
|
@@ -335,7 +335,7 @@ func UpdateIndustrialManagementLayoutTime(layoutTime string, industrialManagemen
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取产业下阅读数量第三的产业详情
|
|
|
+// 获取产业下阅读数量第三的产业详情
|
|
|
func GetIndustrialManagementHot3(chartPermissionId int) (item *IndustrialManagementRep, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM cygx_industrial_management WHERE chart_permission_id = ? ORDER BY article_read_num DESC LIMIT 2,1`
|
|
@@ -343,7 +343,7 @@ func GetIndustrialManagementHot3(chartPermissionId int) (item *IndustrialManagem
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取产业关联标的的数量
|
|
|
+// 获取产业关联标的的数量
|
|
|
func GetIndustrialManagementSubjectCount(industrialManagementId int) (count int, err error) {
|
|
|
sqlCount := ` SELECT COUNT(1) AS count FROM
|
|
|
cygx_industrial_subject AS s
|
|
@@ -356,7 +356,7 @@ func GetIndustrialManagementSubjectCount(industrialManagementId int) (count int,
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取产业关联标的列表
|
|
|
+// 获取产业关联标的列表
|
|
|
func GetIndustrialManagementSubjectList(articleId int) (items []*IndustrialSubject, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -388,7 +388,7 @@ type IndustrialManagementNewList struct {
|
|
|
List []*IndustrialManagementNewResp
|
|
|
}
|
|
|
|
|
|
-//近期更新主题列表
|
|
|
+// 近期更新主题列表
|
|
|
func GetIndustrialManagementNewList(condition string) (items []*IndustrialManagementNewResp, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -412,7 +412,7 @@ func GetIndustrialManagementNewList(condition string) (items []*IndustrialManage
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取产业关联标的列表
|
|
|
+// 获取产业关联标的列表
|
|
|
func GetIndustrialManagementForSubjecName(subjectName string, chartPermissionId int) (items []*IndustrialSubject, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT s.subject_name,s.industrial_subject_id,m.industrial_management_id,m.industry_name,layout_time
|
|
@@ -423,7 +423,7 @@ func GetIndustrialManagementForSubjecName(subjectName string, chartPermissionId
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//报告分类的新增与修改
|
|
|
+// 报告分类的新增与修改
|
|
|
func ReportArticleClassificationEditNew(reportId int, industrialManagementIdStr string, articleId int, ndustrialSubjectIdStr string) (err error) {
|
|
|
to, err := orm.NewOrm().Begin()
|
|
|
if err != nil {
|
|
@@ -479,7 +479,7 @@ func ReportArticleClassificationEditNew(reportId int, industrialManagementIdStr
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//通过标的名称获取相关联的活动ID
|
|
|
+// 通过标的名称获取相关联的活动ID
|
|
|
func GetActivityIdListBySubjecName(subjectName string) (items []*ActivityIdRep, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM cygx_industrial_activity_group_subject WHERE industrial_subject_id IN (SELECT industrial_subject_id FROM cygx_industrial_subject WHERE subject_name IN(` + subjectName + `) ) GROUP BY activity_id`
|
|
@@ -487,7 +487,7 @@ func GetActivityIdListBySubjecName(subjectName string) (items []*ActivityIdRep,
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//产业关注榜
|
|
|
+// 产业关注榜
|
|
|
func GetIndustrialManagementFllowBillboard(pars []interface{}, condition, orderSrt string, startSize, pageSize int) (items []*IndustrialManagement, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -507,7 +507,7 @@ func GetIndustrialManagementFllowBillboard(pars []interface{}, condition, orderS
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取标的列表
|
|
|
+// 获取标的列表
|
|
|
func GetSubjectList(pars []interface{}, condition string) (items []*IndustrialManagementIdInt, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -524,7 +524,7 @@ func GetSubjectList(pars []interface{}, condition string) (items []*IndustrialMa
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取标的列表
|
|
|
+// 获取标的列表
|
|
|
func GetIndustrialListByarticleId(pars []interface{}, condition string) (items []*IndustrialManagementIdInt, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -540,7 +540,7 @@ func GetIndustrialListByarticleId(pars []interface{}, condition string) (items [
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//修改产业关注数量
|
|
|
+// 修改产业关注数量
|
|
|
func UpdateIndustrialManagementFllowNum(num, industrialManagementId int) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `UPDATE cygx_industrial_management SET user_fllow_num = ? WHERE industrial_management_id = ?`
|
|
@@ -548,7 +548,7 @@ func UpdateIndustrialManagementFllowNum(num, industrialManagementId int) (err er
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//通过id 获取详情
|
|
|
+// 通过id 获取详情
|
|
|
func GetIndustrialManagemenDetailByAaticleID(articleId int) (items []*IndustrialManagementRep, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -564,7 +564,7 @@ func GetIndustrialManagemenDetailByAaticleID(articleId int) (items []*Industrial
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取所有的产业
|
|
|
+// 获取所有的产业
|
|
|
func GetindustrialManagement() (items []*IndustrialManagementRep, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -638,7 +638,7 @@ type IndustrialManagementArticle struct {
|
|
|
PublishDate string `description:"发布时间"`
|
|
|
}
|
|
|
|
|
|
-//时间线的更新时间
|
|
|
+// 时间线的更新时间
|
|
|
func GetTimeLineReportIndustrialPublishdateList(industrialIdArr []int) (items []*IndustrialManagementArticle, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|
|
@@ -659,7 +659,7 @@ func GetTimeLineReportIndustrialPublishdateList(industrialIdArr []int) (items []
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取该产业下最新的文章详情
|
|
|
+// 获取该产业下最新的文章详情
|
|
|
func GetNewArticleDetailByIndustrialIds(industrialIdArr []int) (items []*IndustrialManagementArticle, err error) {
|
|
|
arrLen := len(industrialIdArr)
|
|
|
if arrLen == 0 {
|
|
@@ -685,7 +685,7 @@ func GetNewArticleDetailByIndustrialIds(industrialIdArr []int) (items []*Industr
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//GetIndustrialManagementArticleNewPublishData 获取产业关联文章的最新发布时间
|
|
|
+// GetIndustrialManagementArticleNewPublishData 获取产业关联文章的最新发布时间
|
|
|
func GetIndustrialManagementArticleNewPublishData() (items []*IndustrialManagement, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT
|