43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.OracleClient;
|
|
|
|
namespace WX.CRM.DAL.Csvr
|
|
{
|
|
public class CSVR_CALLSTATIS_DAL
|
|
{
|
|
public DataTable GetList(DateTime? start, DateTime? end)
|
|
{
|
|
OracleConnection conn = new OracleConnection(OracleHelper.AYCRMConn);
|
|
if (conn.State == ConnectionState.Closed)
|
|
conn.Open();
|
|
try
|
|
{
|
|
string sql = @"select saleseid, sum(SATISFACTION1) SATISFACTION1,
|
|
sum(SATISFACTION2) SATISFACTION2,
|
|
sum(SATISFACTION3) SATISFACTION3,
|
|
sum(SATISFACTION4) SATISFACTION4
|
|
from CSVR_CALLSTATIS where countdate>=:v_start and countdate<=:v_end group by saleseid";
|
|
var p = new List<OracleParameter>
|
|
{
|
|
new OracleParameter { ParameterName = "v_start", OracleType = OracleType.DateTime, Value = start },
|
|
new OracleParameter { ParameterName = "v_end", OracleType = OracleType.DateTime, Value = end }
|
|
};
|
|
var ds = OracleHelper.DataQueray(CommandType.Text, sql, p.ToArray());
|
|
return ds.Tables[0];
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
finally
|
|
{
|
|
if (conn.State == ConnectionState.Open)
|
|
conn.Close();
|
|
}
|
|
}
|
|
}
|
|
}
|