multiple if in where clause mysql