nutz自定义sql查询

来源:互联网 发布:安卓慢镜头软件 编辑:程序博客网 时间:2024/05/22 03:41
Cnd cn1 = Cnd.NEW();        Cnd cn2 = Cnd.NEW();        if (i == temp - 1) {            if (special) {                break;            }        } else {            cutList = statistics.subList(flag * i, flag * (i + 1));            for (int j = 0; j < cutList.size(); j++) {                cn1 = Where.where(cn1, "IMEI1", "=", updateClientInfo.getIMEI()); // 查询手机唯一                Device device = dao.fetch(Device.class, cn1);                 cn2 = Where.where(cn2, "deviceId", "=",device.getId()); //查询手机id                 cn2 = Where.where(cn2, "packageName", "=",cutList.get(j).getPackageName()); //查询包名                DeviceApk deviceApk = dao.fetch(DeviceApk.class, cn2);                sql = Sqls.create(                        "select * from t_activating_quantity   where  q_createtime in (select max(q_createtime) from t_activating_quantity  $cnd )");                sql.setVar("cnd", Cnd.NEW().andEX("t_activating_quantity.q_apkId", "=", deviceApk.getId())                        .andEX("t_activating_quantity.q_deviceId", "=", device.getId()));                sql.setCallback(Sqls.callback.entities());                sql.setEntity(dao.getEntity(ActivatingQuantity.class));                dao.execute(sql);                List<ActivatingQuantity> fetch = sql.getList(ActivatingQuantity.class);
原创粉丝点击