|
@@ -265,7 +265,7 @@ func GetEdbInfoRelationList(condition string, pars []interface{}, orderBy string
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
// 数量汇总
|
|
|
totalSql := ` SELECT count(1) FROM edb_info e LEFT JOIN (
|
|
|
-SELECT count(edb_info_id) as relation_num, edb_info_id, max(relation_time) as relation_time FROM edb_info_relation GROUP BY edb_info_id) r on e.edb_info_id=r.edb_info_id WHERE e.source in (2,34) `
|
|
|
+SELECT count(edb_info_id) as relation_num, edb_info_id, max(relation_time) as relation_time FROM edb_info_relation GROUP BY edb_info_id) r on e.edb_info_id=r.edb_info_id WHERE 1=1 `
|
|
|
if condition != "" {
|
|
|
totalSql += condition
|
|
|
}
|
|
@@ -276,7 +276,7 @@ SELECT count(edb_info_id) as relation_num, edb_info_id, max(relation_time) as re
|
|
|
|
|
|
// 列表数据
|
|
|
sql := ` SELECT e.edb_info_id, e.classify_id,e.edb_code,e.edb_name,e.sys_user_id,e.sys_user_real_name,e.frequency,e.no_update as is_stop, r.relation_num, r.relation_time from edb_info e LEFT JOIN (
|
|
|
-SELECT count(edb_info_id) as relation_num, edb_info_id, max(relation_time) as relation_time FROM edb_info_relation GROUP BY edb_info_id) r on e.edb_info_id=r.edb_info_id WHERE e.source in (2,34)
|
|
|
+SELECT count(edb_info_id) as relation_num, edb_info_id, max(relation_time) as relation_time FROM edb_info_relation GROUP BY edb_info_id) r on e.edb_info_id=r.edb_info_id WHERE 1=1
|
|
|
`
|
|
|
if condition != "" {
|
|
|
sql += condition
|