update Search set [Content]='
Select 
AccountDate as 日期, 
sum(Price) as 金额,
AccountDate as ShowKey
 
from 
( Select IncomeID,AccountDate,Price,SchoolID from Income where Income = 1 
Union 
Select IncomeID,AccountDate,-Price,SchoolID from Income where Income = 0) as tb 
where SchoolID in ( {@SchoolID:校区} )
and AccountDate >= {@StartDate:开始日期} 
and AccountDate <= {@EndDate:结束日期} 
group by AccountDate
' where SearchID = 19
GO

update Search set [Content]='
Select 
sum(Price) as 金额,
'''' as ShowKey
from 
( Select IncomeID,AccountDate,Price,SchoolID from Income where Income = 1 
Union 
Select IncomeID,AccountDate,-Price,SchoolID from Income where Income = 0) as tb 
where SchoolID in ( {@SchoolID:校区} )
and AccountDate >= {@StartDate:开始日期} 
and AccountDate <= {@EndDate:结束日期} 
' where SearchID = 20
GO

update Search set [Content]='
Select 
SchoolName as 校区, 
sum(Price) as 金额,
SchoolID as ShowKey
 
from 
( Select IncomeID,AccountDate,Price,SchoolID,SchoolName from Income where Income = 1 
Union 
Select IncomeID,AccountDate,-Price,SchoolID,SchoolName from Income where Income = 0) as tb 
where AccountDate >= {@StartDate:开始日期} 
and AccountDate <= {@EndDate:结束日期} 
group by SchoolName,SchoolID
' where SearchID = 21
GO


update Search set [Content]='
Select 
LessonDegree.TeacherID as 工号, 
Users.TrueName as 姓名,
Sum(LessonDegree.Lessons) as 课时,
cast(Sum(LessonDegree.Lessons*Class.LessonMinute) as decimal) /60 as 小时,
cast(Sum(LessonDegree.Lessons*Class.LessonMinute) as decimal) /60 *Users.HourFee as 工资,
LessonDegree.TeacherID as ShowKey

from LessonDegree,Class,Users
where LessonDegree.ClassID = Class.ClassID 
and LessonDegree.TeacherID = Users.UserID
and LessonDegree.LeStateID = 1
and Users.Pluralist= 1
and LessonDegree.StartDate >= {@StartDate:开始日期} 
and LessonDegree.StartDate <= {@EndDate:结束日期} 
group by LessonDegree.TeacherID,Users.TrueName,Users.HourFee
',[ShowContent]='
Select 
LessonDegree.ClassID as 班号, 
Class.ClassName as 班级,
Class.LessonMinute as 每课时分钟,
Sum(LessonDegree.Lessons) as 课时,
cast(Sum(LessonDegree.Lessons*Class.LessonMinute) as decimal) /60 as 小时,
cast(Sum(LessonDegree.Lessons*Class.LessonMinute) as decimal) /60 *Users.HourFee as 工资
from LessonDegree,Class,Users
where LessonDegree.ClassID = Class.ClassID 
and LessonDegree.TeacherID = Users.UserID
and LessonDegree.LeStateID = 1
and LessonDegree.TeacherID = {@ShowKey} 
and LessonDegree.StartDate >= {@StartDate} 
and LessonDegree.StartDate <= {@EndDate} 
group by LessonDegree.ClassID,Class.ClassName,Class.LessonMinute,Users.HourFee
' where SearchID = 7
GO

Alter Table [StuClass] ADD [Score1] [money] CONSTRAINT [DF_StuClass_Score1] Default (0) 
GO
Alter Table [StuClass] ADD [Score2] [money] CONSTRAINT [DF_StuClass_Score2] Default (0) 
GO
Alter Table [StuClass] ADD [Score3] [money] CONSTRAINT [DF_StuClass_Score3] Default (0) 
GO
Alter Table [StuClass] ADD [Score4] [money] CONSTRAINT [DF_StuClass_Score4] Default (0) 
GO
Alter Table [StuClass] ADD [Score5] [money] CONSTRAINT [DF_StuClass_Score5] Default (0) 
GO

Alter Table [Bill] ADD [PrintCount] [int] CONSTRAINT [DF_Bill_PrintCount] Default (0) 
GO
Alter Table [Payment] ADD [PrintCount] [int] CONSTRAINT [DF_Payment_PrintCount] Default (0) 
GO
Update Bill set PrintCount = 0
GO
Update Payment set PrintCount = 0
GO

Update DBInfo set DateAndTime='2012-08-25'
GO





