Mybatis模糊查询

Dullonjiang 2020-07-08

VideoMapper.java

/**
     * 根据评分和标题模糊查询
     * @param point
     * @param title
     * @return
     */
    List<Video> selectByPointAndTitleLike(@Param("point") double point,@Param("title") String title);

VideoMapper.xml

<select id="selectByPointAndTitleLike" resultType="net.cybclass.online.domain.Video">
select * from video where point=#{point} and title like concat(‘%‘,#{title},‘%‘)
    </select>

相关推荐

jiong / 0评论 2020-09-17