作者 yangfu

索引优化

@@ -157,10 +157,10 @@ func (dao *DividendsEstimateDao) CountDividendsEstimateDividendsAmount(queryOpti @@ -157,10 +157,10 @@ func (dao *DividendsEstimateDao) CountDividendsEstimateDividendsAmount(queryOpti
157 query := tx.Model(&dividendsEstimateModels) 157 query := tx.Model(&dividendsEstimateModels)
158 query.ColumnExpr("sum(dividends_amount) amount") 158 query.ColumnExpr("sum(dividends_amount) amount")
159 if companyId, ok := queryOptions["companyId"]; ok && companyId.(int64) != 0 { 159 if companyId, ok := queryOptions["companyId"]; ok && companyId.(int64) != 0 {
160 - query = query.Where(`dividends_estimate.company @> '{"companyId":"?"}'`, companyId) 160 + query = query.Where(`dividends_estimate.company->>'companyId'='?'`, companyId)
161 } 161 }
162 if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { 162 if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 {
163 - query = query.Where(`dividends_estimate.org @> '{"orgId":"?"}'`, orgId) 163 + query = query.Where(`dividends_estimate.org->>'orgId'='?'`, orgId)
164 } 164 }
165 if userBaseId, ok := queryOptions["userBaseId"]; ok && userBaseId.(int64) != 0 { 165 if userBaseId, ok := queryOptions["userBaseId"]; ok && userBaseId.(int64) != 0 {
166 query = query.Where(`dividends_user->>'userBaseId'='?'`, userBaseId) 166 query = query.Where(`dividends_user->>'userBaseId'='?'`, userBaseId)