通常在java后台或者前端js中多个条件组合判断中使用and或者or 如下
//使用&或者&& | 和||
if(a==1&b==2){
}
//或者sql文中的and和or
select * from emp where empno='7788' and deptno='20'
但是动态sql呢?
那就需要()把每一个条件括起来在加and 或者or
//动态添加语句
<if test="(buhinmt.buhinCd!= null and buhinmt.buhinCd != '') or(buhinmt.syohinCd!= null and buhinmt.syohinCd != '')">
AND BM.buhin_cd = SMBM.buhin_cd
AND SMBM.syohin_cd = SM.syohin_cd
AND SM.syurisaki_cd = SYUM.syurisaki_cd
</if>