From 7f13f2cc11017e8ade1a0b648890ae79fe2a7738 Mon Sep 17 00:00:00 2001 From: "lisai17@sina.com" Date: Tue, 17 Nov 2020 16:06:26 +0800 Subject: [PATCH] . --- .../stat/invoice/InvoiceUseService.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/invoice/InvoiceUseService.java b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/invoice/InvoiceUseService.java index af1220a..82c302a 100644 --- a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/invoice/InvoiceUseService.java +++ b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/invoice/InvoiceUseService.java @@ -129,20 +129,24 @@ public class InvoiceUseService { List list = new ArrayList<>(); - if (invoice_type != null && invoice_type == 1) { + if (invoice_state != null) { list = Db.find(logsql + " order by t.create_time", paramlog.toArray()); } else { - if (invoice_type != null && invoice_type == 2) { - logsql += " and t.invoice_type = ? \n"; - ordsql += " and t.invoice_type = ? \n"; + if (invoice_type != null && invoice_type == 1) { + list = Db.find(logsql + " order by t.create_time", paramlog.toArray()); + } else { + if (invoice_type != null && invoice_type == 2) { + logsql += " and t.invoice_type = ? \n"; + ordsql += " and t.invoice_type = ? \n"; - paramlog.add(invoice_type); - paramord.add(invoice_type); + paramlog.add(invoice_type); + paramord.add(invoice_type); + } + + paramlog.addAll(paramord); + + list = Db.find("select * from (" + logsql + "\n union \n " + ordsql + ") a order by a.create_time ", paramlog.toArray()); } - - paramlog.addAll(paramord); - - list = Db.find("select * from (" + logsql + "\n union \n " + ordsql + ") a order by a.create_time ", paramlog.toArray()); } Record out = new Record();