证书标签

This commit is contained in:
wuchunlei
2025-04-03 11:14:25 +08:00
parent d4cfd54ed3
commit 49351eb1f8
6 changed files with 200 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
package com.peanut.modules.common.dao;
import com.github.yulichang.base.MPJBaseMapper;
import com.peanut.modules.common.entity.UserCertificateLabel;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface UserCertificateLabelDao extends MPJBaseMapper<UserCertificateLabel> {
}

View File

@@ -1,5 +1,6 @@
package com.peanut.modules.common.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
@@ -13,6 +14,8 @@ public class UserCertificate {
@TableId
private Integer id;
private Integer labelId;
private String title;
//证书类型A a证 B b证 ZK自考
@@ -35,4 +38,7 @@ public class UserCertificate {
@TableLogic
private Integer delFlag;
@TableField(exist = false)
private MyUserEntity user;
}

View File

@@ -0,0 +1,31 @@
package com.peanut.modules.common.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.List;
@Data
@TableName("user_certificate_label")
public class UserCertificateLabel {
@TableId
private Integer id;
@TableLogic
private Integer delFlag;
private Integer pid;
private String title;
private Integer sort;
private Integer isLast;
@TableField(exist = false)
private List<UserCertificateLabel> children;
}

View File

@@ -0,0 +1,12 @@
package com.peanut.modules.common.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.modules.common.entity.UserCertificateLabel;
import java.util.List;
public interface UserCertificateLabelService extends IService<UserCertificateLabel> {
List<UserCertificateLabel> userCertificateLabelList();
}

View File

@@ -0,0 +1,36 @@
package com.peanut.modules.common.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.UserCertificateLabelDao;
import com.peanut.modules.common.entity.CourseMedicine;
import com.peanut.modules.common.entity.UserCertificateLabel;
import com.peanut.modules.common.service.UserCertificateLabelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service("commonUserCertificateLabelService")
public class UserCertificateLabelServiceImpl extends ServiceImpl<UserCertificateLabelDao, UserCertificateLabel> implements UserCertificateLabelService {
@Override
public List<UserCertificateLabel> userCertificateLabelList() {
return this.labels(0);
}
private List<UserCertificateLabel> labels(int id){
List<UserCertificateLabel> list = this.list(new LambdaQueryWrapper<UserCertificateLabel>()
.eq(UserCertificateLabel::getPid, id)
.orderByAsc(UserCertificateLabel::getSort));
for (UserCertificateLabel label : list){
if(label.getIsLast()!=1){
List<UserCertificateLabel> childrens = this.labels(label.getId());
label.setChildren(childrens);
}
}
return list;
}
}