文章目录 一、普通的字符串类型判断空逻辑二、Boolean类型判断 一、普通的字符串类型判断空逻辑 <if test="query.activity != null and query.activity != ''">AND extra.activity = #{query.activity}</if> 二、Boolean类型判断 <if test="!query.originalVirtualCode">AND extra.original_virtual_code is null</if>