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>
 
                    
                
 
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号