数据字段唯一性校验

        
        LambdaQueryWrapper lambdaQuery = Wrappers.lambdaQuery();
        lambdaQuery.eq(TSoxAuditInfo::getAuditId, param.getAuditId());
        TSoxAuditInfo auditIdOne = this.getOne(lambdaQuery);
        //新增
        if (param.getId() == null) {
            MyAssert.isTrue(auditIdOne == null, "audit_id_repeat");
        } else {
            //查询出来的对象id 与 原对象id不同
            if (auditIdOne != null && !param.getId().equals(auditIdOne.getId())) {
               
                MyAssert.isTrue(Boolean.FALSE, "audit_id_repeat");

            }
        }

你可能感兴趣的:(java,前端,javascript)