刘光辉
昨天 bb638871a7fb692d80f1b7a758f991dc0879002c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package jnpf.limsService.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import jnpf.base.service.SuperServiceImpl;
import jnpf.limsEntity.LimsPrintTemplateEntity;
import jnpf.limsMapper.LimsPrintTemplateMapper;
import jnpf.limsService.LimsPrintTemplateService;
import org.springframework.stereotype.Service;
 
@Service
public class LimsPrintTemplateServiceImpl
        extends SuperServiceImpl<LimsPrintTemplateMapper, LimsPrintTemplateEntity>
        implements LimsPrintTemplateService {
 
    @Override
    public LimsPrintTemplateEntity findActiveByTemplateId(String templateId) {
        if (templateId == null || templateId.isEmpty()) {
            return null;
        }
        QueryWrapper<LimsPrintTemplateEntity> wrapper = new QueryWrapper<>();
        wrapper.eq("template_id", templateId);
        wrapper.eq("is_active", 1);
        wrapper.and(w -> w.isNull("f_delete_mark").or().ne("f_delete_mark", 1));
        wrapper.last("LIMIT 1");
        return this.getOne(wrapper);
    }
}