- 使用@Select注解
- 使用<script></script>标签
- 参数要带@Param("XXX")
@Select("<script>"
+"select * from tb_taobao where 1=1"
+"<if test='status != null'>"
+"and status = #{status}"
+"</if>"
+"</script>")
public List<Taobao> getTaobaoList(@Param("status") Integer status);