like this:
<isEqual prepend="and" property="userDpt" compareValue="A">
   and 
</isEqual>
<isEqual prepend="and" property="userDpt" compareValue="B">
   and 
</isEqual>
<isNotNull prepend="and" property="userDpt"><![CDATA[(common sentence)]]></isNotNull>

解决方案 »

  1.   

    TO:darklight2008(其实我是水瓶座) 
       按你所說,那如果userDpt=='A'
     會執行第一種情況,
        因為同時它isNotNull,是不是也要執行你加的那段?這樣的話就不是我想要的了!
      

  2.   

    呵呵,知道了,再给你写一下:
    <isEqual prepend="and" property="userDpt" compareValue="A">
       and 
    </isEqual>
    <isEqual prepend="and" property="userDpt" compareValue="B">
       and 
    </isEqual>
    <isNotEqual prepend="and" property="userDpt" compareValue="A">
    <isNotEqual prepend="and" property="userDpt" compareValue="B"><![CDATA[(common sentence)]]>
    </isNotEqual>
    </isNotEqual>
      

  3.   

    需要這樣麻煩嗎?如果的我compareValue多的話,那不是要寫那樣多嗎?有些累贅.
      

  4.   

    呵呵,如果你有多个compareValue的话建议你最好在程序中生成,用ibatis来生成是比较麻烦的。