package com.ydtech.modules.protocol.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ydtech.modules.esm.model.EsmInsCompany; import com.ydtech.modules.protocol.dao.PtlAgreementAttributionMapper; import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto; import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution; import com.ydtech.modules.protocol.service.PtlAgreementAttributionService; import org.springframework.stereotype.Service; import java.util.List; /** * @author wenks * @description 针对表【ptl_agreement_attribution(协议归属信息)】的数据库操作Service实现 * @createDate 2023-07-03 09:31:16 */ @Service public class PtlAgreementAttributionServiceImpl extends ServiceImpl implements PtlAgreementAttributionService { @Override public void saveAttribution(String agreementId, EsmInsCompany esmInsCompany, PtlAgreementAttributionDto attribution) { PtlAgreementAttribution ptlAgreementAttribution = new PtlAgreementAttribution(agreementId, esmInsCompany.getId(), esmInsCompany.getNamesimple(), attribution); save(ptlAgreementAttribution); } @Override public String selectByCompanyId(String companyId, List filedList) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); for (String s : filedList) { wrapper.like(PtlAgreementAttribution::getFields, s); } wrapper.eq(PtlAgreementAttribution::getInsCompanyId, companyId); wrapper.last("limit 1"); PtlAgreementAttribution ptlAgreementAttribution = getOne(wrapper); return ptlAgreementAttribution.getId(); } }