package com.jeequan.jeepay.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jeequan.jeepay.core.constants.CS;
import com.jeequan.jeepay.db.entity.MchQrcShell;
import com.jeequan.jeepay.service.mapper.MchQrcShellMapper;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 码牌模板表 服务实现类
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2022-01-17
 */
@Service
public class MchQrcShellService extends ServiceImpl<MchQrcShellMapper, MchQrcShell> {

    /**
     * 根据类型获取是否是默认模板
     * @param sysType
     * @return
     */
    public MchQrcShell getDefaultTemplate(String sysType) {
        LambdaQueryWrapper<MchQrcShell> gw = MchQrcShell.gw().eq(MchQrcShell::getSysType,sysType).eq(MchQrcShell::getIsDefault, CS.YES);
        return baseMapper.selectOne(gw);
    }
}
