瀏覽代碼

更新sql

fyz 9 月之前
父節點
當前提交
4497d0d1cd

+ 3 - 0
mjava-lanyun/src/main/java/com/malk/lanyun/schedule/ScheduleTask.java

@@ -50,6 +50,9 @@ public class ScheduleTask {
         log.info("定时方法执行时间 :" + new Date());
     }
 
+    /**
+     * 各项目经营分析每月1日上午4点自动插入数据库
+     */
     @Scheduled(cron = "0 0 4 1 * ?")
     void insertAnalysisList(){
         timerService.insertAnalysisList();

+ 2 - 2
mjava-lanyun/src/main/java/com/malk/lanyun/service/impl/TimerServiceImpl.java

@@ -372,8 +372,8 @@ public class TimerServiceImpl implements TimerService {
                     "  net_margin  " +
                     "FROM " +
                     " lanyun_project_analysis " +
-                    " WHERE " +
-                    " `month` = \""+month+"\"" ;
+                    " WHERE 1=1" +
+                    " AND `month` = \""+month+"\"" ;
         }
 //        Class.forName(driver);
 //        Connection connection = DriverManager.getConnection(url, username, password);