进入------1
2017-11-29 11:26:40,726 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - INSERT INTO t_activating_quantity(q_apkId,q_deviceId,q_createtime,q_time) VALUES(?,?,?,?)
| 1 | 2 | 3 | 4 |
|---|-----|---------------------|---|
| 1 | 112 | 2017-11-29 10:57:32 | 1 |
For example:> "INSERT INTO t_activating_quantity(q_apkId,q_deviceId,q_createtime,q_time) VALUES(1,112,'2017-11-29 10:57:32',1) "
进入------39
-----------新增成功
2017-11-29 11:26:40,766 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - INSERT INTO t_activating_quantity(q_apkId,q_deviceId,q_createtime,q_time) VALUES(?,?,?,?)
| 1 | 2 | 3 | 4 |
|----|-----|---------------------|---|
| 39 | 112 | 2017-11-29 10:57:32 | 1 |
For example:> "INSERT INTO t_activating_quantity(q_apkId,q_deviceId,q_createtime,q_time) VALUES(39,112,'2017-11-29 10:57:32',1) "
进入------1
-----------新增成功
2017-11-29 11:26:40,879 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - INSERT INTO t_activating_quantity(q_apkId,q_deviceId,q_createtime,q_time) VALUES(?,?,?,?)
| 1 | 2 | 3 | 4 |
|---|-----|---------------------|---|
| 1 | 112 | 2017-11-29 10:57:30 | 1 |
For example:> "INSERT INTO t_activating_quantity(q_apkId,q_deviceId,q_createtime,q_time) VALUES(1,112,'2017-11-29 10:57:30',1) "
进入------39
-----------新增成功
2017-11-29 11:26:40,916 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - INSERT INTO t_activating_quantity(q_apkId,q_deviceId,q_createtime,q_time) VALUES(?,?,?,?)
| 1 | 2 | 3 | 4 |
|----|-----|---------------------|---|
| 39 | 112 | 2017-11-29 10:57:30 | 1 |
For example:> "INSERT INTO t_activating_quantity(q_apkId,q_deviceId,q_createtime,q_time) VALUES(39,112,'2017-11-29 10:57:30',1) "
-----------新增成功
if (fetch.isEmpty()) {
for (Statistics statistics2 : statistics) {
for (PreinstallApk preinstallApk : preinstallApks) {
for (Device dev : device) {
if (statistics2.getDate_Time().getTime() > preinstallApk.getUploadDateTime().getTime()) {
if (num <= 4) {
System.err.println("进入------" + preinstallApk.getId());
Quantity.setApkId(preinstallApk.getId()); // APK ID
Quantity.setDeviceId(dev.getId()); // 手机 ID
Quantity.setCreatetime(sdf.format(statistics2.getDate_Time())); // 更新时间
Quantity.setTime(num); // 次数
Quantity = dao.insert(Quantity); // 插入数据
System.out.println("-----------新增成功");
}
}
}
}
}
正确这样日志
```
进入------1
2017-11-29 11:26:40,726 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - INSERT INTO t_activating_quantity(q_apkId,q_deviceId,q_createtime,q_time) VALUES(?,?,?,?)
For example:> "INSERT INTO t_activating_quantity(q_apkId,q_deviceId,q_createtime,q_time) VALUES(1,112,'2017-11-29 10:57:32',1) "
进入------39
-----------新增成功
2017-11-29 11:26:40,916 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - INSERT INTO t_activating_quantity(q_apkId,q_deviceId,q_createtime,q_time) VALUES(?,?,?,?)
For example:> "INSERT INTO t_activating_quantity(q_apkId,q_deviceId,q_createtime,q_time) VALUES(39,112,'2017-11-29 10:57:30',1) "
-----------新增成功
这个有问题
"select * from t_activating_quantity where q_createtime in (select max(q_createtime) from t_activating_quantity $cnd )");
for (PreinstallApk preinstallApk : preinstallApks) {
cnd.or("q_apkId", "=", preinstallApk.getId());
System.err.println("=---1" + cnd.or("q_apkId", "=", preinstallApk.getId()));
}
for (Device devices : device) {
cnd.or("q_deviceId", "=", devices.getId());
System.err.println("=---" + cnd.or("q_deviceId", "=", devices.getId()));
}
日志
=---1 WHERE q_apkId=1 OR q_apkId=1
=---1 WHERE q_apkId=1 OR q_apkId=1 OR q_apkId=39 OR q_apkId=39
=--- WHERE q_apkId=1 OR q_apkId=1 OR q_apkId=39 OR q_apkId=39 OR q_deviceId=112 OR q_deviceId=112