PtlAgreementAttributionServiceImpl.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package com.ydtech.modules.protocol.service.impl;
  2. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  3. import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  4. import com.ydtech.modules.esm.model.EsmInsCompany;
  5. import com.ydtech.modules.protocol.dao.PtlAgreementAttributionMapper;
  6. import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
  7. import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
  8. import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
  9. import org.springframework.stereotype.Service;
  10. import java.util.List;
  11. /**
  12. * @author wenks
  13. * @description 针对表【ptl_agreement_attribution(协议归属信息)】的数据库操作Service实现
  14. * @createDate 2023-07-03 09:31:16
  15. */
  16. @Service
  17. public class PtlAgreementAttributionServiceImpl extends ServiceImpl<PtlAgreementAttributionMapper, PtlAgreementAttribution>
  18. implements PtlAgreementAttributionService {
  19. @Override
  20. public void saveAttribution(String agreementId, EsmInsCompany esmInsCompany, PtlAgreementAttributionDto attribution) {
  21. PtlAgreementAttribution ptlAgreementAttribution = new PtlAgreementAttribution(agreementId, esmInsCompany.getId(), esmInsCompany.getNamesimple(), attribution);
  22. save(ptlAgreementAttribution);
  23. }
  24. @Override
  25. public String selectByCompanyId(String companyId, List<String> filedList) {
  26. LambdaQueryWrapper<PtlAgreementAttribution> wrapper = new LambdaQueryWrapper<>();
  27. for (String s : filedList) {
  28. wrapper.like(PtlAgreementAttribution::getFields, s);
  29. }
  30. wrapper.eq(PtlAgreementAttribution::getInsCompanyId, companyId);
  31. wrapper.last("limit 1");
  32. PtlAgreementAttribution ptlAgreementAttribution = getOne(wrapper);
  33. return ptlAgreementAttribution.getId();
  34. }
  35. }