Browse Source

部分代码精简

wangb@gyee-china.com 1 year ago
parent
commit
3ee5e022da

+ 14 - 355
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconTargetdataServiceImpl.java

@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 
@@ -26,364 +27,22 @@ public class ProEconTargetdataServiceImpl extends ServiceImpl<ProEconTargetdataM
 private IProEconTargetdataService proEconTargetdataService;
     @Override
     public List<ProEconTargetdata> qwtlist() {
-        List<ProEconTargetdata> qwt = new ArrayList<>();;
-        Date current = com.gyee.common.util.DateUtils.getCurrentDate();
-        QueryWrapper<ProEconTargetdata> qw1 = new QueryWrapper<>();
-        qw1.like("windpowerstation_id", "MLJ_FDC");
-        qw1.ge("record_date",current);
-        qw1.orderByDesc("operation_time");
-        qw1.last("LIMIT 1");
-        List<ProEconTargetdata> qwt1 = proEconTargetdataService.list(qw1);
-        if (qwt1 != null) {
-            qwt.addAll(qwt1);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw2 = new QueryWrapper<>();
-        qw2.like("windpowerstation_id", "GJY_FDC");
-        qw2.ge("record_date",current);
-        qw2.orderByDesc("operation_time");
-        qw2.last("LIMIT 1");
-        List<ProEconTargetdata> qwt2 = proEconTargetdataService.list(qw2);
-        if (qwt2 != null) {
-            qwt.addAll(qwt2);
-        }
-
-
-        QueryWrapper<ProEconTargetdata> qw3 = new QueryWrapper<>();
-        qw3.like("windpowerstation_id", "QYRG_GDC");
-        qw3.ge("record_date",current);
-        qw3.orderByDesc("operation_time");
-        qw3.last("LIMIT 1");
-        List<ProEconTargetdata> qwt3 = proEconTargetdataService.list(qw3);
-        if (qwt3 != null) {
-            qwt.addAll(qwt3);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw4 = new QueryWrapper<>();
-        qw4.like("windpowerstation_id", "CZXY_GDC");
-        qw4.ge("record_date",current);
-        qw4.orderByDesc("operation_time");
-        qw4.last("LIMIT 1");
-        List<ProEconTargetdata> qwt4 = proEconTargetdataService.list(qw4);
-        if (qwt4 != null) {
-            qwt.addAll(qwt4);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw5 = new QueryWrapper<>();
-        qw5.like("windpowerstation_id", "YQCX");
-        qw5.ge("record_date",current);
-        qw5.orderByDesc("operation_time");
-        qw5.last("LIMIT 1");
-        List<ProEconTargetdata> qwt5 = proEconTargetdataService.list(qw5);
-        if (qwt5 != null) {
-            qwt.addAll(qwt5);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw6 = new QueryWrapper<>();
-        qw6.like("windpowerstation_id", "HJFA_GDC");
-        qw6.ge("record_date",current);
-        qw6.orderByDesc("operation_time");
-        qw6.last("LIMIT 1");
-        List<ProEconTargetdata> qwt6 = proEconTargetdataService.list(qw6);
-        if (qwt6 != null) {
-            qwt.addAll(qwt6);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw7 = new QueryWrapper<>();
-        qw7.like("windpowerstation_id", "WXYX_GDC");
-        qw7.ge("record_date",current);
-        qw7.orderByDesc("operation_time");
-        qw7.last("LIMIT 1");
-        List<ProEconTargetdata> qwt7 = proEconTargetdataService.list(qw7);
-        if (qwt7 != null) {
-            qwt.addAll(qwt7);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw8 = new QueryWrapper<>();
-        qw8.like("windpowerstation_id", "WXYL_GDC");
-        qw8.ge("record_date",current);
-        qw8.orderByDesc("operation_time");
-        qw8.last("LIMIT 1");
-        List<ProEconTargetdata> qwt8 = proEconTargetdataService.list(qw8);
-        if (qwt8 != null) {
-            qwt.addAll(qwt8);
-        }
 
-        QueryWrapper<ProEconTargetdata> qw9 = new QueryWrapper<>();
-        qw9.like("windpowerstation_id", "PSSX_GDC");
-        qw9.ge("record_date",current);
-        qw9.orderByDesc("operation_time");
-        qw9.last("LIMIT 1");
-        List<ProEconTargetdata> qwt9 = proEconTargetdataService.list(qw9);
-        if (qwt9 != null) {
-            qwt.addAll(qwt9);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw10 = new QueryWrapper<>();
-        qw10.like("windpowerstation_id", "HGFD_GDC");
-        qw10.ge("record_date",current);
-        qw10.orderByDesc("operation_time");
-        qw10.last("LIMIT 1");
-        List<ProEconTargetdata> qwt10 = proEconTargetdataService.list(qw10);
-        if (qwt10 != null) {
-            qwt.addAll(qwt10);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw11 = new QueryWrapper<>();
-        qw11.like("windpowerstation_id", "YX_GDC");
-        qw11.ge("record_date",current);
-        qw11.orderByDesc("operation_time");
-        qw11.last("LIMIT 1");
-        List<ProEconTargetdata> qwt11 = proEconTargetdataService.list(qw11);
-        if (qwt11 != null) {
-            qwt.addAll(qwt11);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw12 = new QueryWrapper<>();
-        qw12.like("windpowerstation_id", "JK_GDC");
-        qw12.ge("record_date",current);
-        qw12.orderByDesc("operation_time");
-        qw12.last("LIMIT 1");
-        List<ProEconTargetdata> qwt12 = proEconTargetdataService.list(qw12);
-        if (qwt12 != null) {
-            qwt.addAll(qwt12);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw13 = new QueryWrapper<>();
-        qw13.like("windpowerstation_id", "TZ_GDC");
-        qw13.ge("record_date",current);
-        qw13.orderByDesc("operation_time");
-        qw13.last("LIMIT 1");
-        List<ProEconTargetdata> qwt13= proEconTargetdataService.list(qw13);
-        if (qwt13 != null) {
-            qwt.addAll(qwt13);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw14 = new QueryWrapper<>();
-        qw14.like("windpowerstation_id", "YQ_GDC");
-        qw14.ge("record_date",current);
-        qw14.orderByDesc("operation_time");
-        qw14.last("LIMIT 1");
-        List<ProEconTargetdata> qwt14 = proEconTargetdataService.list(qw14);
-        if (qwt14 != null) {
-            qwt.addAll(qwt14);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw15 = new QueryWrapper<>();
-        qw15.like("windpowerstation_id", "YLZ_GDC");
-        qw15.ge("record_date",current);
-        qw15.orderByDesc("operation_time");
-        qw15.last("LIMIT 1");
-        List<ProEconTargetdata> qwt15 = proEconTargetdataService.list(qw15);
-        if (qwt15 != null) {
-            qwt.addAll(qwt15);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw16 = new QueryWrapper<>();
-        qw16.like("windpowerstation_id", "LHS_GDC");
-        qw16.ge("record_date",current);
-        qw16.orderByDesc("operation_time");
-        qw16.last("LIMIT 1");
-        List<ProEconTargetdata> qwt16 = proEconTargetdataService.list(qw16);
-        if (qwt16 != null) {
-            qwt.addAll(qwt16);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw17 = new QueryWrapper<>();
-        qw17.like("windpowerstation_id", "FS_GDC");
-        qw17.ge("record_date",current);
-        qw17.orderByDesc("operation_time");
-        qw17.last("LIMIT 1");
-        List<ProEconTargetdata> qwt17 = proEconTargetdataService.list(qw17);
-        if (qwt17 != null) {
-            qwt.addAll(qwt17);
-        }
+        List<String> windpowerstationIds = Arrays.asList("MLJ_FDC", "GJY_FDC", "QYRG_GDC", "CZXY_GDC", "YQCX", "HJFA_GDC", "WXYX_GDC", "WXYL_GDC", "PSSX_GDC", "HGFD_GDC", "YX_GDC", "JK_GDC", "TZ_GDC", "YQ_GDC", "YLZ_GDC", "LHS_GDC", "FS_GDC", "ZK_FDC", "SY_GDC", "BHB_FDC", "HSM_FDC", "YTY_FDC", "BHB3_FDC", "JR_GDC", "PDL_FDC", "NJL_FDC", "YLZ_FDC", "YF_FDC", "PTZ_FDC", "XWT_FDC", "DJY_FDC", "HR_GDC", "YY_GDC", "PL_GDC", "TL_GDC", "YG_GDC");
 
-        QueryWrapper<ProEconTargetdata> qw18 = new QueryWrapper<>();
-        qw18.like("windpowerstation_id", "ZK_FDC");
-        qw18.ge("record_date",current);
-        qw18.orderByDesc("operation_time");
-        qw18.last("LIMIT 1");
-        List<ProEconTargetdata> qwt18 = proEconTargetdataService.list(qw18);
-        if (qwt18 != null) {
-            qwt.addAll(qwt18);
-        }
-
-
-        QueryWrapper<ProEconTargetdata> qw19 = new QueryWrapper<>();
-        qw19.like("windpowerstation_id", "SY_GDC");
-        qw19.ge("record_date",current);
-        qw19.orderByDesc("operation_time");
-        qw19.last("LIMIT 1");
-        List<ProEconTargetdata> qwt19 = proEconTargetdataService.list(qw19);
-        if (qwt19 != null) {
-            qwt.addAll(qwt19);
-        }
-
-
-        QueryWrapper<ProEconTargetdata> qw20 = new QueryWrapper<>();
-        qw20.like("windpowerstation_id", "BHB_FDC");
-        qw20.ge("record_date",current);
-        qw20.orderByDesc("operation_time");
-        qw20.last("LIMIT 1");
-        List<ProEconTargetdata> qwt20 = proEconTargetdataService.list(qw20);
-        if (qwt20 != null) {
-            qwt.addAll(qwt20);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw21 = new QueryWrapper<>();
-        qw21.like("windpowerstation_id", "HSM_FDC");
-        qw21.ge("record_date",current);
-        qw21.orderByDesc("operation_time");
-        qw21.last("LIMIT 1");
-        List<ProEconTargetdata> qwt21 = proEconTargetdataService.list(qw21);
-        if (qwt21 != null) {
-            qwt.addAll(qwt21);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw22 = new QueryWrapper<>();
-        qw22.like("windpowerstation_id", "YTY_FDC");
-        qw22.ge("record_date",current);
-        qw22.orderByDesc("operation_time");
-        qw22.last("LIMIT 1");
-        List<ProEconTargetdata> qwt22 = proEconTargetdataService.list(qw22);
-        if (qwt22 != null) {
-            qwt.addAll(qwt22);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw23 = new QueryWrapper<>();
-        qw23.like("windpowerstation_id", "BHB3_FDC");
-        qw23.ge("record_date",current);
-        qw23.orderByDesc("operation_time");
-        qw23.last("LIMIT 1");
-        List<ProEconTargetdata> qwt23 = proEconTargetdataService.list(qw23);
-        if (qwt23 != null) {
-            qwt.addAll(qwt23);
-        }
-        QueryWrapper<ProEconTargetdata> qw24 = new QueryWrapper<>();
-        qw24.like("windpowerstation_id", "JR_GDC");
-        qw24.ge("record_date",current);
-        qw24.orderByDesc("operation_time");
-        qw24.last("LIMIT 1");
-        List<ProEconTargetdata> qwt24 = proEconTargetdataService.list(qw24);
-        if (qwt24 != null) {
-            qwt.addAll(qwt24);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw25 = new QueryWrapper<>();
-        qw25.like("windpowerstation_id", "PDL_FDC");
-        qw25.ge("record_date",current);
-        qw25.orderByDesc("operation_time");
-        qw25.last("LIMIT 1");
-        List<ProEconTargetdata> qwt25 = proEconTargetdataService.list(qw25);
-        if (qwt25 != null) {
-            qwt.addAll(qwt25);
-        }
-        QueryWrapper<ProEconTargetdata> qw26 = new QueryWrapper<>();
-        qw26.like("windpowerstation_id", "NJL_FDC");
-        qw26.ge("record_date",current);
-        qw26.orderByDesc("operation_time");
-        qw26.last("LIMIT 1");
-        List<ProEconTargetdata> qwt26 = proEconTargetdataService.list(qw26);
-        if (qwt26 != null) {
-            qwt.addAll(qwt26);
-        }
-        QueryWrapper<ProEconTargetdata> qw27 = new QueryWrapper<>();
-        qw27.like("windpowerstation_id", "YLZ_FDC");
-        qw27.ge("record_date",current);
-        qw27.orderByDesc("operation_time");
-        qw27.last("LIMIT 1");
-        List<ProEconTargetdata> qwt27 = proEconTargetdataService.list(qw27);
-        if (qwt27 != null) {
-            qwt.addAll(qwt27);
-        }
-        QueryWrapper<ProEconTargetdata> qw28 = new QueryWrapper<>();
-        qw28.like("windpowerstation_id", "YF_FDC");
-        qw28.ge("record_date",current);
-        qw28.orderByDesc("operation_time");
-        qw28.last("LIMIT 1");
-        List<ProEconTargetdata> qwt28 = proEconTargetdataService.list(qw28);
-        if (qwt28 != null) {
-            qwt.addAll(qwt28);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw29 = new QueryWrapper<>();
-        qw29.like("windpowerstation_id", "PTZ_FDC");
-        qw29.ge("record_date",current);
-        qw29.orderByDesc("operation_time");
-        qw29.last("LIMIT 1");
-        List<ProEconTargetdata> qwt29 = proEconTargetdataService.list(qw29);
-        if (qwt29 != null) {
-            qwt.addAll(qwt29);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw30 = new QueryWrapper<>();
-        qw30.like("windpowerstation_id", "XWT_FDC");
-        qw30.ge("record_date",current);
-        qw30.orderByDesc("operation_time");
-        qw30.last("LIMIT 1");
-        List<ProEconTargetdata> qwt30 = proEconTargetdataService.list(qw30);
-        if (qwt30 != null) {
-            qwt.addAll(qwt30);
-        }
-        QueryWrapper<ProEconTargetdata> qw31 = new QueryWrapper<>();
-        qw31.like("windpowerstation_id", "DJY_FDC");
-        qw31.ge("record_date",current);
-        qw31.orderByDesc("operation_time");
-        qw31.last("LIMIT 1");
-        List<ProEconTargetdata> qwt31 = proEconTargetdataService.list(qw31);
-        if (qwt31 != null) {
-            qwt.addAll(qwt31);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw32 = new QueryWrapper<>();
-        qw32.like("windpowerstation_id", "HR_GDC");
-        qw32.ge("record_date",current);
-        qw32.orderByDesc("operation_time");
-        qw32.last("LIMIT 1");
-        List<ProEconTargetdata> qwt32 = proEconTargetdataService.list(qw32);
-        if (qwt32 != null) {
-            qwt.addAll(qwt32);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw33 = new QueryWrapper<>();
-        qw33.like("windpowerstation_id", "YY_GDC");
-        qw33.ge("record_date",current);
-        qw33.orderByDesc("operation_time");
-        qw33.last("LIMIT 1");
-        List<ProEconTargetdata> qwt33 = proEconTargetdataService.list(qw33);
-        if (qwt33 != null) {
-            qwt.addAll(qwt33);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw34 = new QueryWrapper<>();
-        qw34.like("windpowerstation_id", "PL_GDC");
-        qw34.ge("record_date",current);
-        qw34.orderByDesc("operation_time");
-        qw34.last("LIMIT 1");
-        List<ProEconTargetdata> qwt34 = proEconTargetdataService.list(qw34);
-        if (qwt34 != null) {
-            qwt.addAll(qwt34);
-        }
-
-        QueryWrapper<ProEconTargetdata> qw35 = new QueryWrapper<>();
-        qw35.like("windpowerstation_id", "TL_GDC");
-        qw35.ge("record_date",current);
-        qw35.orderByDesc("operation_time");
-        qw35.last("LIMIT 1");
-        List<ProEconTargetdata> qwt35 = proEconTargetdataService.list(qw35);
-        if (qwt35 != null) {
-            qwt.addAll(qwt35);
-        }
+        List<ProEconTargetdata> qwt = new ArrayList<>();
+        Date current = com.gyee.common.util.DateUtils.getCurrentDate();
 
-        QueryWrapper<ProEconTargetdata> qw36 = new QueryWrapper<>();
-        qw36.like("windpowerstation_id", "YG_GDC");
-        qw36.ge("record_date",current);
-        qw36.orderByDesc("operation_time");
-        qw36.last("LIMIT 1");
-        List<ProEconTargetdata> qwt36 = proEconTargetdataService.list(qw36);
-        if (qwt36 != null) {
-            qwt.addAll(qwt36);
+        for (String windpowerstationId : windpowerstationIds) {
+            QueryWrapper<ProEconTargetdata> qw = new QueryWrapper<>();
+            qw.like("windpowerstation_id", windpowerstationId);
+            qw.ge("record_date", current);
+            qw.orderByDesc("operation_time");
+            qw.last("LIMIT 1");
+            List<ProEconTargetdata> qwtList = proEconTargetdataService.list(qw);
+            if (qwtList != null) {
+                qwt.addAll(qwtList);
+            }
         }