Commit a201855f authored by Quxl's avatar Quxl

x

parent c42fa157
......@@ -9,6 +9,95 @@ import com.egolm.shop.util.ShopContstrant;
public class GoodsSql {
/**
* 查询商品详情
* @Title: goodsInfoSql
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param: @param customer
* @param: @param shop
* @param: @param goodsID
* @param: @return
* @return: String
* @throws
*/
public static String goodsInfoSql(TCustomer customer,Map<String, Object> map) {
String goodsID=(String) map.get("goodsID");
String contractNO=(String) map.get("contractNO");
TShop tshop = customer.gettShops().get(0);
String goodInfoSql = "";
if(customer.getsCustLeveTypeID().equals(ShopContstrant.GUEST_LEVEL_TYPE_ID)) { //游客
goodInfoSql="SELECT TOP 1 "
+ " goodsID = g.nGoodsID, "
+ " goodsNO = g.sGoodsNO, "
+ " goodsName = g.sGoodsDesc, "
+ " contractNO = g.sAgentContractNO, "
+ " agentName=g.sAgentName,"
+ " categoryID = g.sCategoryNO, "
+ " tag=g.nTag, "
+ " barcode = g.sMainBarcode, "
+ " brandID = g.sBrandID, "
+ " brand = g.sBrand, "
+ " spec = g.sSpec, "
+ " minSaleQty = g.nMinSaleQty, "
+ " saleUnits = g.nSaleUnits, "
+ " orderUnits = g.nSaleUnits, "
+ " goodsUnit = g.sMarketUnit, "
+ " agentUnit = g.sUnit, "
+ " marketPrice = g.nMarketPrice, "
+ " salePrice = g.nSalePrice, "
+ " realSalePrice =g.nRealSalePrice, "
+ " DCPriority = g.nDCPriority, "
+ " stock = g.nStockQty, "
+ " imgPath = g.sURL, "
+ " flavor = g.Flavor,"
+ " caseUnits=g.nCaseUnits"
+ " FROM "
+ " V_DistrictGoods g "
+ " WHERE "
+ " g.nGoodsID = " + goodsID + " "
+ " AND g.sDistrictID='"+tshop.getsDistrictID()+"' AND (g.sOrgNO='"+tshop.getsOrgNO()+"' or g.sOrgNO='china') "
+ " AND g.nTag&1=0 "
;
}else {
goodInfoSql="SELECT TOP 1 "
+ " goodsID = g.nGoodsID, "
+ " goodsNO = g.sGoodsNO, "
+ " goodsName = g.sGoodsDesc, "
+ " contractNO = g.sAgentContractNO, "
+ " agentName=g.sAgentName,"
+ " categoryID = g.sCategoryNO, "
+ " tag=g.nTag, "
+ " barcode = g.sMainBarcode, "
+ " brandID = g.sBrandID, "
+ " brand = g.sBrand, "
+ " spec = g.sSpec, "
+ " minSaleQty = g.nMinSaleQty, "
+ " saleUnits = g.nSaleUnits, "
+ " orderUnits = g.nSaleUnits, "
+ " goodsUnit = g.sMarketUnit, "
+ " agentUnit = g.sUnit, "
+ " marketPrice = g.nMarketPrice, "
+ " salePrice = g.nSalePrice, "
+ " realSalePrice =g.nRealSalePrice, "
+ " DCPriority = g.nDCPriority, "
+ " stock = g.nStockQty, "
+ " imgPath = g.sURL, "
+ " flavor = g.Flavor,"
+ " caseUnits=g.nCaseUnits"
+ " FROM "
+ " V_CategoryGoods g "
+ " WHERE "
+ " g.nGoodsID = " + goodsID + " "
+ " AND g.sShopNO = '" + tshop.getsShopNO() + "' "
+ " AND g.nTag&1=0 "
;
}
if(StringUtil.isNotEmpty(contractNO)){
goodInfoSql += " AND g.sAgentContractNO='"+contractNO+"' ";
}
return goodInfoSql;
}
/**
* 商品价格SQL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment