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 implements LimsPrintTemplateService { @Override public LimsPrintTemplateEntity findActiveByTemplateId(String templateId) { if (templateId == null || templateId.isEmpty()) { return null; } QueryWrapper 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); } }