更新历史版本排序权重

This commit is contained in:
钱涛 2022-07-14 15:56:48 +08:00
parent bb8c863bcc
commit 92977e81c3
3 changed files with 11 additions and 1 deletions

View File

@ -62,4 +62,6 @@ public interface SalarySysConfMapper {
int delete(SalarySysConfPO salarySysConf);
SalarySysConfPO getOneByCode(String confKey);
int countByCode(String confKey);
}

View File

@ -227,5 +227,11 @@
AND conf_key = #{confKey}
</select>
<select id="countByCode" resultType="java.lang.Integer">
SELECT count(0)
FROM hrsa_salary_sys_conf t
WHERE delete_type = 0
AND conf_key = #{confKey}
</select>
</mapper>

View File

@ -30,7 +30,7 @@ public class InitServiceImpl {
//当前版本
SalarySysConfPO currentVersion = getSalarySysConfMapper().getOneByCode("currentVersion");
//前一个版本
SalarySysConfPO previousVersion = getSalarySysConfMapper().getOneByCode("previousVersion");
int orderWeight = getSalarySysConfMapper().countByCode("previousVersion");
if (currentVersion == null) {
//初始化版本
SalarySysConfPO current = SalarySysConfPO.builder()
@ -39,6 +39,7 @@ public class InitServiceImpl {
.confValue(version)
.title("当前版本")
.module("basic")
.orderWeight(0)
.createTime(date)
.updateTime(date)
.deleteType(0).build();
@ -53,6 +54,7 @@ public class InitServiceImpl {
.confValue(currentVersion.getConfValue())
.title("上一个版本")
.module("basic")
.orderWeight(orderWeight)
.createTime(date)
.updateTime(date)
.deleteType(0)