删除所有 as any.

This commit is contained in:
lijiahang
2023-09-21 17:08:33 +08:00
parent d236e57f85
commit 3e55276a13
14 changed files with 40 additions and 45 deletions

View File

@@ -1,5 +1,7 @@
package com.orion.ops.module.asset.dao;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.orion.ops.framework.mybatis.core.mapper.IMapper;
import com.orion.ops.module.asset.entity.domain.HostIdentityDO;
import org.apache.ibatis.annotations.Mapper;
@@ -21,6 +23,11 @@ public interface HostIdentityDAO extends IMapper<HostIdentityDO> {
* @param keyId keyId
* @return effect
*/
int setKeyWithNull(@Param("keyId") Long keyId);
default int setKeyWithNull(@Param("keyId") Long keyId) {
LambdaUpdateWrapper<HostIdentityDO> updateWrapper = Wrappers.<HostIdentityDO>lambdaUpdate()
.set(HostIdentityDO::getKeyId, null)
.eq(HostIdentityDO::getKeyId, keyId);
return this.update(null, updateWrapper);
}
}

View File

@@ -21,10 +21,4 @@
id, name, username, password, key_id, create_time, update_time, creator, updater, deleted
</sql>
<update id="setKeyWithNull">
UPDATE host_identity
SET key_id = NULL
WHERE key_id = #{keyId}
</update>
</mapper>