python:
?task_group_id = ",".join(str(x) for x in task_group_id_list) 將list轉(zhuǎn)化為(1,2,3) 可用于sql
java:? list里是 str 的話 拼接的時候 把 ' ' 拼接上

StringBuilder port_id_lists =new StringBuilder();
for (int i=0; i
if (i==0){
port_id_lists.append("'").append(port_id_list[i]).append("'");
}else{
port_id_lists.append(",").append("'").append(port_id_list[i]).append("'");
}
}
"select * from table1 where id in?(%s)" % (task_group_id)