" left join (select * from Set_Unsettle where version='{1}') f \n"+
" on a.MaterialCode=f.MaterialCode and a.KENNCode2=f.KENNCode and a.ChassisNumber2=f.ChassisNumber \n"+
" on a.MaterialCode=f.MaterialCode and a.KENNCode2=f.KENNCode and a.ChassisNumber2=f.ChassisNumber \n"+
" LEFT JOIN Set_material B ON a.MaterialCode = b.CustomerPartCode \n"+
" LEFT JOIN (select max(Id) Id,MaterialCode,MaterialDesc from Set_material group by MaterialCode,MaterialDesc) d ON a.ParentSapMaterialCode = d.MaterialCode \n"+
//var _priceList = DbConnection.Query<PriceList>("select MaterialCode,Price from Set_PriceList where version=(select max(version) from set_Set_PriceListVersion)").ToList();
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT Max( Version ) FROM Set_PriceList ) ) temp2 ON temp1.SapMaterialCode = temp2.MaterialCode";
//var _materialList = DbConnection.Query<Material>("select * from set_material").ToList();
//var _priceList = DbConnection.Query<PriceList>("select MaterialCode,Price from Set_PriceList where version=(select max(version) from set_Set_PriceListVersion)").ToList();