|
@@ -25,9 +25,13 @@ namespace FCS.Crawler.Basketball
|
|
|
private List<DataItemDetail> DateItem = new List<DataItemDetail>();
|
|
private List<DataItemDetail> DateItem = new List<DataItemDetail>();
|
|
|
private List<B_Team> TeamList = new List<B_Team>();
|
|
private List<B_Team> TeamList = new List<B_Team>();
|
|
|
B_TeamStatistics g;
|
|
B_TeamStatistics g;
|
|
|
|
|
+ private string cbaEventId = "";
|
|
|
|
|
+ private string nbaEventId = "";
|
|
|
public B_TeamStatisticsJob()
|
|
public B_TeamStatisticsJob()
|
|
|
{
|
|
{
|
|
|
g = new B_TeamStatistics();
|
|
g = new B_TeamStatistics();
|
|
|
|
|
+ cbaEventId = services.Query<B_Events>("and Name ='CBA赛事'", "").FirstOrDefault().Id;
|
|
|
|
|
+ nbaEventId = services.Query<B_Events>("and Name ='NBA赛事'", "").FirstOrDefault().Id;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void Execute(IJobExecutionContext context)
|
|
public void Execute(IJobExecutionContext context)
|
|
@@ -107,7 +111,7 @@ namespace FCS.Crawler.Basketball
|
|
|
{
|
|
{
|
|
|
if (Year != "")
|
|
if (Year != "")
|
|
|
{
|
|
{
|
|
|
- services.Delete<B_TeamStatistics>(" and Season like '%" + Year + "%'");
|
|
|
|
|
|
|
+ services.Delete<B_TeamStatistics>("and EventId='" + nbaEventId + "' and Season like '%" + Year + "%'");
|
|
|
}
|
|
}
|
|
|
services.SqlBulkCopyAdd<B_TeamStatistics>(TeamStatisticsList);
|
|
services.SqlBulkCopyAdd<B_TeamStatistics>(TeamStatisticsList);
|
|
|
Trace.WriteLine("B_TeamStatistics更新完毕");
|
|
Trace.WriteLine("B_TeamStatistics更新完毕");
|