" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n"+
" FROM\n"+
" \n"+
" Set_BT_Car_Platform A\n"+
" WHERE\n"+
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n"+
" a.Version= '{0}' \n"+
" WHERE\n"+
" AND a.StorageLocationDesc NOT LIKE '%备品%'\n"+
" a.Version= '{0}' \n"+
" ) temp1\n"+
" AND a.StorageLocationDesc NOT LIKE '%备品%' \n"+
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode\n"+
" ) temp1\n"+
" ";
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode";
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n"+
" StorageLocation,\n"+
" ) temp1\n"+
" StorageLocationDesc,\n"+
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode\n"+
" Version,\n"+
" LEFT JOIN (\n"+
" AcceptanceNo,\n"+
" SELECT SUM\n"+
" AcceptanceDate \n"+
" ( Amt ) / SUM ( Qty ) AS Price,\n"+
" ) A\n"+
" MaterialCode,\n"+
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n"+
" Version \n"+
" ) temp1\n"+
" FROM\n"+
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode\n"+
" Set_BT_Car_Platform \n"+
" LEFT JOIN (\n"+
" WHERE\n"+
" SELECT SUM\n"+
" version = '{0}' \n"+
" ( Amt ) / SUM ( Qty ) AS Price,\n"+
" AND StorageLocationDesc NOT LIKE '%备品%' \n"+
" MaterialCode,\n"+
" GROUP BY\n"+
" Version \n"+
" MaterialCode,\n"+
" FROM\n"+
" Version \n"+
" Set_BT_Car_Platform \n"+
" ) AS TEMP3 ON temp1.[结算物料号] = temp3.MaterialCode";
" WHERE\n"+
" version = '{0}' \n"+
" AND StorageLocationDesc NOT LIKE '%备品%' \n"+
" GROUP BY\n"+
" MaterialCode,\n"+
" Version \n"+
" ) AS TEMP3 ON temp1.[结算物料号] = temp3.MaterialCode";
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n"+
" FROM\n"+
" \n"+
" Set_BT_Car_Platform A\n"+
" WHERE\n"+
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n"+
" a.Version= '{0}' \n"+
" WHERE\n"+
" AND a.StorageLocationDesc LIKE '%备品%'\n"+
" a.Version= '{0}' \n"+
" ) temp1\n"+
" AND a.StorageLocationDesc LIKE '%备品%' \n"+
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode\n"+
" ) temp1\n"+
" ";
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode";
" LEFT OUTER JOIN ( SELECT * FROM Set_HQ_H_Platform WHERE HQHKanBan <> 'BJ' ) AS b ON a.Kanban = b.HQHKanBan \n"+
" Set_HQ_H_Kanban AS a\n"+
" AND a.MaterialCode = b.MaterialCode\n"+
" LEFT OUTER JOIN ( SELECT * FROM Set_HQ_H_Platform WHERE HQHKanBan <> 'BJ' ) AS b ON a.Kanban = b.HQHKanBan \n"+
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n"+
" AND a.MaterialCode = b.MaterialCode\n"+
" WHERE\n"+
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n"+
" b.HQHKanBan IS NULL \n"+
" WHERE\n"+
" AND b.MaterialCode IS NULL {0}\n"+
" b.HQHKanBan IS NULL \n"+
" ) AS temp1\n"+
" AND b.MaterialCode IS NULL {0} \n"+
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode";
" ) AS temp1\n"+
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode";
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n"+
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n"+
" ) temp1\n"+
" ) temp1\n"+
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode";
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode";
//" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
//" ) temp1\n" +
//" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode";
// var _sql = string.Format(str, version, condition);
// var _sql = string.Format(str, version, condition);