证书标签
This commit is contained in:
@@ -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();
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user