+" acg.nSaleUnits SaleUnit, acg.nMarketPrice MarketPrice, sum(a.nSaleQty) SaleQty from tAgentGoodsDailyOnline a join tGoods g on a.nGoodsID = g.nGoodsID "
+" join tAgentContractGoods acg on a.sAgentContractNO = acg.sAgentContractNO and a.nGoodsID = acg.nGoodsID ";
@@ -44,8 +44,7 @@ public class GoodsServiceImpl implements GoodsService {
}else{
sql+=" where acg.sOrgNO = '"+orgNO+"' and a.dTradeDate >= '"+beginDate+"' and a.dTradeDate < '"+endDate+"'";
}
sql+=" group by a.nGoodsID, g.sGoodsNO, g.sGoodsDesc, acg.nSalePrice, acg.sSpec, acg.sUnit, acg.nMinSaleQty, acg.nSaleUnits, acg.nMarketPrice, acg.sMarketUnit order by "
+" sum(a.nSaleQty) desc";
sql+=" group by a.nGoodsID, g.sGoodsNO, g.sGoodsDesc, acg.nSalePrice, acg.sSpec, acg.sUnit, acg.nMinSaleQty, acg.nSaleUnits, acg.nMarketPrice, acg.sMarketUnit";