Stringsql="select unid,person_unid,channel_serialnum,body_pic,countdate,counttime,direction,gate_id from d_face_recognition where countdate=? and mall_id=?";
//不需要横穿数据
if(needOutSide==0){
returnjdbcTemplate.query("select unid,person_unid,channel_serialnum,body_pic,countdate,counttime,direction,gate_id from d_face_recognition where countdate=? and mall_id=? and direction != 0",newBeanPropertyRowMapper<>(FaceRecognition.class),date,mallId);
}else{
returnjdbcTemplate.query("select unid,person_unid,channel_serialnum,body_pic,countdate,counttime,direction,gate_id from d_face_recognition where countdate=? and mall_id=?",newBeanPropertyRowMapper<>(FaceRecognition.class),date,mallId);
sql=sql+" and direction != 0";
}
if(StringUtils.isNotBlank(deviceSerialNum)){
String[]devices=deviceSerialNum.split(",");
StringBuildersb=newStringBuilder();
for(Stringdevice:devices){
if(sb.length()>0){
sb.append(",");
}
sb.append("'");
sb.append(device);
sb.append("'");
}
sql=sql+" and device_serialnum in ("+sb.toString()+")";