我的存储库中有一个方法需要提供整数值列表,但我只获得第一列值..我怎样才能获得我的服务中的所有列值..
这是我在存储库中的方法:
public List<int> GetChartInfo(string lineNo, string shiftDateTime, string station)
{
string query = string.Format("SELECT SUM(QTY_BUILD) AS BUILD_QTY, SUM(QTY_FAIL) AS FAIL_QTY, "+
"DATEPART(HH,BUILD_HOUR) AS SHIFT_HOURS FROM {0} WITH (NOLOCK) "+
"WHERE LINE_NO='{1}' AND BUILD_HOUR >='{2}' AND STATION='{3}' "+
"GROUP BY DATEPART(HH,BUILD_HOUR) ORDER BY SHIFT_HOURS ",_tableName, lineNo, shiftDateTime, station);
return MitecsRepository.Fetch<int>(query);
}
我在我的服务中调用了这个方法,如下所示:
var QtyBuildList = _qtyBuildRepository.GetChartInfo(cellName, _currentShiftDateTime, tableName);
QtyBuildList 仅获取 build_qty 数据.. 我怎样才能获取 fail_qty 和 shift_hours 数据。