nutz sql
Cnd cnd = Cnd.where("user_id", "=", userId)
.and("current_id", "=", currentLineId)
.and("device_id", "=", deviceId)
.and("status","=",1);
if (startTime != null && startTime.length()!=0) {
cnd = cnd.and("createTime", ">", simpleDateFormat.parse(startTime).getTime());
}
if (endTime != null && endTime.length()!=0) {
cnd = cnd.and("createTime", "<", simpleDateFormat.parse(endTime).getTime());
}
//二选一,就是传进来的是ip或者是src_ip
if (ipOrSrcIp != null && ipOrSrcIp.length()!=0) {
SqlExpressionGroup sqlExpressionGroup = new SqlExpressionGroup();
sqlExpressionGroup.or("src_ip", "like", "%" + ipOrSrcIp + "%")
.or("ip", "like", "%" + ipOrSrcIp + "%");
cnd.and(sqlExpressionGroup);
}
我不是来改变世界的

浙公网安备 33010602011771号