| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- 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.protocol.dao.PtlAgreementUndwrtRulesMapper;
- import com.ydtech.modules.protocol.entity.po.PtlAgreementUndwrtRules;
- import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
- import com.ydtech.modules.protocol.service.PtlAgreementUndwrtRulesService;
- import com.ydtech.modules.protocol.utils.AssertionUtils;
- import org.springframework.stereotype.Service;
- import org.springframework.transaction.annotation.Transactional;
- import java.util.List;
- /**
- * @author CXP
- * @description 针对表【ptl_agreement_undwrt_rules(协议产品费用)】的数据库操作Service实现
- * @createDate 2023年12月20日22:25:57
- */
- @Service
- public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreementUndwrtRulesMapper, PtlAgreementUndwrtRules>
- implements PtlAgreementUndwrtRulesService {
- private final PtlAgreementAttributionService ptlAgreementAttributionService;
- public PtlAgreementUndwrtRulesServiceImpl(PtlAgreementAttributionService ptlAgreementAttributionService) {
- this.ptlAgreementAttributionService = ptlAgreementAttributionService;
- }
- @Override
- public void deleteByAgreementId(String agreementId) {
- baseMapper.delete(getByAgreementIdWrapper(agreementId));
- }
- @Override
- public List<PtlAgreementUndwrtRules> getByAgreementId(String agreementId) {
- List<PtlAgreementUndwrtRules> ptlAgreementUndwrtRulesList = baseMapper.selectList(getByAgreementIdWrapper(agreementId));
- return ptlAgreementUndwrtRulesList;
- }
- @Override
- @Transactional
- public void saveBatchProductCosts(String agreementId, List<PtlAgreementUndwrtRules> ptlAgreementUndwrtRulesList) {
- if (ptlAgreementUndwrtRulesList != null && !ptlAgreementUndwrtRulesList.isEmpty()) {
- boolean b = saveBatch(ptlAgreementUndwrtRulesList);
- AssertionUtils.isSucceed(b, "批量添加承保规则失败");
- }
- }
- /**
- * 通过协议ID 获取需要进行匹配的核保规则
- * @param agreementId
- * @return
- */
- @Override
- public List<PtlAgreementUndwrtRules> selectVliadRules(String agreementId){
- LambdaQueryWrapper<PtlAgreementUndwrtRules> wrapper = new LambdaQueryWrapper<>();
- wrapper.eq(PtlAgreementUndwrtRules::getAgreementId, agreementId);
- wrapper.in(PtlAgreementUndwrtRules::getValidInd,1);
- List<PtlAgreementUndwrtRules> ptlAgreementProductCosts = baseMapper.selectList(wrapper);
- return ptlAgreementProductCosts;
- }
- }
|