如果是简单的写sql,在where中写死就可以了,但是如果是不确定的参数呢,这个时候就需要一点处理方式了。
1.后台的写法
1 String[] operateResult=new String[]{"0","1"}; 2 conditionMap.put("operateResult",operateResult);
2.SQL的写法
1 <isNotEmpty prepend=" AND " property="operateResult"> 2 OPERATE_RESULT in 3 <iterate prepend="" property="operateResult" open="(" close=")" conjunction="," > 4 '$operateResult[]$' 5 </iterate> 6 </isNotEmpty>