数据库查询 in传入数组参数
public static void main(String[] args) {
String waybillNoSql = “select t.boxcode from TB_SELLEROUTINFO t where 1=1”;
String[] waybillNo =getParaValues(“waybillNo”);
if(waybillNo != null){
waybillNoSql += " and t.outno in(";
for (int i = 0; i <waybillNo.length-1; i++) {
waybillNoSql+="’"+waybillNo[i]+"’,";
}
waybillNoSql+="’"+waybillNo[waybillNo.length-1]+"’)";//去掉最后一个逗号
}
log.error("=拼接sql="+waybillNoSql);
List waybillNoList = TbSellerOutInfo.dao.find(waybillNoSql);
log.error("=根据拼接sql查询数据="+waybillNoList);
renderJson(waybillNoList);
}