lisai17@sina.com 2020-12-28 22:58:18 +08:00
parent 97ba46f3ab
commit e11cb40d75
1 changed files with 36 additions and 18 deletions

View File

@ -123,14 +123,6 @@ public class InvoiceUseService {
} }
} }
if (order_state != null) {
logsql += " and o.state = ? \n";
ordsql += " and t.state = ? \n";
paramlog.add(order_state);
paramord.add(order_state);
}
if (invoice_type != null) { if (invoice_type != null) {
logsql += " and t.invoice_type = ? \n"; logsql += " and t.invoice_type = ? \n";
ordsql += " and t.invoice_type = ? \n"; ordsql += " and t.invoice_type = ? \n";
@ -141,6 +133,18 @@ public class InvoiceUseService {
List<Record> list = new ArrayList<>(); List<Record> list = new ArrayList<>();
if (order_state != null) {
if (order_state == 9) {
logsql += " and o.state = ? \n";
paramlog.add(order_state);
list = Db.find(logsql + " order by t.create_time", paramlog.toArray());
} else {
logsql += " and o.state = ? \n";
ordsql += " and t.state = ? \n";
paramlog.add(order_state);
paramord.add(order_state);
if (invoice_state != null) { if (invoice_state != null) {
if (invoice_state == 9) { if (invoice_state == 9) {
list = Db.find(logsql + " order by t.create_time", paramlog.toArray()); list = Db.find(logsql + " order by t.create_time", paramlog.toArray());
@ -152,6 +156,20 @@ public class InvoiceUseService {
list = Db.find("select * from (" + logsql + "\n union \n " + ordsql + ") a order by a.create_time ", paramlog.toArray()); list = Db.find("select * from (" + logsql + "\n union \n " + ordsql + ") a order by a.create_time ", paramlog.toArray());
} }
}
}else {
if (invoice_state != null) {
if (invoice_state == 9) {
list = Db.find(logsql + " order by t.create_time", paramlog.toArray());
} else if (invoice_state == 5) {
list = Db.find(ordsql + " order by t.create_time", paramord.toArray());
}
} else {
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(); Record out = new Record();
out.set("list", list); out.set("list", list);