and (( a.type = '0' AND (s.HANDLE_STATUS = "0" or s.HANDLE_STATUS = "4") ) or ( a.type ='1' AND (if(ifnull(h.id,0) != '0',h.HANDLE_STATUS,s.HANDLE_STATUS) in ('1','5','6','3','7') or (s.HANDLE_STATUS in ('1','5','6','3','7') and s.REDUCE_CAN = '1')) ))
and a.SOCIAL_HANDLE_STATUS in ('0','4')
and (s.YGS_HANDLE_STATUS in ('0','5') or s.YSD_HANDLE_STATUS in ('0','5') )
and (a.auto_flag='1' or s.YGS_HANDLE_STATUS ='5' or s.YSD_HANDLE_STATUS = '5' )
<!--<if test="tDispatchInfo.status != null and tDispatchInfo.status.trim() != ''">