public void SaveGenerateByCondition(FinaChargeStuYearEntity entity)
{
var db = BaseRepository("CollegeMIS").BeginTrans();
try
{
//获取缴费学生
var stulist= db.FindList<FinaChargeStudentEntity>(m=>m.F_CheckMark==true);
//获取收费标准
var finaChargesStandardList= db.FindList<FinaChargesStandardEntity>("select a.Grade,a.DeptNo,a.MajorNo,a.Standard,a.SYear,b.ChargeItemName,b.ChargeItemCode,b.ChargeItemType from [dbo].[FinaChargesStandard] a left join [dbo].[FinaChargeItem] b on a.ChargeItemID=b.[ChargeItemID]");
var finaChargesStandardListGroup = db.FindList<FinaChargesStandardEntity>(@"select a.Grade,a.DeptNo,a.MajorNo,sum(isnull(a.Standard,0)) as YJAmount,a.SYear
from[dbo].[FinaChargesStandard] a left join[dbo].[FinaChargeItem] b on a.ChargeItemID = b.[ChargeItemID]
group by a.Grade, a.DeptNo, a.MajorNo, a.SYear");
foreach (var stuitem in stulist)
{
//写入学生年度缴费数据
var finaChargeStuYear=new FinaChargeStuYearEntity();
select newid(), stuno, stuname, genderno, identitycardno, deptno, majorno, classno, mobile, 0, 1 from StuInfoBasic a where a.checkmark = 1 and stuno not in(select stuno from FinaChargeStudent)");
select newid(), stuno, stuname, genderno, identitycardno, deptno, majorno, classno,grade, mobile, 0, 1 from StuInfoBasic a where a.checkmark = 1 and stuno not in(select stuno from FinaChargeStudent)");