<if test="planMajorName != null and planMajorName != '' and r1 = '0'">
AND a.planmajorname = #{planMajorName}
</if>
<if test="planMajorName != null and planMajorName != '' and (r1 = null or r1 = '')">
AND a.planmajorname LIKE
<if test="dbName == 'oracle'">'%'||#{planMajorName}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{planMajorName}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{planMajorName},'%')</if>
</if>
使用某个字段做标记,对另一个字段进行筛选查询。
还是说碰见这种情况,直接单独写一个查询方法?