作者 tangxvhui

修复sql 错误

... ... @@ -187,7 +187,7 @@ func (d *TaskDao) CountTaskStageNotHrbp(param ListTaskCondition) (int, error) {
}
if param.SearchWord != "" {
condition = append(condition, param.SearchWord, param.SearchWord)
whereSql += ` and (t_task_tage_1.leader_name like ? or t_task_tage_1.task_alias_name like ?)`
whereSql += ` and (task.leader->>'name' like ? or task.alias like ?)`
}
sqlStr := withSql + whereSql
... ... @@ -301,7 +301,7 @@ func (d *TaskDao) CountTaskStageByHrbp(param ListTaskCondition) (int, error) {
}
if param.SearchWord != "" {
condition = append(condition, param.SearchWord, param.SearchWord)
whereSql += ` and (t_task_tage_1.leader_name like ? or t_task_tage_1.task_alias_name like ?)`
whereSql += ` and (task.leader->>'name' like ? or task.alias like ?)`
}
sqlStr := withSql + whereSql
tx := d.transactionContext.PgTx
... ... @@ -331,7 +331,7 @@ func (d *TaskDao) CountTaskStageAnomalyNotHrbp(param ListTaskCondition) (int, er
}
if param.SearchWord != "" {
condition = append(condition, param.SearchWord, param.SearchWord)
whereSql += ` and (t_task_tage_1.leader_name like ? or t_task_tage_1.task_alias_name like ?)`
whereSql += ` and (task.leader->>'name' like ? or task.alias like ?)`
}
sqlStr := withSql + whereSql
tx := d.transactionContext.PgTx
... ... @@ -363,7 +363,7 @@ func (d *TaskDao) CountTaskStageAnomalyByHrbp(param ListTaskCondition) (int, err
}
if param.SearchWord != "" {
condition = append(condition, param.SearchWord, param.SearchWord)
whereSql += ` and (t_task_tage_1.leader_name like ? or t_task_tage_1.task_alias_name like ?)`
whereSql += ` and (task.leader->>'name' like ? or task.alias like ?)`
}
sqlStr := withSql + whereSql
... ... @@ -413,7 +413,7 @@ func (d *TaskDao) TaskAnomaly(leaderId []string, anomaly int) ([]TaskStageData,
task.leader ->>'name' as leader_name,
task.anomaly
from task
where task.anomaly >=? and task.leader ->'id' in(?) `
where task.anomaly >=? and task.leader ->>'id' in(?) `
result := []TaskStageData{}
tx := d.transactionContext.PgTx
_, err := tx.Query(&result, sqlStr, anomaly, pg.In(leaderId))
... ... @@ -436,7 +436,7 @@ func (d *TaskDao) CountTaskAnomalyNotHrbp(param ListTaskCondition) (int, error)
}
if param.SearchWord != "" {
condition = append(condition, param.SearchWord, param.SearchWord)
whereSql += ` and (t_task_tage_1.leader_name like ? or t_task_tage_1.task_alias_name like ?)`
whereSql += ` and (task.leader->>'name' like ? or task.alias like ?)`
}
sqlStr := withSql + whereSql
tx := d.transactionContext.PgTx
... ... @@ -462,7 +462,7 @@ func (d *TaskDao) CountTaskAnomalyByHrbp(param ListTaskCondition) (int, error) {
}
if param.SearchWord != "" {
condition = append(condition, param.SearchWord, param.SearchWord)
whereSql += ` and (t_task_tage_1.leader_name like ? or t_task_tage_1.task_alias_name like ?)`
whereSql += ` and (task.leader->>'name' like ? or task.alias like ?)`
}
sqlStr := withSql + whereSql
tx := d.transactionContext.PgTx
... ...