mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 09:15:27 +08:00 
			
		
		
		
	- 修复 表达式树解析 MapType 把小数位转换丢失的 bug;
This commit is contained in:
		@@ -616,7 +616,7 @@ namespace FreeSql.Internal
 | 
			
		||||
            Type oldMapType = null;
 | 
			
		||||
            var left = ExpressionLambdaToSql(leftExp, tsc);
 | 
			
		||||
            var leftMapColumn = SearchColumnByField(tsc._tables, tsc.currentTable, left);
 | 
			
		||||
            var isLeftMapType = leftMapColumn != null && new[] { "AND", "OR" }.Contains(oper) == false && (leftMapColumn.Attribute.MapType != rightExp.Type || leftMapColumn.CsType != rightExp.Type);
 | 
			
		||||
            var isLeftMapType = leftMapColumn != null && new[] { "AND", "OR", "*", "/", "+", "-" }.Contains(oper) == false && (leftMapColumn.Attribute.MapType != rightExp.Type || leftMapColumn.CsType != rightExp.Type);
 | 
			
		||||
            ColumnInfo rightMapColumn = null;
 | 
			
		||||
            var isRightMapType = false;
 | 
			
		||||
            if (isLeftMapType) oldMapType = tsc.SetMapTypeReturnOld(leftMapColumn.Attribute.MapType);
 | 
			
		||||
@@ -635,7 +635,8 @@ namespace FreeSql.Internal
 | 
			
		||||
            if (leftMapColumn == null)
 | 
			
		||||
            {
 | 
			
		||||
                rightMapColumn = SearchColumnByField(tsc._tables, tsc.currentTable, right);
 | 
			
		||||
                isRightMapType = rightMapColumn != null && new[] { "AND", "OR" }.Contains(oper) == false && (rightMapColumn.Attribute.MapType != leftExp.Type || rightMapColumn.CsType != leftExp.Type);
 | 
			
		||||
                //.Set(a => a.NotTaxTotalCostPrice == report.NotTaxCostPrice * a.CurrentQty) * / + - 解决 report.NotTaxCostPrice 小数点问题
 | 
			
		||||
                isRightMapType = rightMapColumn != null && new[] { "AND", "OR", "*", "/", "+", "-" }.Contains(oper) == false && (rightMapColumn.Attribute.MapType != leftExp.Type || rightMapColumn.CsType != leftExp.Type);
 | 
			
		||||
                if (isRightMapType)
 | 
			
		||||
                {
 | 
			
		||||
                    oldMapType = tsc.SetMapTypeReturnOld(rightMapColumn.Attribute.MapType);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user