package com.hz.pm.api.signature.service.impl;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hz.pm.api.signature.entity.CompanySignature;
import com.hz.pm.api.signature.mapper.CompanySignatureMapper;
import com.hz.pm.api.signature.service.ICompanySignatureService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Lierbao
 * @since 2023-02-10
 */
@Service
public class CompanySignatureServiceImpl extends ServiceImpl<CompanySignatureMapper, CompanySignature> implements ICompanySignatureService {

    @Override
    public CompanySignature getByOrganizationCode(String orgCode) {
        if (StringUtils.isBlank(orgCode)) {
            return null;
        }
        return this.getOne(Wrappers.lambdaQuery(CompanySignature.class)
                .eq(CompanySignature::getOrganizationCode, orgCode));
    }
}
