You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
query:=fmt.Sprintf("SELECT fi.id,fi.record_id,fi.flow_id,fi.status,fi.launcher,fi.launch_time,f.code 'flow_code',f.name 'flow_name' FROM %s fi LEFT JOIN %s f ON fi.flow_id=f.record_id AND f.deleted=0 WHERE fi.deleted=0 AND fi.status = 1", schema.FlowInstanceTableName, schema.FlowTableName)
1091
+
//最后的更改
1092
+
ifParamSearchList!=nil&&len(ParamSearchList) >0 {
1093
+
tmpSql:=``
1094
+
fori, v:=rangeParamSearchList {
1095
+
ifi=="page"{
1096
+
continue
1097
+
}
1098
+
tmpSql+=` AND input_data->'$.`+i+`' = '`+v+`'`
1099
+
}
1100
+
query=fmt.Sprintf("%s AND fi.record_id IN(SELECT flow_instance_id FROM %s WHERE deleted=0 AND status=1 %s AND record_id IN(SELECT node_instance_id FROM %s WHERE deleted=0 AND candidate_id=?))", query, schema.NodeInstanceTableName, tmpSql,schema.NodeCandidateTableName)
1101
+
}else{
1102
+
query=fmt.Sprintf("%s AND fi.record_id IN(SELECT flow_instance_id FROM %s WHERE deleted=0 AND status=1 AND record_id IN(SELECT node_instance_id FROM %s WHERE deleted=0 AND candidate_id=?))", query, schema.NodeInstanceTableName, schema.NodeCandidateTableName)
1103
+
}
1104
+
args=append(args, userID)
1105
+
1106
+
iftypeCode!="" {
1107
+
query=fmt.Sprintf("%s AND f.type_code IN(?)", query)
1108
+
args=append(args, strings.Split(typeCode, ","))
1109
+
} elseifflowCode!="" {
1110
+
query=fmt.Sprintf("%s AND f.code=?", query)
1111
+
args=append(args, flowCode)
1112
+
}
1113
+
1114
+
1115
+
ifv,ok:=ParamSearchList["page"];ok {
1116
+
ifv!="" {
1117
+
page ,_:=strconv.Atoi(v)
1118
+
query=fmt.Sprintf("%s ORDER BY fi.id DESC LIMIT %d offset %d", query, count,(page-1 )*count)
query:=fmt.Sprintf("SELECT fi.id,fi.record_id,fi.flow_id,fi.status,fi.launcher,fi.launch_time,f.code 'flow_code',f.name 'flow_name' FROM %s fi LEFT JOIN %s f ON fi.flow_id=f.record_id AND f.deleted=0 WHERE fi.deleted=0", schema.FlowInstanceTableName, schema.FlowTableName)
1141
+
query=fmt.Sprintf("%s AND fi.launcher!=?", query)
1142
+
args=append(args, processor)
1143
+
ifParamSearchList!=nil&&len(ParamSearchList) >0 {
1144
+
tmpSql:=``
1145
+
fori, v:=rangeParamSearchList {
1146
+
ifi=="page"{
1147
+
continue
1148
+
}
1149
+
tmpSql+=` AND input_data->'$.`+i+`' = '`+v+`'`
1150
+
}
1151
+
query=fmt.Sprintf("%s AND fi.record_id IN(SELECT flow_instance_id FROM %s WHERE deleted=0 AND status=2 %s AND processor=?)", query, schema.NodeInstanceTableName,tmpSql)
1152
+
}else {
1153
+
query=fmt.Sprintf("%s AND fi.record_id IN(SELECT flow_instance_id FROM %s WHERE deleted=0 AND status=2 AND processor=?)", query, schema.NodeInstanceTableName)
1154
+
1155
+
}
1156
+
args=append(args, processor)
1157
+
1158
+
iftypeCode!="" {
1159
+
query=fmt.Sprintf("%s AND f.type_code IN(?)", query)
0 commit comments