MyBatis动态 SQL语法条件 WHERE 子句代码示例

纸扎戏偶
<select id="findUser" parameterType="map" resultType="User">
  select * from users
  <where> 
    <if test="id != null">
      and id = #{id}   
    </if>   
  </where>
</select>
文章版权声明:除非注明,否则均为我爱教程术原创文章,转载或复制请以超链接形式并注明出处。