摘要: 在某些情况下,如果明知道查询结果只有一个,SQL语句中使用LIMIT 1会提高查询效率。 例如下面的用户表(主键id,邮箱,密码): create table t_user(id int primary key auto_increment,email varchar(255),password v 阅读全文
posted @ 2017-03-17 19:38 薇飘意 阅读(6835) 评论(0) 推荐(1) 编辑
摘要: 一、单个参数: 二、多参数: 三、Map封装多参数: 四、List封装in: 五、多参数传递之注解方式示: 六、selectList()只能传递一个参数,但实际所需参数既要包含String类型,又要包含List类型时的处理方法: 将参数放入Map,再取出Map中的List遍历。如下: 阅读全文
posted @ 2017-03-17 19:37 薇飘意 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 1,使用@Param注解 当以下面的方式进行写SQL语句时: @Select("select column from table where userid = #{userid} ") public int selectColumn(int userid); 当你使用了使用@Param注解来声明参数 阅读全文
posted @ 2017-03-17 19:36 薇飘意 阅读(15580) 评论(2) 推荐(2) 编辑