sb.Append($@"SELECT * from RB_MiAi_BaseInfo where Status=0");
sb.Append($@"SELECT a.*,b.`Name`,b.Photo from RB_MiAi_BaseInfo as a LEFT JOIN rb_member_user as b on a.UserId=b.Id where Status=0 and b.Blacklist!=1");
if(where!=null)
{
if(where.TenantId>0)
{
sb.AppendFormat(" and TenantId={0}",where.TenantId);
sb.AppendFormat(" and a.TenantId={0}",where.TenantId);
}
if(where.MallBaseId>0)
{
sb.AppendFormat(" and MallBaseId={0}",where.MallBaseId);
sb.AppendFormat(" and a.MallBaseId={0}",where.MallBaseId);
}
if(where.Id>0)
{
sb.AppendFormat(" and Id={0}",where.Id);
sb.AppendFormat(" and a.Id={0}",where.Id);
}
if(where.UserId>0)
{
sb.AppendFormat(" and UserId={0}",where.UserId);
sb.AppendFormat(" and a.UserId={0}",where.UserId);
}
if(!string.IsNullOrWhiteSpace(where.RealName))
{
sb.AppendFormat(" and a.RealName like'%{0}%'",where.RealName);
}
if(!string.IsNullOrWhiteSpace(where.Name))
{
sb.AppendFormat(" and b.Name like'%{0}%'",where.Name);