|
@@ -56,7 +56,7 @@ public class TurnoverServiceImpl implements TurnoverService {
|
|
|
@Override
|
|
@Override
|
|
|
public List<Turnover> findRMBOrderAmount() {
|
|
public List<Turnover> findRMBOrderAmount() {
|
|
|
String sql = "select round(sum(YFIELD*(case when a.xfield='USD' then 6.5 when a.xfield='HKD' then 0.888 when a.xfield='RMB' then 1 end )),2) SUM from \n" +
|
|
String sql = "select round(sum(YFIELD*(case when a.xfield='USD' then 6.5 when a.xfield='HKD' then 0.888 when a.xfield='RMB' then 1 end )),2) SUM from \n" +
|
|
|
- "(select pu_currency xField, round(sum(pd_amount)/10000 ,2) yField \n" +
|
|
|
|
|
|
|
+ "(select pu_currency xField, round(sum(pd_qty * pd_price)/10000 ,2) yField \n" +
|
|
|
"from purc$orderitems left join purc$orders on pd_puid=pu_id where \n" +
|
|
"from purc$orderitems left join purc$orders on pd_puid=pu_id where \n" +
|
|
|
"date_format(pu_date,'%Y')=date_format(last_day(now()), '%Y') group by pu_currency\n" +
|
|
"date_format(pu_date,'%Y')=date_format(last_day(now()), '%Y') group by pu_currency\n" +
|
|
|
"UNION\n" +
|
|
"UNION\n" +
|
|
@@ -75,7 +75,7 @@ public class TurnoverServiceImpl implements TurnoverService {
|
|
|
@Override
|
|
@Override
|
|
|
public List<Turnover> findOrderAmount() {
|
|
public List<Turnover> findOrderAmount() {
|
|
|
String sql = "select a.xField,ROUND(SUM(a.yField)) yField from(\n" +
|
|
String sql = "select a.xField,ROUND(SUM(a.yField)) yField from(\n" +
|
|
|
- "select pu_currency xField, round(sum(pd_amount)/10000 ,2) yField \n" +
|
|
|
|
|
|
|
+ "select pu_currency xField, round(sum(pd_qty * pd_price)/10000 ,2) yField \n" +
|
|
|
"from purc$orderitems left join purc$orders on pd_puid=pu_id where \n" +
|
|
"from purc$orderitems left join purc$orders on pd_puid=pu_id where \n" +
|
|
|
"date_format(pu_date,'%Y')=date_format(last_day(now()), '%Y') group by pu_currency\n" +
|
|
"date_format(pu_date,'%Y')=date_format(last_day(now()), '%Y') group by pu_currency\n" +
|
|
|
"UNION\n" +
|
|
"UNION\n" +
|
|
@@ -96,11 +96,11 @@ public class TurnoverServiceImpl implements TurnoverService {
|
|
|
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_qty * pd_price)/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(deo_orderamount)/10000 ,2) yField from purc$deputyorders\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";
|
|
|
return commonDao.query(sql, Turnover.class);
|
|
return commonDao.query(sql, Turnover.class);
|
|
@@ -114,7 +114,7 @@ public class TurnoverServiceImpl implements TurnoverService {
|
|
|
@Override
|
|
@Override
|
|
|
public List<Turnover> findLastMonthOrderCount() {
|
|
public List<Turnover> findLastMonthOrderCount() {
|
|
|
String sql = "select count(pu_code) sum from purc$orders\n" +
|
|
String sql = "select count(pu_code) sum from purc$orders\n" +
|
|
|
- "where date_format(pu_date,'%y-%m')=date_format(DATE_ADD(now(), INTERVAL -1 MONTH), '%y-%m')";
|
|
|
|
|
|
|
+ "where date_format(pu_date,'%Y-%m')=date_format(DATE_ADD(now(), INTERVAL -1 MONTH), '%Y-%m')";
|
|
|
return commonDao.query(sql, Turnover.class);
|
|
return commonDao.query(sql, Turnover.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -128,11 +128,11 @@ public class TurnoverServiceImpl implements TurnoverService {
|
|
|
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_qty * pd_price)/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(deo_orderamount)/10000 ,2) yField from purc$deputyorders\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";
|
|
|
return commonDao.query(sql, Turnover.class);
|
|
return commonDao.query(sql, Turnover.class);
|
|
@@ -146,7 +146,7 @@ public class TurnoverServiceImpl implements TurnoverService {
|
|
|
@Override
|
|
@Override
|
|
|
public List<Turnover> findThisMonthOrderCount() {
|
|
public List<Turnover> findThisMonthOrderCount() {
|
|
|
String sql = "select count(pu_code) sum from purc$orders\n" +
|
|
String sql = "select count(pu_code) sum from purc$orders\n" +
|
|
|
- "where date_format(pu_date,'%y-%m')=date_format(now(), '%y-%m')";
|
|
|
|
|
|
|
+ "where date_format(pu_date,'%Y-%m')=date_format(now(), '%Y-%m')";
|
|
|
return commonDao.query(sql, Turnover.class);
|
|
return commonDao.query(sql, Turnover.class);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|