mybtais的mapper中使用@Select注解使用if
@Select({"<script>"+
" select t.* from track_name t"+
" <where>"+
" <if test='username!= null and username !=\"\" '>"+
" and =#{username}"+
" </if>"+
" <if test='gmtCreateTime!=null and gmtCreateTime !=\"\" '>"+
" and > #{gmtCreateTime} "+
" </if>"+
" </where>"+
"</script>"
})
IPage<TrackName> queryCondition(Page<TrackName> page,@Param("username")String username,@Param("gmtCreateTime")String gmtCreateTime)