CY_ECommercePlatform/CY.SQLDAL/OA/OA_InventoryDAL.cs
@@ -384,6 +384,58 @@
            return _dataBase.SelectModelPage<Model.OA_Inventory>(pa, selectTarget, fromSource, "  a.LastUpdateTime ");
        }
        /// <summary>
        /// 获取货品的详细信息
        /// </summary>
        /// <param name="pa"></param>
        /// <param name="FirmId"></param>
        /// <param name="CargoSpaceName"></param>
        /// <param name="WarehouseName"></param>
        /// <param name="GoodsName"></param>
        /// <param name="CommodityName"></param>
        /// <param name="BrandName"></param>
        /// <param name="SpecificationName"></param>
        /// <returns></returns>
        public IEnumerable<Model.OA_Inventory> SelecetModelDetailInfoList( Guid FirmId, string WarehouseName, string GoodsName, string CommodityName, string BrandName, string SpecificationName)
        {
            string selectTarget = " a.*,b.Name AS CargoSpaceName , c.WarehouseName AS WarehouseName ,e.Name AS BrandName,f.Name AS SpecificationName,g.GoodsName ,g.CommodityName ,g.IsPaper   ,g.CommodityId";
            string condition = " where a.FirmId='" + FirmId + "'  ";
            if (!string.IsNullOrEmpty(WarehouseName))
            {
                condition += string.Format("  and  a.WarehouseName='{0}' ", WarehouseName);
            }
            if (!string.IsNullOrEmpty(BrandName))
            {
                condition += string.Format("  and  e.Name='{0}' ", BrandName);
            }
            if (!string.IsNullOrEmpty(SpecificationName))
            {
                condition += string.Format("  and  f.Name='{0}' ", SpecificationName);
            }
            if (!string.IsNullOrEmpty(GoodsName))
            {
                condition += string.Format("  and  g.GoodsName='{0}' ", GoodsName);
            }
            if (!string.IsNullOrEmpty(CommodityName))
            {
                condition += string.Format("  and  g.CommodityName='{0}' ", CommodityName);
            }
            string fromSource = "dbo.OA_Inventory  AS a   LEFT JOIN  dbo.OA_CargoSpace AS b ON a.CargoSpaceId=b.Keyid " +
          "  LEFT JOIN dbo.OA_WarehouseInfo AS c ON a.WarehouseId = c.Keyid"
          + "   LEFT JOIN dbo.OA_Specification AS f ON a.SpecificationId=f.Keyid "
           + "  LEFT JOIN dbo.OA_Brand AS e ON a.BrandId = e.Keyid "
          + " LEFT JOIN (SELECT d.*   ,j.CommodityName,j.IsPaper,j.Keyid AS CommodityId FROM dbo.OA_GoodsInfo AS  d "
          + "LEFT JOIN dbo.OA_Commodity AS j ON d.GoodsTypeId=j.Keyid  ) AS g ON a.GoodsId=g.Keyid  " + condition;
            return _dataBase.SelectModel<Model.OA_Inventory>( selectTarget, fromSource);
        }
        public IEnumerable<OA_FirmAccount> getAllSubject(Guid FirmId, string AccountType)
        {
            string selectTarget = "  Keyid,AccountName,AccountType,UserName,Balance";