mybatis中if test 可以使用== != null '' and or 和括号()
<if test="pd.flag==1 or ((pd.flag==2 or pd.flag==3) and (pd.sfyj==2 or pd.sfyj==3)) or pd.flag==3">
union all
</if>
<if test="pd.ssny != null and pd.ssny != ''">
and z.sjssny >= '${pd.ssny}'
</if>