<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Miss_SquarePants的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/Miss_SquarePants</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; Miss_SquarePants]]></copyright><item><title><![CDATA[Variable used in lambda expression should be final or effectively final]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/131973255</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/131973255</guid><author>Miss_SquarePants</author><pubDate>Fri, 28 Jul 2023 09:34:56 +0800</pubDate><description><![CDATA[如果您尝试在lambda表达式捕获后修改变量x的值，编译器将显示一个错误，指示在lambda表达式中使用的变量应该是final或effectively final的。在Java中，当在lambda表达式中使用一个变量时，该变量应该是"final"或"effectively final"。在这个例子中，变量x是effectively final的，因为它在被赋值为10后没有被修改。为了修复这个问题，请确保在lambda表达式中使用的任何变量都是effectively final的，并且在被捕获后没有被修改。]]></description><category></category></item><item><title><![CDATA[mybatis Long类型传值为0时bug记录]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124783772</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124783772</guid><author>Miss_SquarePants</author><pubDate>Sun, 15 May 2022 16:28:36 +0800</pubDate><description><![CDATA[在mbatis中使用Xml配置sql语句时，出现了这样一个问题。当我传入的参数为0时候不会加条件判断语句，若为其他值就是正常的，然后发现是因为传入数值0去做判断时，mybatis会把参数0当成是空字符串去判断而引起查询结果错误。下面是我之前配置的sql语句：
&lt;if test="pd.pid != null  and pd.pid != ' ' "&gt;
   and pid=${pd.pid}
&lt;/if&gt;

解决办法：
当传入的参数有0时，只判断！=null即可，所以去掉【pd.pid]]></description><category></category></item><item><title><![CDATA[设计模式-装饰者模式]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124772720</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124772720</guid><author>Miss_SquarePants</author><pubDate>Sat, 14 May 2022 19:34:12 +0800</pubDate><description><![CDATA[上代码
饮料类

```java
//饮料类
public abstract class Beverage {
    public abstract double cost();
}```


配料类
public abstract class ToppingDecorator extends Beverage{
}

奶茶类
public class MilkTea extends Beverage {
    @Override
    public double cost() {
        S]]></description><category></category></item><item><title><![CDATA[【设计模式-观察者模式】]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124771838</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124771838</guid><author>Miss_SquarePants</author><pubDate>Sat, 14 May 2022 19:08:09 +0800</pubDate><description><![CDATA[definition: One-to-many dependency O objects. when one object changes states, all of its dependents are notified  and updated automatically.
观察者模式是基于对象的状态变化和观察者的通讯，以便他们作出相应的操作。简单的例子就是一个天气系统，当天气变化时必须在展示给公众的视图中进行反映。这个视图对象是一个主体，而不同的视图是观察者。

被观察者对象
public clas]]></description><category></category></item><item><title><![CDATA[线程池的创建]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124747354</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124747354</guid><author>Miss_SquarePants</author><pubDate>Fri, 13 May 2022 11:45:44 +0800</pubDate><description><![CDATA[一、自定义线程池
1、 线程池处理Runnable任务
创建线程线，让线程池创建线程执行任务，使用execute方法
public class ThreadPoolDemon1 {
    public static void main(String[] args) {
        ExecutorService pool = new ThreadPoolExecutor(3,5,5,
                                                     TimeUn]]></description><category></category></item><item><title><![CDATA[线程的创建方式]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124732503</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124732503</guid><author>Miss_SquarePants</author><pubDate>Thu, 12 May 2022 17:58:57 +0800</pubDate><description><![CDATA[线程的创建方式
1、继承Thread类实现
如何实现？

继承Thread类
重写run方法
创建线程对象
调用start()方法

/**
 * @author Leah
 * @Description:多线程创建方式一：继承Thread类实现
 * @Title: ThreadDemo1
 * @Package com.threadPool.Thread
 * @date 2022-05-12 14:55
 */
public class ThreadDemo1 {
    public static ]]></description><category></category></item><item><title><![CDATA[【设计模式Design Pattern】- 单例模式]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124732096</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124732096</guid><author>Miss_SquarePants</author><pubDate>Thu, 12 May 2022 15:30:48 +0800</pubDate><description><![CDATA[单例模式（Singleton Pattern）属于属于创建型模式，focus on the instance creation. 涉及一个单一的类来创建对象，和直接new的区别是确保了只有单个对象被创建。
1、饿汉式
public class LazySingleton {
 
    /**
     * 构造方法私有，保证了在外部是无法来实例化对象；
     */
    private LazySingleton(){
         
    }
     
    /**
     * 饿汉式]]></description><category></category></item><item><title><![CDATA[mysql中in查询索引失效]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124236679</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/124236679</guid><author>Miss_SquarePants</author><pubDate>Sun, 17 Apr 2022 21:27:13 +0800</pubDate><description><![CDATA[grade 表数据，stuname已经建立了索引，使用in和not in有时候走索引有时候不走

in 走索引

2、in 不走索引

因为大部分数据都符合in条件筛选

3、但是使用覆盖索引，又走索引了


4、not in 不走索引


5、使用覆盖索引，not in也走索引了

类似 &lt;&gt; 和not in一样，都不走索引，不过用覆盖索引可以避免索引失效



...]]></description><category></category></item><item><title><![CDATA[【无标题】]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/123625331</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/123625331</guid><author>Miss_SquarePants</author><pubDate>Mon, 21 Mar 2022 00:37:35 +0800</pubDate><description><![CDATA[Nacos安装指南
1.Windows安装
开发阶段采用单机安装即可。
1.1.下载安装包
在Nacos的GitHub页面，提供有下载链接，可以下载编译好的Nacos服务端或者源代码：
GitHub主页：https://github.com/alibaba/nacos
GitHub的Release下载页：https://github.com/alibaba/nacos/releases
如图：

已经准备了安装包：

windows版本使用nacos-server-1.4.1.zip包即可。
1.2.解压
]]></description><category></category></item><item><title><![CDATA[Oracle子查询空指问题]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120123586</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120123586</guid><author>Miss_SquarePants</author><pubDate>Sun, 05 Sep 2021 23:27:13 +0800</pubDate><description><![CDATA[案例：查询不是老板的员工
那么只需要查出员工号不在管理员号范围内
select * from emp where empno not in (select MGR from emp);
结果

原因：子查询结果集出现了空值

–只要子查询中返回值包含null值，不要使用not in，因为not in 等同与&lt;&gt; ALL（不等于所有值），就包括&lt;&gt;null ，然后不管是=null还是&lt;&gt;null 都是否，因为判断为空用is null，is not null
比如，a not]]></description><category></category></item><item><title><![CDATA[相关子查询]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120123223</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120123223</guid><author>Miss_SquarePants</author><pubDate>Sun, 05 Sep 2021 22:54:08 +0800</pubDate><description><![CDATA[相关子查询：将主查询中的值作为参数传递给子查询：
Oracle执行顺序：
子查询一般先执行子查询，再执行主查询，相关子查询例外，本质上来说还是先执行了子查询，只不过顺序是 子-主-子而已
例子：找到员工表中薪水大于本部门平均薪水的员工的员工号、姓名、薪水、本部门平均薪水


...]]></description><category></category></item><item><title><![CDATA[Oracle rownum]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120122960</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120122960</guid><author>Miss_SquarePants</author><pubDate>Sun, 05 Sep 2021 22:36:27 +0800</pubDate><description><![CDATA[rownum是伪列，oracle默认生成行号
行号需要注意的两个问题
1、行号永远按照默认的顺序生成
2、行号只能使用&lt;，&lt;=；不能使用&gt;，&gt;=
例子：找出员工表工资最高的前三名
select rownum,empno,ename,sal
from (select * from emp order by sal desc)
where rownum&lt;=3;
将排序后的表作为一个集合放到from（）中 生成一个新表
重新再查询rownum 就可以让rownum也实现排序了


.]]></description><category></category></item><item><title><![CDATA[自连接存在的问题]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120122260</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120122260</guid><author>Miss_SquarePants</author><pubDate>Sun, 05 Sep 2021 22:09:45 +0800</pubDate><description><![CDATA[（1）自连接不适合操作大表，也就是记录多的表，原因是自连接至少有两张表参与，并进行笛卡尔全集，连接之后的记录数就是单张表记录数的平方（笛卡尔积行数是两张表行数的乘积），如果有三张表记录数就是原来的三次方，如果原来的表包含的记录数过多，连接之后的结果就会很大，所以自连接不适合操作大表。
解决办法：层次查询。注意层次查询是单表查询，不存在第二张表！因为只有在一张表的情况下才不会产生笛卡尔积，才能解决这个问题。
层次查询在某些情况下可以替代自连接，本质上是单表查询。
例子：
查询员工和老板的姓名
自连接查询：

]]></description><category></category></item><item><title><![CDATA[Oracle外连接]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120122048</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120122048</guid><author>Miss_SquarePants</author><pubDate>Sun, 05 Sep 2021 21:45:37 +0800</pubDate><description><![CDATA[按部门统计员工人数，要求显示：部门号，部门名称，人数

相当于

(右外连接在等号左边添加“（+）”，左外连接是在等号右边添加“（+）”)
（1）左外连接：当连接条件不成立的时候，等号左边的表仍然被包含
（2）右外连接：当连接条件不成立的时候，等号右边的表仍然被包含

...]]></description><category></category></item><item><title><![CDATA[Oracle多表不等值连接]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120121752</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120121752</guid><author>Miss_SquarePants</author><pubDate>Sun, 05 Sep 2021 21:30:32 +0800</pubDate><description><![CDATA[查询员工信息，要求显示：员工号，姓名，月薪，薪水级别



]]></description><category></category></item><item><title><![CDATA[oracle分组函数的rollup]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120121533</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120121533</guid><author>Miss_SquarePants</author><pubDate>Sun, 05 Sep 2021 21:16:35 +0800</pubDate><description><![CDATA[group by rollup(a,b)
相当于

    group by a,b  

    +

    group by a 

    +

    group by null 

例:
select deptno,job,sum(sal) from emp group by rollup(deptno,job);

    先按照不同部门不同职位查出薪资总和显示(deptno,job,sum(sal))

    再按照不同部门查出薪资总和显示(deptno,sum(sal))

    再查]]></description><category></category></item><item><title><![CDATA[分组函数的嵌套]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120121468</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120121468</guid><author>Miss_SquarePants</author><pubDate>Sun, 05 Sep 2021 21:14:02 +0800</pubDate><description><![CDATA[示例：求部门平均工资的最大值
1、通过AVG函数求出每个部门的平均工资
2、嵌套MAX函数求出部门平均工资的最大值
select max(avg(sal)) from emp group by deptno;
等于
select max(avgsal) from (select deptno,avg(sal) avgsal from emp group by emp.deptno)

...]]></description><category></category></item><item><title><![CDATA[having 和where的区别]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120121232</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120121232</guid><author>Miss_SquarePants</author><pubDate>Sun, 05 Sep 2021 21:00:13 +0800</pubDate><description><![CDATA[1.where 条件中不能使用组函数，having 可以。
2.在输入顺序上，where先过滤后分组
(比如select deptno,avg(sal)
from emp
where deptno=10
group by deptno;
)，having先分组再过滤，
(比如select deptno,avg(sal)
from emp
group by deptno
having deptno=10;)
要根据实际情况选择
3.如果两个可以通用，从sql优化的角度上看，尽量使用where.（where先过]]></description><category></category></item><item><title><![CDATA[使用分组函数空指问题]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120120883</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/120120883</guid><author>Miss_SquarePants</author><pubDate>Sun, 05 Sep 2021 20:50:08 +0800</pubDate><description><![CDATA[分组函数的空值
count（*）与count（comm）区别，
*是指所有记录，comm有空值的时候count（comm）不计数
select count(nvl(comm,0)) from emp;
注意：sum(comm)/count(*):统计的是所有人的平均值（含该项为null的人员）
sum(comm)/count(comm)&amp;avg(comm)是统计comm非空的人员平均数
null会导致计算错误，需要使用nvl函数转为非空值


...]]></description><category></category></item><item><title><![CDATA[Spring mvc@RequestMapping的method参数默认值是什么？]]></title><link>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/107413943</link><guid>https://blog.youkuaiyun.com/Miss_SquarePants/article/details/107413943</guid><author>Miss_SquarePants</author><pubDate>Fri, 17 Jul 2020 17:38:18 +0800</pubDate><description><![CDATA[Spring mvc@RequestMapping的method参数默认值是什么？
如果配置参数，要与前端参数一致
或者不写，自动与前端参数配置一致
@RequestMapping(value = "/add", method = RequestMethod.POST)
或者直接不配置method

html页面


...]]></description><category></category></item></channel></rss>