2022年03月

1、background-position概念:

<div class="box"></div>
.box{
           margin-top: 50px;
           margin-left: 50px;
           width: 500px; /*box的宽度 远大于雪碧图宽度*/
           height: 71px; /*box的高度 和雪碧图高度一致*/
           background-image: url(../img/jingling.png); /*将雪碧图置为背景*/
           background-repeat: no-repeat; /*设置背景不重复*/
           background-color: #aaa;
           background-position: 0px 0px; /*设置背景图起始位置为0px 0px */
       }  

background-position概念:设置背景图像起始位置。把box想象成一个向下向右为正的坐标系,并且box位置保持不动。那么 -91px是该雪碧图在X轴起始位置,可以看到雪碧图的第一帧已经超出box的正坐标系了,所以它看不见了。始终记住一个概念,background-position设置的是雪碧图相对于盒子的起始位置。
在这里插入图片描述

2、前端判断是否为json字符串:

function isJsonStrJ(str) {
        if (typeof str == 'string') {
            try {
                var obj=JSON.parse(str);
                console.log('转换成功:'+obj);
                return true;
            } catch(e) {
                console.log('error:'+str+'!!!'+e);
                return false;
            }
        }else{
			 console.log('It is not a string!')
			 return false;
		}       
 } 

3.markdown快捷键
https://www.jianshu.com/p/228b648734d6

4、@Around之后切点方法需要返回值:

@Around("execution(* cn.com.xalead.spring.MeInterface.*(..)) || execution(* cn.com.xalead.spring.KingInterface.*(..))")
public Object test(ProceedingJoinPoint proceeding) {
    Object o = null;
    try {
        //执行
        o = proceeding.proceed(proceeding.getArgs());
    } catch (Throwable e) {
        e.printStackTrace();
    }
    return o;
}

5、Navicat Oracle "ORA-00942: 表或视图不存在 "的原因和解决方法:
因为orcle是大小写敏感,执行sql的时候会默认把表名和列名变为大写。(推荐sql全用大写)

  1. 连接调节成DBA
  2. 把表名和列名变成大写
  3. 把表名和列名用""引起来

6、修复tomcat启动时 黑框框乱码问题
找到一个名为 “logging.properties” 的文件,打开这个文本文件,找到如下配置项:
java.util.logging.ConsoleHandler.encoding = UTF-8
将 UTF-8 修改为 GBK,修改后的效果为:
java.util.logging.ConsoleHandler.encoding = GBK

7、Map 和 MultiValueMap 的区别

	
	// MultiValueMap 一个 key 可以对应多个 value
	MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
	map.add("name", "小明");
	map.add("name", "小红");
	System.out.println(map.toString());

	// Map 一个 key 对应一个 value 
	Map<String, String> hashMap = new HashMap<String, String>();
	hashMap.put("name", "小明");
	hashMap.put("name", "小红");
	System.out.println(hashMap.toString());



	--------------output---------------

	{name=[小明, 小红]}
	{name=小红}

8、模糊查询写法

    <!--根据条件分页查询人员以及部门信息-->
    <select id="queryBatchSealsInfoByRetrieval" parameterType="map" resultMap="BatchSealsResultMap">
        SELECT * FROM
        (
          SELECT ry.YGBH, ry.YGMC, bm.BMBH, bm.BMMC, ROWNUM rn FROM DM_RYDM ry LEFT JOIN PBMDM bm ON ry.BMBH = bm.BMBH
          WHERE (ry.YGBH || ry.YGMC || bm.BMBH || bm.BMMC)
          LIKE CONCAT(CONCAT('%',#{retrieval}), '%')
        )
        WHERE rn &gt;#{start} AND rn &lt;=#{end}
    </select>

9、SQL中ANY和ALL的区别:

字面意思就是:ANY是任一,ALL是全部

select * from student where 班级=‘01’ and age > all (select age from student where 班级=‘02’);
查询出01班中,年龄大于 02班所有 的同学
相当于
select * from student where 班级=‘01’ and age > (select max(age) from student where 班级=‘02’);

select * from student where 班级=‘01’ and age > any (select age from student where 班级=‘02’);
查询出01班中,年龄大于02班任意一个的同学
相当于
select * from student where 班级=‘01’ and age > (select min(age) from student where 班级=‘02’);

如果是大于ALL就是大于最大值,如果是小于ALL就是小于最小值

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值