美文网首页
MyBatis 接口注解方式代替mapper.xml

MyBatis 接口注解方式代替mapper.xml

作者: 公子失 | 来源:发表于2019-05-09 10:55 被阅读0次
    @Select("<script>"
            + "select * from user  "
            + " <trim prefix=\"WHERE (\" suffix=\")\" prefixOverrides=\"AND |OR \">"
                + " <if test=\"id != null and id != '' \"> and id = #{id}</if> "
                + " <if test=\"name != null and name != '' \"> and name = #{name}</if> "
            + "</trim>"
        + " </script>")
    public List<User> selectUserByPage(Map<String, Object> map,Page<User> page);

相关文章

网友评论

      本文标题:MyBatis 接口注解方式代替mapper.xml

      本文链接:https://www.haomeiwen.com/subject/mpnioqtx.html