| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- 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<PtlAgreementAttributionMapper, PtlAgreementAttribution>
- 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<String> filedList) {
- LambdaQueryWrapper<PtlAgreementAttribution> 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();
- }
- }
|