where+=$@" and {nameof(RB_Teaching_BonusDetail.Group_Id)} ={demodel.Group_Id}";
where+=$@" and A.{nameof(RB_Teaching_BonusDetail.Group_Id)} ={demodel.Group_Id}";
}
}
if(demodel.School_Id>0)
if(demodel.School_Id>0)
{
{
where+=$@" and {nameof(RB_Teaching_BonusDetail.School_Id)} ={demodel.School_Id}";
where+=$@" and A.{nameof(RB_Teaching_BonusDetail.School_Id)} ={demodel.School_Id}";
}
}
if(demodel.BonusId>0)
if(demodel.BonusId>0)
{
{
where+=$@" and {nameof(RB_Teaching_BonusDetail.BonusId)} ={demodel.BonusId}";
where+=$@" and A.{nameof(RB_Teaching_BonusDetail.BonusId)} ={demodel.BonusId}";
}
}
if(!string.IsNullOrEmpty(demodel.BonusIds))
if(!string.IsNullOrEmpty(demodel.BonusIds))
{
{
where+=$@" and {nameof(RB_Teaching_BonusDetail.BonusId)} in({demodel.BonusIds})";
where+=$@" and A.{nameof(RB_Teaching_BonusDetail.BonusId)} in({demodel.BonusIds})";
}
}
if(demodel.TeacherId>0)
if(demodel.TeacherId>0)
{
{
where+=$@" and {nameof(RB_Teaching_BonusDetail.TeacherId)} ={demodel.TeacherId}";
where+=$@" and A.{nameof(RB_Teaching_BonusDetail.TeacherId)} ={demodel.TeacherId}";
}
}
if(demodel.ClassId>0)
if(demodel.ClassId>0)
{
{
where+=$@" and {nameof(RB_Teaching_BonusDetail.ClassId)} ={demodel.ClassId}";
where+=$@" and A.{nameof(RB_Teaching_BonusDetail.ClassId)} ={demodel.ClassId}";
}
}
if(demodel.Type>0)
if(demodel.Type>0)
{
{
where+=$@" and {nameof(RB_Teaching_BonusDetail.Type)} ={demodel.Type}";
where+=$@" and A.{nameof(RB_Teaching_BonusDetail.Type)} ={demodel.Type}";
}
}
stringsql=$@" select * from RB_Teaching_BonusDetail where {where} order by Id desc";
stringsql=$@" select * from RB_Teaching_BonusDetail as A LEFT JOIN rb_teaching_bonus as b on a.BonusId=b.Id and b.State=2 where {where} order by a.Id desc";