@@ -577,6 +577,24 @@ static void Main(string[] args)
577577 BaseEntity . Initialization ( fsql , ( ) => _asyncUow . Value ) ;
578578 #endregion
579579
580+ var isusers01 = fsql . Select < Achievement > ( )
581+ . Where ( e => e . Property ( "项目执行情况" ) == "结题" )
582+ . GroupBy ( e => new { ProjectLevel = e . Property ( "项目级别" ) } )
583+ . ToSql ( e => new
584+ {
585+ e . Key . ProjectLevel ,
586+ Test = e . Value . Group . Property ( "批准经费总额(万元)" ) ,
587+ } ) ;
588+ isusers01 = fsql . Select < Achievement > ( )
589+ . Where ( e => e . Property ( "项目执行情况" ) == "结题" )
590+ . GroupBy ( e => new { ProjectLevel = e . Property ( "项目级别" ) } )
591+ . WithTempQuery ( e => new
592+ {
593+ e . Key . ProjectLevel ,
594+ Test = e . Value . Group . Property ( "批准经费总额(万元)" ) ,
595+ } )
596+ . ToSql ( ) ;
597+
580598 var bulkUsers = new [ ] {
581599 new IdentityUser1 { Nickname = "nickname11" , Username = "username11" } ,
582600 new IdentityUser1 { Nickname = "nickname12" , Username = "username12" } ,
@@ -2116,4 +2134,24 @@ class GoodsDataDTO
21162134 public string GoodsNo { get ; set ; }
21172135 public string GoodsName { get ; set ; }
21182136 }
2137+
2138+ [ ExpressionCall ]
2139+ public static class AchievementExpressionExtension
2140+ {
2141+ static ThreadLocal < ExpressionCallContext > context = new ThreadLocal < ExpressionCallContext > ( ) ;
2142+ public static string Property ( this Achievement achievement , string fieldName )
2143+ {
2144+ var ctx = context . Value ;
2145+ var prefix = ctx . ParsedContent [ "achievement" ] ;
2146+ prefix = prefix . Substring ( 0 , prefix . IndexOf ( '.' ) + 1 ) ;
2147+ ctx . Result = prefix + $ "`{ fieldName } `";
2148+ return default ;
2149+ }
2150+ }
2151+ [ Table ( DisableSyncStructure = true ) ]
2152+ public class Achievement
2153+ {
2154+ [ Column ( MapType = typeof ( string ) ) ]
2155+ public Achievement Group { get ; set ; }
2156+ }
21192157}
0 commit comments