public async Task<IEnumerable<SplitMergeOrderSourcePlanOrderView>> GetSplitMergeOrderSourcePlanOrderViewAsync(long splitMergeOrderId) { string sql = "select a.*,b.* from PlanOrderView a join SplitMergeOrderSource b on a.Id=b.PlanOrderId where a.Id in (select PlanOrderId from SplitMergeOrderSource where SplitMergeOrderId=@splitMergeOrderId)"; using var conn = _dapper.CreateConnection(); var result = await conn.QueryAsync<PlanOrderView, SplitMergeOrderSource, SplitMergeOrderSourcePlanOrderView>(sql.ToString(), (plan, source) => { var result = new SplitMergeOrderSourcePlanOrderView(); result.PlanOrderView = plan; result.SplitMergeOrderSource = source; return result; }, new { splitMergeOrderId }); return result; }
标签:splitMergeOrderId,对象,映身,SplitMergeOrderSource,source,result,var,Dapper,select From: https://www.cnblogs.com/friend/p/17935179.html