Преглед на файлове

订单行选择查询更新

hu преди 4 години
родител
ревизия
d6118cb654

+ 13 - 5
src/rest/openapi/restcontroller/wechatapp/tinvoiceapply/Tinvoiceapply.java

@@ -233,14 +233,22 @@ public class Tinvoiceapply extends Controller {
         String fbegdate = content.getString("fbegdate");
         String fenddate = content.getString("fenddate");
         String fprojectname = content.getString("fprojectname");
-
-        String wherestr1 = "sdate.closedate1 >='"+fbegdate+"' and sdate.closedate1 <='"+fenddate+"'";
-        String wherestr2 = "tp.fprojectname like '%"+fprojectname+"%'";
         SQLFactory factory = new SQLFactory(this, "¿ªÆ±¶©µ¥ÐÐÑ¡Ôñ²éѯ");
         factory.addParameter("siteid", siteid);
         factory.addParameter("fagentnum", fagentnum);
-        factory.addParameter_SQL("where1", wherestr1);
-        factory.addParameter_SQL("where2", wherestr2);
+        if(!"".equals(fbegdate)){
+            String wherestr1 = " and sdate.closedate1 >='"+fbegdate+"' and sdate.closedate1 <='"+fenddate+"'";
+            factory.addParameter_SQL("where1", wherestr1);
+        }else{
+            factory.addParameter_SQL("where1", "");
+        }
+        if(!"".equals(fbegdate)){
+            String wherestr2 = " and tp.fprojectname like '%"+fprojectname+"%'";
+            factory.addParameter_SQL("where2", wherestr2);
+        }else{
+            factory.addParameter_SQL("where2", "");
+        }
+
         //factory.addParameter("finvoicetaxnumber", finvoicetaxnumber);
         factory.addParameter("tinvoiceapplyid", tinvoiceapplyid);
         System.out.println("factory.getSQL()==="+factory.getSQL());

+ 13 - 5
src/rest/openapi/restcontroller/wechatapp/tinvoiceapply/Tinvoiceapply_saler.java

@@ -264,14 +264,22 @@ public class Tinvoiceapply_saler extends Controller {
         String fbegdate = content.getString("fbegdate");
         String fenddate = content.getString("fenddate");
         String fprojectname = content.getString("fprojectname");
-
-        String wherestr1 = "sdate.closedate1 >='"+fbegdate+"' and sdate.closedate1 <='"+fenddate+"'";
-        String wherestr2 = "tp.fprojectname like '%"+fprojectname+"%'";
         SQLFactory factory = new SQLFactory(this, "¿ªÆ±¶©µ¥ÐÐÑ¡Ôñ²éѯ");
         factory.addParameter("siteid", siteid);
         factory.addParameter("fagentnum", fagentnum);
-        factory.addParameter_SQL("where1", wherestr1);
-        factory.addParameter_SQL("where2", wherestr2);
+        if(!"".equals(fbegdate)){
+            String wherestr1 = " and sdate.closedate1 >='"+fbegdate+"' and sdate.closedate1 <='"+fenddate+"'";
+            factory.addParameter_SQL("where1", wherestr1);
+        }else{
+            factory.addParameter_SQL("where1", "");
+        }
+        if(!"".equals(fbegdate)){
+            String wherestr2 = " and tp.fprojectname like '%"+fprojectname+"%'";
+            factory.addParameter_SQL("where2", wherestr2);
+        }else{
+            factory.addParameter_SQL("where2", "");
+        }
+
         //factory.addParameter("finvoicetaxnumber", finvoicetaxnumber);
         factory.addParameter("tinvoiceapplyid", tinvoiceapplyid);
         System.out.println("factory.getSQL()==="+factory.getSQL());