|
@@ -398,7 +398,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
if spqp.SelectInfoIds != nil && len(spqp.SelectInfoIds) > 0 {
|
|
if spqp.SelectInfoIds != nil && len(spqp.SelectInfoIds) > 0 {
|
|
countSql = fmt.Sprintf("select count(1) as count from %s a where %s", aboutDbMsg[s.ModuleFlag].MysqlTable, fmt.Sprintf("a.id in ('%s')", strings.Join(spqp.SelectInfoIds, "','")))
|
|
countSql = fmt.Sprintf("select count(1) as count from %s a where %s", aboutDbMsg[s.ModuleFlag].MysqlTable, fmt.Sprintf("a.id in ('%s')", strings.Join(spqp.SelectInfoIds, "','")))
|
|
logx.Info("countSql", countSql)
|
|
logx.Info("countSql", countSql)
|
|
- findSql = fmt.Sprintf("select a.id,a.date,a.infoid,a.isvisit,a.matchkeys,a.type,a.attachment_count from %s a where %s order by a.date desc,a.id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, fmt.Sprintf("a.id in ('%s')", strings.Join(spqp.SelectInfoIds, "','")))
|
|
|
|
|
|
+ findSql = fmt.Sprintf("select a.id,a.date,a.infoid,a.isvisit,REPLACE(a.matchkeys,'+',' ') as matchkeys,a.type,a.attachment_count from %s a where %s order by a.date desc,a.id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, fmt.Sprintf("a.id in ('%s')", strings.Join(spqp.SelectInfoIds, "','")))
|
|
//查询总数
|
|
//查询总数
|
|
count = spqp.BaseServiceMysql.CountBySql(countSql)
|
|
count = spqp.BaseServiceMysql.CountBySql(countSql)
|
|
} else {
|
|
} else {
|
|
@@ -597,7 +597,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
//查询数量(需要去重)
|
|
//查询数量(需要去重)
|
|
countSql = fmt.Sprintf("select count(1) from %s a where %s %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "))
|
|
countSql = fmt.Sprintf("select count(1) from %s a where %s %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "))
|
|
//列表查询
|
|
//列表查询
|
|
- findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,a.attachment_count, IF(a.source is NULL,1,a.source) as source from %s a where %s %s order by a.date desc,a.id desc",
|
|
|
|
|
|
+ findSql = fmt.Sprintf("select a.id,a.infoid,REPLACE(a.matchkeys,'+',' ') as matchkeys,a.attachment_count, IF(a.source is NULL,1,a.source) as source from %s a where %s %s order by a.date desc,a.id desc",
|
|
aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "))
|
|
aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "))
|
|
} else {
|
|
} else {
|
|
//查询分配人员或是否已读
|
|
//查询分配人员或是否已读
|
|
@@ -609,7 +609,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
}
|
|
}
|
|
countSql = fmt.Sprintf("select count(1) from %s a where %s %s %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "), staffQuery)
|
|
countSql = fmt.Sprintf("select count(1) from %s a where %s %s %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "), staffQuery)
|
|
//列表查询
|
|
//列表查询
|
|
- findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,a.attachment_count,IF(a.source is NULL,1,a.source) as source from %s a where %s %s %s order by a.date desc,a.id desc ", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "), staffQuery)
|
|
|
|
|
|
+ findSql = fmt.Sprintf("select a.id,a.infoid,REPLACE(a.matchkeys,'+',' ') as matchkeys,a.attachment_count,IF(a.source is NULL,1,a.source) as source from %s a where %s %s %s order by a.date desc,a.id desc ", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "), staffQuery)
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
// 是否已读
|
|
// 是否已读
|
|
@@ -647,7 +647,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
//查询数量
|
|
//查询数量
|
|
countSql = fmt.Sprintf("select count(1) as count from %s a where %s %s", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "))
|
|
countSql = fmt.Sprintf("select count(1) as count from %s a where %s %s", aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, strings.Join(querys, " and "))
|
|
//列表查询语句
|
|
//列表查询语句
|
|
- findSql = "select a.id,a.date,a.infoid,a.isvisit,a.matchkeys,a.type,a.attachment_count"
|
|
|
|
|
|
+ findSql = "select a.id,a.date,a.infoid,a.isvisit,REPLACE(a.matchkeys,'+',' ') as matchkeys,a.type,a.attachment_count"
|
|
if s.ModuleFlag == EntnicheFlag {
|
|
if s.ModuleFlag == EntnicheFlag {
|
|
findSql += ", IF(a.source is NULL,1,a.source) as source "
|
|
findSql += ", IF(a.source is NULL,1,a.source) as source "
|
|
}
|
|
}
|