随笔分类 - 学习
学习过程中遇到的问题记录
摘要:List的stream public ResultData queryMenuList() { // 获取所有数据List List<MenuVo> list = MenuDao.queryMenuList(); // 通过list.stream()将List结构转成Tree结构并返回 List<M
阅读全文
摘要:1. 书写顺序 select->distinct->from->join->on->where->group by->having->order by->limit 2. 执行顺序 from->on->join->where->group by->sum、count、max、avg->having-
阅读全文
摘要:一. 基础调优(从Sql语句角度) 1. 单条记录查询最后添加 limit 1, 避免全表查询; 2. 针对sql执行过长的语句进行explain解析, 再做相应调优; 3. where子句尽量避免: - 表达式; - 对null值判断,建议对null值设置默认值0; - 函数操作; - 使用!=或
阅读全文
摘要:1.<if> <select id="" parameterType="" resultType=""> select * from user where 1 = 1 <if test="username != null"> and username = #{username} </if> <if
阅读全文
摘要:1.添加依赖 1 <dependency> 2 <groupId>com.github.pagehelper</groupId> 3 <artifactId>pagehelper</artifactId> 4 <version>5.1.4</version> 5 </dependency> 2.ya
阅读全文
摘要:返回值 方法 用途 boolean add(E e) 将指定的元素追加到此列表的末尾。 void add(int index, E element) 在此列表中的指定位置插入指定的元素。 boolean addAll(Collection<? extends E> c) 按指定集合的Iterator
阅读全文
摘要:返回值类型 方法 用途 备注 char charAt(int index) 返回 char指定索引处的值。 int compareTo(String anotherString) 按字典顺序比较两个字符串。 值<0:参数字符串在后 值=0:参数字符串与对象字符串相等 值>0:参数字符串在前 Stri
阅读全文
摘要:Java数据类型共分为4类8种: 数据类型 封装器类 字节数 范围 默认值 开辟空间 整型 byte Byte 1 -128 ~ 127 0 8位 short Short 2 -32768(-2^15)~32767(2^15 - 1) 0 16位 int Integer 4 -2,147,483,6
阅读全文