首页 > 数据库技术 > 详细

nutz sql

时间:2019-12-12 12:59:35      阅读:100      评论:0      收藏:0      [点我收藏+]
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); }

nutz sql

原文:https://www.cnblogs.com/notchangeworld/p/12028072.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!