标签:des style c class blog code
<select id="queryGoodsGroupCodeName" parameterClass="String" resultClass="codeTextBean"> SELECT L4_GDS_GROUP_CD CODE,L4_GDS_GROUP_DESC NAME FROM DM_GDS_GROUP_INF_TD <dynamic prepend="WHERE"> <isNotEmpty property="value" prepend="AND"> (L4_GDS_GROUP_CD LIKE ‘%$value$%‘ OR L4_GDS_GROUP_DESC LIKE ‘%$value$%‘) </isNotEmpty> </dynamic> </select> <select id="queryCategoryCodeName" parameterClass="String" resultClass="codeTextBean"> select HR_DEPT_CD code, DEPT_NM name from dw_rpt.DM_DEPT_TD <dynamic prepend="WHERE"> <isNotEmpty property="value"> (HR_DEPT_CD LIKE ‘%$value$%‘ OR DEPT_NM LIKE ‘%$value$%‘) </isNotEmpty> </dynamic> </select>
第一条查询语句添加了:prepend="AND",第二条没添加,发现在isNotEmpty属性中是否添加:prepend="AND" 都能运行。
ibatis动态语句加and 和不加and,布布扣,bubuko.com
标签:des style c class blog code
原文地址:http://www.cnblogs.com/tanglc/p/3745337.html