G4Studio平台下iBatis复杂的AND和OR动态语句拼写

来源:互联网 发布:麻将源码 编辑:程序博客网 时间:2024/04/26 14:22

问题域:使用iBatis动态语句功能,拼写下面的SQL语句。

SELECT col1, col2, col3 FROM table1 WHERE col1 = xx AND ( col2  = xx OR col3 = xx )

  <select id="queryPolicyListDatas2" parameterClass="dto" resultClass="dto">         SELECT sab01, ab001, ab002 FROM   ab01 WHERE 1=1    <dynamic>         <isNotEmpty prepend="and" property="ab012">         ab012 = #ab012# </isNotEmpty>    </dynamic>    <dynamic prepend="and" open="(" close=")">        <isNotEmpty prepend="or" property="ab027"> ab027 = #ab027#</isNotEmpty><isNotEmpty prepend="or" property="ab028">ab028 = #ab028#</isNotEmpty>    </dynamic>   </select>

===============开源平台分享==============

G4Studio:JavaEE行业应用二次快速开发平台 

= 项目主页: http://g4studio-share.g4it.org                          

= 在线演示: http://g4studio-demo.g4it.org                

======================================