|
@@ -94,13 +94,12 @@ public class TurnoverServiceImpl implements TurnoverService {
|
|
|
@Override
|
|
@Override
|
|
|
public List<Turnover> findLastMonthOrderAmount() {
|
|
public List<Turnover> findLastMonthOrderAmount() {
|
|
|
String sql = "select a.xField,sum(a.yField) yField from\n" +
|
|
String sql = "select a.xField,sum(a.yField) yField from\n" +
|
|
|
- "(select pu_currency xField, round(sum(pd_amount)/10000 ,2) yField from purc$orderitems\n" +
|
|
|
|
|
|
|
+ "(select pu_currency xField, round(sum(pd_qty * pd_price)/10000 ,2) yField from purc$orderitems\n" +
|
|
|
"left join purc$orders on pd_puid=pu_id\n" +
|
|
"left join purc$orders on pd_puid=pu_id\n" +
|
|
|
"where date_format(pu_date,'%y-%m')=date_format(DATE_ADD(now(), INTERVAL -1 MONTH), '%y-%m')\n" +
|
|
"where date_format(pu_date,'%y-%m')=date_format(DATE_ADD(now(), INTERVAL -1 MONTH), '%y-%m')\n" +
|
|
|
"and pu_currency is not null group by pu_currency\n" +
|
|
"and pu_currency is not null group by pu_currency\n" +
|
|
|
"union\n" +
|
|
"union\n" +
|
|
|
- "select deo_currency xField, round(sum(dei_totalprice)/10000 ,2) yField from purc$deputyorderitems\n" +
|
|
|
|
|
- "left join purc$deputyorders on dei_deoid=deo_id\n" +
|
|
|
|
|
|
|
+ "select deo_currency xField, round(sum(deo_orderamount)/10000 ,2) yField from purc$deputyorders\n" +
|
|
|
"where date_format(deo_entrydate,'%y-%m') = date_format(DATE_ADD(now(), INTERVAL -1 MONTH), '%y-%m')\n" +
|
|
"where date_format(deo_entrydate,'%y-%m') = date_format(DATE_ADD(now(), INTERVAL -1 MONTH), '%y-%m')\n" +
|
|
|
"and deo_downloadstatus = '已下载' and deo_entrystatus='已提交' group by deo_currency) a\n" +
|
|
"and deo_downloadstatus = '已下载' and deo_entrystatus='已提交' group by deo_currency) a\n" +
|
|
|
"group by xField";
|
|
"group by xField";
|
|
@@ -127,13 +126,12 @@ public class TurnoverServiceImpl implements TurnoverService {
|
|
|
@Override
|
|
@Override
|
|
|
public List<Turnover> findThisMonthOrderAmount() {
|
|
public List<Turnover> findThisMonthOrderAmount() {
|
|
|
String sql = "select a.xField,sum(a.yField) yField from\n" +
|
|
String sql = "select a.xField,sum(a.yField) yField from\n" +
|
|
|
- "(select pu_currency xField, round(sum(pd_amount)/10000 ,2) yField from purc$orderitems\n" +
|
|
|
|
|
|
|
+ "(select pu_currency xField, round(sum(pd_qty * pd_price)/10000 ,2) yField from purc$orderitems\n" +
|
|
|
"left join purc$orders on pd_puid=pu_id\n" +
|
|
"left join purc$orders on pd_puid=pu_id\n" +
|
|
|
"where date_format(pu_date,'%y-%m')=date_format(now(), '%y-%m')\n" +
|
|
"where date_format(pu_date,'%y-%m')=date_format(now(), '%y-%m')\n" +
|
|
|
"and pu_currency is not null group by pu_currency\n" +
|
|
"and pu_currency is not null group by pu_currency\n" +
|
|
|
"union\n" +
|
|
"union\n" +
|
|
|
- "select deo_currency xField, round(sum(dei_totalprice)/10000 ,2) yField from purc$deputyorderitems\n" +
|
|
|
|
|
- "left join purc$deputyorders on dei_deoid=deo_id\n" +
|
|
|
|
|
|
|
+ "select deo_currency xField, round(sum(deo_orderamount)/10000 ,2) yField from purc$deputyorders\n" +
|
|
|
"where date_format(deo_entrydate,'%y-%m') = date_format(now(), '%y-%m')\n" +
|
|
"where date_format(deo_entrydate,'%y-%m') = date_format(now(), '%y-%m')\n" +
|
|
|
"and deo_downloadstatus = '已下载' and deo_entrystatus='已提交' group by deo_currency) a\n" +
|
|
"and deo_downloadstatus = '已下载' and deo_entrystatus='已提交' group by deo_currency) a\n" +
|
|
|
"group by xField";
|
|
"group by xField";
|