package org.jeecg.modules.print.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.print.entity.PrintTemplate;
import org.jeecg.modules.print.mapper.PrintTemplateMapper;
import org.jeecg.modules.print.service.IPrintTemplateService;
import org.springframework.stereotype.Service;

/**
 * 打印模板 Service 实现
 */
@Service
public class PrintTemplateServiceImpl extends ServiceImpl<PrintTemplateMapper, PrintTemplate> implements IPrintTemplateService {

    @Override
    public PrintTemplate getByCode(String templateCode) {
        LambdaQueryWrapper<PrintTemplate> q = new LambdaQueryWrapper<>();
        q.eq(PrintTemplate::getTemplateCode, templateCode);
        q.last("LIMIT 1");
        return getOne(q);
    }
}
