Commit 826b7233 826b7233cb8380d512032308a238d410a31cf9c1 by lWoHvYe

自动上线筛选逻辑调整

1 parent 160db00a
...@@ -28,7 +28,11 @@ public class AutoOnlineProcessor { ...@@ -28,7 +28,11 @@ public class AutoOnlineProcessor {
28 try { 28 try {
29 connection = dbUtil.getConnection(); 29 connection = dbUtil.getConnection();
30 // 查询未绑定 30 // 查询未绑定
31 String sql = StrUtil.format(" update `x_media` set `status` = '001',`update_time` = '{}' where `status` = '000' and file_status = '001' and (update_time - create_time) < {} and create_time >= ? ", DateUtil.now(), DIFFERENCE); 31 String sql = StrUtil.format(" update `x_media` set `status` = '001',`update_time` = '{}' " +
32 "where id in ( select a.id from " +
33 "(select xm.id from `x_media` xm LEFT JOIN x_content_status_change xcsc on xm.id = xcsc.content_id and xcsc.content_class = 'media' " +
34 "where xm.`status` = '000' and xm.file_status = '001' and xm.create_time >= ? and xcsc.id is null " +
35 ") as a ) ", DateUtil.now());
32 dbUtil.doExecute(connection, sql, today); 36 dbUtil.doExecute(connection, sql, today);
33 // 提交事务 37 // 提交事务
34 dbUtil.commitTransaction(connection); 38 dbUtil.commitTransaction(connection);
......