소스 검색

协议承保规则的bug修复

dongxin 1 년 전
부모
커밋
bc5490c848

+ 2 - 2
commons/src/main/java/com/jzg/commons/config/DataPermissionInterceptor.java

@@ -84,7 +84,7 @@ import java.util.regex.Pattern;
         JSONObject dataScope = JSONObject.parseObject(userDataScope);
         JSONObject dataScope = JSONObject.parseObject(userDataScope);
         //如果用户名为admin  不做数据权限
         //如果用户名为admin  不做数据权限
 
 
-        if (dataScope == null || (dataScope.isEmpty() && baseController.getUserName().equals("admin")) || userSystemCode.equals(SystemConstants.SYSTEM_PLATFORM.getCode())) {
+        if (dataScope == null || dataScope.isEmpty() || (dataScope.isEmpty() && baseController.getUserName().equals("admin")) || userSystemCode.equals(SystemConstants.SYSTEM_PLATFORM.getCode())) {
             return null;
             return null;
         }
         }
         StringBuilder additionalSql = new StringBuilder();
         StringBuilder additionalSql = new StringBuilder();
@@ -141,4 +141,4 @@ import java.util.regex.Pattern;
 
 
         }
         }
     }
     }
-}
+}

+ 4 - 0
commons/src/main/java/com/jzg/commons/entity/po/PtlAgreementUndwrtRulesAttrLink.java

@@ -3,6 +3,7 @@ package com.jzg.commons.entity.po;
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
 
 
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.jzg.commons.core.base.BaseModel;
 import com.jzg.commons.core.base.BaseModel;
 import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.media.Schema;
@@ -48,4 +49,7 @@ public class PtlAgreementUndwrtRulesAttrLink extends BaseModel {
     @TableField(exist = false)
     @TableField(exist = false)
     private String[] minArray;
     private String[] minArray;
 
 
+    @TableField(exist = false)
+    private JSONArray dictLabal;
+
 }
 }

+ 8 - 1
commons/src/main/java/com/jzg/commons/entity/vo/AgreementRulesVo.java

@@ -17,7 +17,7 @@ public class AgreementRulesVo extends BaseModel {
 
 
     /** 协议id */
     /** 协议id */
     @Schema(description = "协议id")
     @Schema(description = "协议id")
-    private Long agreementId;
+    private String agreementId;
 
 
     /** 规则描述 */
     /** 规则描述 */
     @Schema(description = "规则描述")
     @Schema(description = "规则描述")
@@ -29,4 +29,11 @@ public class AgreementRulesVo extends BaseModel {
 
 
     @Schema(description = "费用属性")
     @Schema(description = "费用属性")
     private List<PtlAgreementUndwrtRulesAttr> costsAttrLinks;
     private List<PtlAgreementUndwrtRulesAttr> costsAttrLinks;
+
+    @Schema(description = "费用列表")
+    private List<PtlAgreementCostVo> costVoList;
+
+    @Schema(description = "选中的费用属性id列表")
+    private List<String> attrIdList;
+
 }
 }

+ 1 - 2
gateway/src/main/resources/application-dev.yml

@@ -28,7 +28,6 @@ spring:
         - id: tenant_route
         - id: tenant_route
           uri: http://localhost:8084/
           uri: http://localhost:8084/
           predicates:
           predicates:
-            - Path=/tenant/**,/dept/**,/area/**,/dict/**,/userInfo/**,/sysOrganization/**,/activity/**,/message/**,/messageNotice/**,/poster/**,/pltAgreement/**,/scheme/**
-
+            - Path=/tenant/**,/dept/**,/area/**,/dict/**,/userInfo/**,/sysOrganization/**,/activity/**,/message/**,/messageNotice/**,/poster/**,/agreement/**,/pltAgreement/**,/agreementRules/**,/plt/areaLicense/**
 
 
 
 

+ 1 - 1
gateway/src/main/resources/application-test.yml

@@ -28,7 +28,7 @@ spring:
         - id: tenant_route
         - id: tenant_route
           uri: lb://jzg-organization
           uri: lb://jzg-organization
           predicates:
           predicates:
-            - Path=/tenant/**,/dept/**,/area/**,/dict/**,/userInfo/**,/sysOrganization/**,/activity/**,/message/**,/messageNotice/**,/poster/**
+            - Path=/tenant/**,/dept/**,/area/**,/dict/**,/userInfo/**,/sysOrganization/**,/activity/**,/message/**,/messageNotice/**,,/pltAgreement/**,/agreementRules/**,/poster/**
 
 
 
 
 
 

+ 9 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementUndwrtRulesAttrLinkMapper.java

@@ -2,6 +2,9 @@ package com.jzg.organization.mapper;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 /**
 /**
 * @author dongxin
 * @author dongxin
@@ -11,6 +14,12 @@ import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink;
 */
 */
 public interface PtlAgreementUndwrtRulesAttrLinkMapper extends BaseMapper<PtlAgreementUndwrtRulesAttrLink> {
 public interface PtlAgreementUndwrtRulesAttrLinkMapper extends BaseMapper<PtlAgreementUndwrtRulesAttrLink> {
 
 
+    /**
+     * 获取属性因子列表
+     * @param ruleId
+     * @return
+     */
+    List<PtlAgreementUndwrtRulesAttrLink> queryLinkList(@Param("ruleId") String ruleId);
 }
 }
 
 
 
 

+ 8 - 0
tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementUndwrtRulesAttrLinkService.java

@@ -3,6 +3,8 @@ package com.jzg.organization.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink;
 
 
+import java.util.List;
+
 /**
 /**
 * @author dongxin
 * @author dongxin
 * @description 针对表【ptl_agreement_undwrt_rules_attr_link(协议承保规则属性关联表)】的数据库操作Service
 * @description 针对表【ptl_agreement_undwrt_rules_attr_link(协议承保规则属性关联表)】的数据库操作Service
@@ -10,4 +12,10 @@ import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink;
 */
 */
 public interface PtlAgreementUndwrtRulesAttrLinkService extends IService<PtlAgreementUndwrtRulesAttrLink> {
 public interface PtlAgreementUndwrtRulesAttrLinkService extends IService<PtlAgreementUndwrtRulesAttrLink> {
 
 
+    /**
+     * 查询属性因子列表
+     * @param ruleId
+     * @return
+     */
+    List<PtlAgreementUndwrtRulesAttrLink> queryLinkList(String ruleId);
 }
 }

+ 6 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementUndwrtRulesAttrLinkServiceImpl.java

@@ -6,6 +6,8 @@ import com.jzg.organization.mapper.PtlAgreementUndwrtRulesAttrLinkMapper;
 import com.jzg.organization.service.PtlAgreementUndwrtRulesAttrLinkService;
 import com.jzg.organization.service.PtlAgreementUndwrtRulesAttrLinkService;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.util.List;
+
 /**
 /**
 * @author dongxin
 * @author dongxin
 * @description 针对表【ptl_agreement_undwrt_rules_attr_link(协议承保规则属性关联表)】的数据库操作Service实现
 * @description 针对表【ptl_agreement_undwrt_rules_attr_link(协议承保规则属性关联表)】的数据库操作Service实现
@@ -15,6 +17,10 @@ import org.springframework.stereotype.Service;
 public class PtlAgreementUndwrtRulesAttrLinkServiceImpl extends ServiceImpl<PtlAgreementUndwrtRulesAttrLinkMapper, PtlAgreementUndwrtRulesAttrLink>
 public class PtlAgreementUndwrtRulesAttrLinkServiceImpl extends ServiceImpl<PtlAgreementUndwrtRulesAttrLinkMapper, PtlAgreementUndwrtRulesAttrLink>
     implements PtlAgreementUndwrtRulesAttrLinkService {
     implements PtlAgreementUndwrtRulesAttrLinkService {
 
 
+    @Override
+    public List<PtlAgreementUndwrtRulesAttrLink> queryLinkList(String ruleId) {
+        return baseMapper.queryLinkList(ruleId);
+    }
 }
 }
 
 
 
 

+ 53 - 30
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementUndwrtRulesServiceImpl.java

@@ -1,17 +1,21 @@
 package com.jzg.organization.service.impl;
 package com.jzg.organization.service.impl;
 
 
+import cn.hutool.core.collection.CollUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jzg.commons.entity.dto.AgreementRulesAddParam;
 import com.jzg.commons.entity.dto.AgreementRulesAddParam;
 import com.jzg.commons.entity.dto.AgreementRulesEditParam;
 import com.jzg.commons.entity.dto.AgreementRulesEditParam;
+import com.jzg.commons.entity.dto.CostAgreementParam;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRules;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRules;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttr;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttr;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesDictLabal;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesDictLabal;
 import com.jzg.commons.entity.vo.AgreementRulesVo;
 import com.jzg.commons.entity.vo.AgreementRulesVo;
+import com.jzg.commons.entity.vo.PtlAgreementCostVo;
 import com.jzg.organization.mapper.PtlAgreementUndwrtRulesAttrLinkMapper;
 import com.jzg.organization.mapper.PtlAgreementUndwrtRulesAttrLinkMapper;
 import com.jzg.organization.mapper.PtlAgreementUndwrtRulesAttrMapper;
 import com.jzg.organization.mapper.PtlAgreementUndwrtRulesAttrMapper;
 import com.jzg.organization.mapper.PtlAgreementUndwrtRulesMapper;
 import com.jzg.organization.mapper.PtlAgreementUndwrtRulesMapper;
+import com.jzg.organization.service.PtlAgreementCostService;
 import com.jzg.organization.service.PtlAgreementUndwrtRulesAttrLinkService;
 import com.jzg.organization.service.PtlAgreementUndwrtRulesAttrLinkService;
 import com.jzg.organization.service.PtlAgreementUndwrtRulesAttrService;
 import com.jzg.organization.service.PtlAgreementUndwrtRulesAttrService;
 import com.jzg.organization.service.PtlAgreementUndwrtRulesService;
 import com.jzg.organization.service.PtlAgreementUndwrtRulesService;
@@ -23,7 +27,9 @@ import org.springframework.transaction.annotation.Transactional;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
 import java.util.Objects;
+import java.util.stream.Collectors;
 
 
 /**
 /**
 * @author dongxin
 * @author dongxin
@@ -43,9 +49,23 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
     @Autowired
     @Autowired
     private PtlAgreementUndwrtRulesAttrLinkService agreementUndwrtRulesAttrLinkService;
     private PtlAgreementUndwrtRulesAttrLinkService agreementUndwrtRulesAttrLinkService;
 
 
+    @Autowired
+    private PtlAgreementCostService ptlAgreementCostService;
+
     @Override
     @Override
     public List<AgreementRulesVo> queryList(String agreementId) {
     public List<AgreementRulesVo> queryList(String agreementId) {
         List<AgreementRulesVo> rulesVos = baseMapper.queryList(agreementId);
         List<AgreementRulesVo> rulesVos = baseMapper.queryList(agreementId);
+        if(CollUtil.isNotEmpty(rulesVos)){
+            for (AgreementRulesVo rulesVo : rulesVos) {
+                CostAgreementParam param = new CostAgreementParam();
+                param.setPtlAgreementId(agreementId);
+                param.setCoverRuleId(rulesVo.getId());
+                List<PtlAgreementCostVo> costVos = ptlAgreementCostService.queryByAgreementId(param);
+                if(CollUtil.isNotEmpty(costVos)){
+                    rulesVo.setCostVoList(costVos);
+                }
+            }
+        }
         return rulesVos;
         return rulesVos;
     }
     }
 
 
@@ -54,6 +74,8 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
     public boolean rulesAdd(AgreementRulesAddParam param) {
     public boolean rulesAdd(AgreementRulesAddParam param) {
         // 根据协议id获取最大的序号
         // 根据协议id获取最大的序号
         LambdaQueryWrapper<PtlAgreementUndwrtRules> queryWrapper = new LambdaQueryWrapper<>();
         LambdaQueryWrapper<PtlAgreementUndwrtRules> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(PtlAgreementUndwrtRules::getAgreementId, param.getAgreementId())
+                .eq(PtlAgreementUndwrtRules::getIsDelete, 0);
         queryWrapper.orderByDesc(PtlAgreementUndwrtRules::getOrderNum);
         queryWrapper.orderByDesc(PtlAgreementUndwrtRules::getOrderNum);
         queryWrapper.last("LIMIT 1"); // 只取一个结果
         queryWrapper.last("LIMIT 1"); // 只取一个结果
         PtlAgreementUndwrtRules maxRules = baseMapper.selectOne(queryWrapper);
         PtlAgreementUndwrtRules maxRules = baseMapper.selectOne(queryWrapper);
@@ -65,8 +87,11 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
         List<PtlAgreementUndwrtRulesAttrLink> rulesAttrList = param.getRulesAttrList();
         List<PtlAgreementUndwrtRulesAttrLink> rulesAttrList = param.getRulesAttrList();
         List<PtlAgreementUndwrtRulesAttrLink> costsAttrLink = new ArrayList<>();
         List<PtlAgreementUndwrtRulesAttrLink> costsAttrLink = new ArrayList<>();
         rulesAttrList.forEach(attr -> {
         rulesAttrList.forEach(attr -> {
-            attr.setRulesId(rules.getId());
-            costsAttrLink.add(attr);
+            if (null != attr.getMin() ||  null != attr.getMax()) {
+                attr.setRulesId(rules.getId());
+                attr.setId(null);
+                costsAttrLink.add(attr);
+            }
         });
         });
         agreementUndwrtRulesAttrLinkMapper.insert(costsAttrLink);
         agreementUndwrtRulesAttrLinkMapper.insert(costsAttrLink);
         //获取费用属性
         //获取费用属性
@@ -83,7 +108,7 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
 
 
         // 删除费用因子
         // 删除费用因子
         agreementUndwrtRulesAttrLinkService.remove(new LambdaQueryWrapper<PtlAgreementUndwrtRulesAttrLink>()
         agreementUndwrtRulesAttrLinkService.remove(new LambdaQueryWrapper<PtlAgreementUndwrtRulesAttrLink>()
-                .eq(PtlAgreementUndwrtRulesAttrLink::getRulesId, rules.getId()));
+                .eq(PtlAgreementUndwrtRulesAttrLink::getRulesId, param.getId()));
 
 
         List<PtlAgreementUndwrtRulesAttr> attrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
         List<PtlAgreementUndwrtRulesAttr> attrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
         //再添加属性值
         //再添加属性值
@@ -99,13 +124,12 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
             if (link.getMin() != null && link.getMin().contains(",")) {
             if (link.getMin() != null && link.getMin().contains(",")) {
                 link.setMin(link.getMin().replace(",", ","));
                 link.setMin(link.getMin().replace(",", ","));
             }
             }
-
             PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = attrList.stream()
             PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = attrList.stream()
                     .filter(attr -> attr.getAttrCode().equals(link.getAttrCode()))
                     .filter(attr -> attr.getAttrCode().equals(link.getAttrCode()))
                     .findFirst().orElse(null);
                     .findFirst().orElse(null);
             //单独判断radio  radio中存在0的属性值
             //单独判断radio  radio中存在0的属性值
             link.setRulesId(rules.getId());
             link.setRulesId(rules.getId());
-            link.setId("0");
+            link.setId(null);
             costsAttrLink.add(link);
             costsAttrLink.add(link);
         });
         });
         agreementUndwrtRulesAttrLinkService.saveBatch(costsAttrLink);
         agreementUndwrtRulesAttrLinkService.saveBatch(costsAttrLink);
@@ -120,36 +144,35 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
         PtlAgreementUndwrtRules rules = baseMapper.selectById(ruleId);
         PtlAgreementUndwrtRules rules = baseMapper.selectById(ruleId);
         AgreementRulesVo rulesVo = new AgreementRulesVo();
         AgreementRulesVo rulesVo = new AgreementRulesVo();
         BeanUtils.copyProperties(rules, rulesVo);
         BeanUtils.copyProperties(rules, rulesVo);
-        List<PtlAgreementUndwrtRulesAttrLink> linkList = agreementUndwrtRulesAttrLinkService.list(
-                new LambdaQueryWrapper<PtlAgreementUndwrtRulesAttrLink>()
-                .eq(PtlAgreementUndwrtRulesAttrLink::getRulesId, ruleId));
+        List<PtlAgreementUndwrtRulesAttrLink> linkList = agreementUndwrtRulesAttrLinkService.queryLinkList(ruleId);
 
 
+        List<String> attrIdList = linkList.stream().map(PtlAgreementUndwrtRulesAttrLink::getAttrId).collect(Collectors.toList());
+        rulesVo.setAttrIdList(attrIdList);
         // 获取费用因子属性
         // 获取费用因子属性
         List<PtlAgreementUndwrtRulesAttr> attrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
         List<PtlAgreementUndwrtRulesAttr> attrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
-
+        Map<String, PtlAgreementUndwrtRulesAttr> attrMap = attrList.stream()
+                .collect(Collectors.toMap(PtlAgreementUndwrtRulesAttr::getAttrCode, attr -> attr));
         List<PtlAgreementUndwrtRulesAttr> newAttrList = new ArrayList<>();
         List<PtlAgreementUndwrtRulesAttr> newAttrList = new ArrayList<>();
-        attrList.forEach(attr -> {
-            //处理多选和下拉
-            if ("checkbox".equals(attr.getAttrType()) || "select".equals(attr.getAttrType())) {
-                linkList.stream().filter(link -> link.getAttrCode().equals(attr.getAttrCode()))
-                        .findFirst().ifPresent(z -> {
-                    if (null != z.getMin()) {
-                        attr.setId(z.getId());
-                        attr.setMinArray(z.getMin().split(","));
-                        attr.setMax(z.getMax());
-                        attr.setOperator(z.getOperator());
+        linkList.forEach(link -> {
+            if(attrMap.containsKey(link.getAttrCode())) {
+                PtlAgreementUndwrtRulesAttr attr= attrMap.get(link.getAttrCode());
+                //处理多选和下拉
+                if ("checkbox".equals(attr.getAttrType()) || "select".equals(attr.getAttrType()) || "inputTag".equals(attr.getAttrType())) {
+                    if (null != link.getMin()) {
+                        attr.setId(link.getId());
+                        attr.setMinArray(link.getMin().split(","));
+                        attr.setMax(link.getMax());
+                        attr.setOperator(link.getOperator());
                     }
                     }
-                });
-            }else{
-                linkList.stream().filter(link -> link.getAttrCode().equals(attr.getAttrCode()))
-                        .findFirst().ifPresent(z -> {
-                    attr.setId(z.getId());
-                    attr.setMin(z.getMin());
-                    attr.setMax(z.getMax());
-                    attr.setOperator(z.getOperator());
-                });
+                }else{
+                    attr.setId(link.getId());
+                    attr.setMin(link.getMin());
+                    attr.setMax(link.getMax());
+                    attr.setOperator(link.getOperator());
+                }
+                newAttrList.add(attr);
             }
             }
-            newAttrList.add(attr);
+
         });
         });
         rulesVo.setCostsAttrLinks(newAttrList);
         rulesVo.setCostsAttrLinks(newAttrList);
         return rulesVo;
         return rulesVo;
@@ -189,7 +212,7 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
             if ("checkbox".equals(ptlAgreementUndwrtRulesAttr.getAttrType()) || "select".equals(ptlAgreementUndwrtRulesAttr.getAttrType())) {
             if ("checkbox".equals(ptlAgreementUndwrtRulesAttr.getAttrType()) || "select".equals(ptlAgreementUndwrtRulesAttr.getAttrType())) {
                 desc.append(ptlAgreementUndwrtRulesAttr.getAttrName()).append("包含").append(linkList.get(i).getMin()).append("\n");
                 desc.append(ptlAgreementUndwrtRulesAttr.getAttrName()).append("包含").append(linkList.get(i).getMin()).append("\n");
             }
             }
-            if ("input".equals(ptlAgreementUndwrtRulesAttr.getAttrType())) {
+            if ("inputTag".equals(ptlAgreementUndwrtRulesAttr.getAttrType())) {
                 if (linkList.get(i).getOperator() != null && linkList.get(i).getOperator().equals("1")) {
                 if (linkList.get(i).getOperator() != null && linkList.get(i).getOperator().equals("1")) {
                     desc.append(ptlAgreementUndwrtRulesAttr.getAttrName()).append("包含").append(linkList.get(i).getMin()).append("\n");
                     desc.append(ptlAgreementUndwrtRulesAttr.getAttrName()).append("包含").append(linkList.get(i).getMin()).append("\n");
                 } else {
                 } else {

+ 4 - 1
tenant/organization/src/main/resources/application.yml

@@ -54,6 +54,9 @@ tenant:
     - ptl_agreement_undwrt_rules_attr
     - ptl_agreement_undwrt_rules_attr
     - ptl_agreement_undwrt_rules_dict_labal
     - ptl_agreement_undwrt_rules_dict_labal
     - ptl_area_license
     - ptl_area_license
+    - ptl_agreement_undwrt_rules
+    - ptl_agreement_undwrt_rules_attr_link
+
   ignoreLoginNames:
   ignoreLoginNames:
 
 
 data-scope:
 data-scope:
@@ -72,4 +75,4 @@ data-scope:
     - ptl_scheme_insurance_driving_intention
     - ptl_scheme_insurance_driving_intention
     - ptl_scheme_info
     - ptl_scheme_info
     - ptl_scheme
     - ptl_scheme
-    - sys_activity
+    - sys_activity

+ 16 - 6
tenant/organization/src/main/resources/mapper/PtlAgreementUndwrtRulesAttrLinkMapper.xml

@@ -12,7 +12,6 @@
             <result property="min" column="min" jdbcType="VARCHAR"/>
             <result property="min" column="min" jdbcType="VARCHAR"/>
             <result property="operator" column="operator" jdbcType="VARCHAR"/>
             <result property="operator" column="operator" jdbcType="VARCHAR"/>
             <result property="max" column="max" jdbcType="VARCHAR"/>
             <result property="max" column="max" jdbcType="VARCHAR"/>
-            <result property="systemCode" column="system_code" jdbcType="VARCHAR"/>
             <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
             <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
             <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
             <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
             <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
             <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
@@ -21,10 +20,21 @@
     </resultMap>
     </resultMap>
 
 
     <sql id="Base_Column_List">
     <sql id="Base_Column_List">
-        id,rules_id,attr_id,
-        attr_code,min,operator,
-        max,system_code,create_time,
-        create_by,update_time,update_by,
-        is_delete
+        pl.id,pl.rules_id,
+        pl.attr_code,pl.min,pl.operator,
+        pl.max,pl.create_time,
+        pl.create_by,pl.update_time,pl.update_by,
+        pl.is_delete, pa.id as attrId
     </sql>
     </sql>
+    <select id="queryLinkList" resultType="com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink">
+        SELECT <include refid="Base_Column_List"/>
+        FROM ptl_agreement_undwrt_rules_attr_link pl
+        LEFT JOIN ptl_agreement_undwrt_rules_attr pa on pl.attr_code = pa.attr_code
+        <where>
+            pl.is_delete = 0
+            <if test="ruleId != null and ruleId != ''">
+                and pl.rules_id = #{ruleId}
+            </if>
+        </where>
+    </select>
 </mapper>
 </mapper>

+ 1 - 1
tenant/organization/src/main/resources/mapper/PtlAgreementUndwrtRulesMapper.xml

@@ -27,7 +27,7 @@
         <where>
         <where>
             paur.is_delete = 0
             paur.is_delete = 0
             <if test="agreementId != null and agreementId != ''">
             <if test="agreementId != null and agreementId != ''">
-                paur.agreement_id = #{agreementId}
+                and paur.agreement_id = #{agreementId}
             </if>
             </if>
         </where>
         </where>
         ORDER BY paur.order_num ASC
         ORDER BY paur.order_num ASC