<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Npgsql" Version="6.0.0" />
var aggs = await _npgsqlConnection.ExecuteScalarAsync<dynamic>("SELECT SUM ( totalprice ) AS GMV FROM ods_tsc_order WHERE ordertime >= :StartTime AND ordertime < :EndTime AND merchantid = :MerchantId AND productid = ANY(:ProductIds);", request.ConvertParamater());
var aggs = (await _npgsqlConnection.QueryAsync<dynamic>("SELECT MINUTE, COUNT ( ID ) AS doccount FROM generate_series ( :StartTime, ( :EndTime :: TIMESTAMP - INTERVAL '1 milliseconds' ), INTERVAL '1 MINUTE' ) AS G ( MINUTE ) LEFT JOIN ods_tsc_order o ON date_trunc( 'minute', o.ordertime ) = MINUTE WHERE o.merchantid = :MerchantId AND o.productid = ANY(:ProductIds) GROUP BY MINUTE ORDER BY MINUTE;", request.ConvertParamater())).ToList();