git撤销修改
10月 312019
git撤销修改
讲分布式Id生成的文章很多,其中雪花算法也提到过多次,本文不再赘述,只是给出资源汇总,仅供参考。
twitter原版,scala编写,地址:https://github.com/twitter-archive/snowflake
代码源地址 参见
介绍参见Leaf——美团点评分布式ID生成系统 https://tech.meituan.com/2017/04/21/mt-leaf.html 代码参见https://github.com/Meituan-Dianping/Leaf
<where>
<trim suffixOverrides="," >
<if test="id != null and id != ''" >
and id = #{id}
</if>
<if test="name != null and name != ''" >
and name like concat('%',#{name},'%')
</if>
</trim>
</where>
假设查询person表,参数类型为XXXVo,XXXVo中包含一个List对象,保存了状态列表,此时可以参考如下查询
<select id="queryXXX" parameterType="XXXVo"
resultMap="XXXResult">
select *
from person
WHERE 1=1
<if test="statusFilter != null and statusFilter.size() > 0">
and status in
<foreach collection="statusFilter" item="statusId" index="i" open="(" close=")" separator=",">
#{statusId}
</foreach>
</if>
ORDER BY DEPTID
</select>