builder.AppendFormat(@" SELECT A.*,(SELECT GROUP_CONCAT(SName) from rb_school where `Status`=0 and FIND_IN_SET(SId,a.ItemSchools) GROUP BY `Status`=0) as SchoolName,
(SELECT GROUP_CONCAT(`Name`) from rb_duty_frequency where `Status`=0 and FIND_IN_SET(Id,a.Shifts) GROUP BY `Status`=0) as ShiftsName
FROM RB_Duty_Item AS A WHERE 1=1 ");
builder.AppendFormat(@"
SELECT A.*,(SELECT GROUP_CONCAT(SName) FROM rb_school WHERE `Status`=0 AND FIND_IN_SET(SId,a.ItemSchools) GROUP BY `Status`=0) AS SchoolName
,(SELECT GROUP_CONCAT(Name) FROM rb_duty_frequency WHERE `Status`=0 AND FIND_IN_SET(Id,a.Shifts) GROUP BY `Status`=0) AS ShiftsName
FROM RB_Duty_Item AS A
WHERE 1=1 ");
if(query!=null)
{
if(query.Group_Id>0)
...
...
@@ -31,7 +35,6 @@ namespace Edu.Repository.Duty
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Duty_Item_ViewModel.Id),query.Id);
}
if(query.Status>=0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Duty_Item_ViewModel.Status),(int)query.Status);