update IdGeneratorService

This commit is contained in:
Turbolisten 2021-10-16 18:35:04 +08:00
parent 98d80a0a03
commit 0549798445
2 changed files with 1 additions and 34 deletions

View File

@ -1,17 +0,0 @@
package net.lab1024.smartadmin.service.module.support.idgenerator.domain;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @Auther: 罗伊
* @Date: 2018/8/7 0007 13:33
* @Description:
*/
@Data
public class IdGeneratorLastNumberDTO {
private LocalDateTime updateTime;
private Long lastNumber;
private LocalDateTime databaseTime;
}

View File

@ -2,6 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.lab1024.smartadmin.service.module.support.idgenerator.IdGeneratorRecordDao">
<!-- 查询最后生成记录 -->
<select id="selectHistoryLastNumber" resultType="net.lab1024.smartadmin.service.module.support.idgenerator.domain.IdGeneratorRecordEntity">
select * from t_id_generator_record
where generator_id = #{generatorId}
@ -11,21 +12,4 @@
ORDER BY id DESC LIMIT 1
</select>
<update id="replaceIdGeneratorRecord">
UPDATE t_id_generator_record
<set>
<if test="null != year">
and `year`= #{year}
</if>
<if test="null != month">
and `month`= #{month}
</if>
<if test="null != day">
and `day`= #{day}
</if>
</set>
where generator_id = #{generatorId}
</update>
</mapper>