错误的方式:
case when t.batchid <>' ' and is not null then 1 else 0 end
正确1:
case when (t.batchid <>' ' and t.batchid is not null) then 1 else 0 end
正确2,去掉括号:
case when t.batchid <>' ' and t.batchid is not null then 1 else 0 end