/***
* Deque 测试
*/
@Test
public void test1() {
Deque<Integer> candidates = new LinkedList<>();
for(int i=0;i<5;i++) {
candidates.add(i);// 和 offer 一样是放在结尾 但是 push 是放在开头
}
while(!candidates.isEmpty()) {
// System.out.println(candidates.pollFirst()); //0 1 2 3 4 队列
// System.out.println(candidates.pollLast()); //4 3 2 1 0 栈
}
}
mybatis 插入
<insert id="save">
insert into tabname
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test=" userId != null"> userId ,</if>
<if test=" note != null"> note ,</if>
<if test=" operatorId != null"> operatorId ,</if>
<if test=" operatorName!= null"> operatorName ,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test=" userId != null"> #{userId },</if>
<if test=" note != null"> #{note },</if>
<if test=" operatorId != null"> #{operatorId },</if>
<if test=" operatorName!= null"> #{operatorName },</if>
</trim>
</insert>