Kaynağa Gözat

增加缺少的is_delete字段

jiakai 4 ay önce
ebeveyn
işleme
096162437f
18 değiştirilmiş dosya ile 437 ekleme ve 391 silme
  1. 6 0
      commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatchAction.java
  2. 7 0
      commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatchAfterAction.java
  3. 8 4
      commons/src/main/java/com/jzg/commons/entity/po/PtlNewCarJudgeRules.java
  4. 7 0
      commons/src/main/java/com/jzg/commons/entity/scheme/po/InsBusinessInsurance.java
  5. 7 0
      commons/src/main/java/com/jzg/commons/entity/scheme/po/InsBusinessInsuranceOption.java
  6. 1 1
      tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementCostExternalMapper.java
  7. 2 1
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java
  8. 36 30
      tenant/organization/src/main/resources/mapper/InsBusinessInsuranceMapper.xml
  9. 38 33
      tenant/organization/src/main/resources/mapper/InvAccountCardMapper.xml
  10. 19 19
      tenant/organization/src/main/resources/mapper/InvAccountMapper.xml
  11. 7 6
      tenant/organization/src/main/resources/mapper/NewCarJudgeRulesMapper.xml
  12. 44 32
      tenant/organization/src/main/resources/mapper/PtlAgreementCostExternalMapper.xml
  13. 134 154
      tenant/organization/src/main/resources/mapper/PtlAgreementCostMapper.xml
  14. 4 4
      tenant/organization/src/main/resources/mapper/PtlAgreementCostTypeMapper.xml
  15. 10 8
      tenant/organization/src/main/resources/mapper/PtlAgreementDispatchActionMapper.xml
  16. 7 5
      tenant/organization/src/main/resources/mapper/PtlAgreementDispatchAfterActionMapper.xml
  17. 86 80
      tenant/organization/src/main/resources/mapper/PtlAgreementMapper.xml
  18. 14 14
      tenant/organization/src/main/resources/mapper/PtlAgreementUndwrtRulesAttrLinkMapper.xml

+ 6 - 0
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatchAction.java

@@ -1,7 +1,9 @@
 package com.jzg.commons.entity.agreement.dispatch.dto;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
@@ -32,4 +34,8 @@ public class PtlAgreementDispatchAction implements Serializable {
     @TableField(exist = false)
     private String actionName;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
 }

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatchAfterAction.java

@@ -1,7 +1,9 @@
 package com.jzg.commons.entity.agreement.dispatch.dto;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
@@ -34,4 +36,9 @@ public class PtlAgreementDispatchAfterAction implements Serializable {
     @TableField(exist = false)
     private String actionName;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
 }

+ 8 - 4
commons/src/main/java/com/jzg/commons/entity/po/PtlNewCarJudgeRules.java

@@ -1,11 +1,10 @@
 package com.jzg.commons.entity.po;
 
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.baomidou.mybatisplus.annotation.*;
 import com.jzg.commons.core.base.BaseModel;
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
 import java.time.LocalDateTime;
@@ -38,4 +37,9 @@ public class PtlNewCarJudgeRules{
 
     private Date saveDate;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
 }

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/scheme/po/InsBusinessInsurance.java

@@ -1,5 +1,7 @@
 package com.jzg.commons.entity.scheme.po;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
@@ -26,4 +28,9 @@ public class InsBusinessInsurance {
     @Schema(description = "分组")
     private String grouping;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
 }

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/scheme/po/InsBusinessInsuranceOption.java

@@ -1,5 +1,7 @@
 package com.jzg.commons.entity.scheme.po;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
@@ -20,4 +22,9 @@ public class InsBusinessInsuranceOption {
     @Schema(description = "排序")
     private String sort;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
 }

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementCostExternalMapper.java

@@ -26,5 +26,5 @@ public interface  PtlAgreementCostExternalMapper extends BaseMapper<PtlAgreement
 
     List<CostExternalListVo> selectByAgreementIdAll(CostExternalParam costExternalParam);
 
-    void deleteByIAgreementId(CostExternalEnd costExternalEnd);
+//    void deleteByIAgreementId(CostExternalEnd costExternalEnd);
 }

+ 2 - 1
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fasterxml.jackson.datatype.jsr310.DecimalUtils;
 import com.jzg.commons.constants.ProductsType;
 import com.jzg.commons.constants.dict.InsOrderStatusEnum;
 import com.jzg.commons.core.base.BaseController;
@@ -1087,7 +1088,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             }
 
             // 判断是否已经结算完成, 考虑回款差额
-            if (surplusPremium.compareTo(settlementVo.getActualReceivedAmount().add(platformSettlementVo.getSettlementVo().getSettlementPaymentDifference())) == 0) {
+            if (surplusPremium.compareTo(BigDecimalUtil.add(settlementVo.getActualReceivedAmount(), platformSettlementVo.getSettlementVo().getSettlementPaymentDifference())) == 0) {
                 log.info("序号为[{}]的发票已经结算完成",invoice.getId());
                 // 更新发票状态
                 invoice.setStatus("1");

+ 36 - 30
tenant/organization/src/main/resources/mapper/InsBusinessInsuranceMapper.xml

@@ -20,35 +20,40 @@
 
     <select id="getBusinessInsuranceList" resultMap="SchemeResultVoMap">
         SELECT
-            ibi.power_id,
-            ibi.kind_code,
-            ibi.kind_name,
-            ibi.alias,
-            ibi.grouping,
-            ibio.id,
-            ibio.business_id,
-            ibio.label,
-            ibio.`value`,
-            ibio.sort
+        ibi.power_id,
+        ibi.kind_code,
+        ibi.kind_name,
+        ibi.alias,
+        ibi.grouping,
+        ibio.id,
+        ibio.business_id,
+        ibio.label,
+        ibio.`value`,
+        ibio.sort
         FROM
-            ins_business_insurance ibi
-                LEFT JOIN ins_business_insurance_option ibio ON ibi.id = ibio.business_id
-        WHERE
-            1=1
-        <if test="productId == '0330'">
-            AND ibi.type = 1
-        </if>
-        <if test="productId == '0330034002' or productId == '0330034001'">
-            AND ibi.type = 1 or ibi.type = 2
-        </if>
-        <if test="productId == '034001' or productId == '034002'">
-            AND ibi.type = 2
-        </if>
+        ins_business_insurance ibi
+        LEFT JOIN ins_business_insurance_option ibio ON ibi.id = ibio.business_id AND ibio.is_delete = 0
+        <where>
+            ibi.is_delete = 0
+            <if test="productId == '0330'">
+                AND ibi.type = 1
+            </if>
+            <if test="productId == '0330034002' or productId == '0330034001'">
+                AND ibi.type = 1 or ibi.type = 2
+            </if>
+            <if test="productId == '034001' or productId == '034002'">
+                AND ibi.type = 2
+            </if>
+        </where>
     </select>
 
     <select id="getBusinessInsuranceOptionList" resultType="com.jzg.commons.entity.scheme.po.InsBusinessInsuranceOption">
         select * from ins_business_insurance_option
+        <where>
+            is_delete = 0
+        </where>
     </select>
+
     <select id="getBusinessInsuranceListByKindType" resultMap="SchemeResultVoMap">
         SELECT
         ibi.power_id,
@@ -63,11 +68,12 @@
         ibio.sort
         FROM
         ins_business_insurance ibi
-        LEFT JOIN ins_business_insurance_option ibio ON ibi.id = ibio.business_id
-        WHERE
-        1=1
-        <if test="kindCode != null and kindCode != ''">
-            AND ibi.kind_code = #{kindCode}
-        </if>
+        LEFT JOIN ins_business_insurance_option ibio ON ibi.id = ibio.business_id AND ibio.is_delete = 0
+        <where>
+            ibi.is_delete = 0
+            <if test="kindCode != null and kindCode != ''">
+                AND ibi.kind_code = #{kindCode}
+            </if>
+        </where>
     </select>
-</mapper>
+</mapper>

+ 38 - 33
tenant/organization/src/main/resources/mapper/InvAccountCardMapper.xml

@@ -5,35 +5,35 @@
 <mapper namespace="com.jzg.organization.mapper.InvAccountCardMapper">
 
     <resultMap id="BaseResultMap" type="com.jzg.commons.entity.account.po.InvAccountCard">
-            <id property="id" column="id" jdbcType="BIGINT"/>
-            <result property="cardName" column="card_name" jdbcType="VARCHAR"/>
-            <result property="bankCardNum" column="bank_card_num" jdbcType="VARCHAR"/>
-            <result property="accountId" column="account_id" jdbcType="BIGINT"/>
-            <result property="accountQuality" column="account_quality" jdbcType="INTEGER"/>
-            <result property="bankName" column="bank_name" jdbcType="VARCHAR"/>
-            <result property="bank" column="bank" jdbcType="VARCHAR"/>
-            <result property="bankNum" column="bank_num" jdbcType="VARCHAR"/>
-            <result property="startCertExpirationDate" column="start_cert_expiration_date" jdbcType="TIMESTAMP"/>
-            <result property="endCertExpirationDate" column="end_cert_expiration_date" jdbcType="TIMESTAMP"/>
-            <result property="balance" column="balance" jdbcType="VARCHAR"/>
-            <result property="spend" column="spend" jdbcType="VARCHAR"/>
-            <result property="dayStrokeNum" column="day_stroke_num" jdbcType="VARCHAR"/>
-            <result property="dayStrokeNumExcess" column="day_stroke_num_excess" jdbcType="VARCHAR"/>
-            <result property="priDayLines" column="pri_day_lines" jdbcType="VARCHAR"/>
-            <result property="priSingleLines" column="pri_single_lines" jdbcType="VARCHAR"/>
-            <result property="priDayLinesExcess" column="pri_day_lines_excess" jdbcType="VARCHAR"/>
-            <result property="priYearLines" column="pri_year_lines" jdbcType="VARCHAR"/>
-            <result property="priYearExcess" column="pri_year_excess" jdbcType="VARCHAR"/>
-            <result property="pubSingleLines" column="pub_single_lines" jdbcType="VARCHAR"/>
-            <result property="pubYearLines" column="pub_year_lines" jdbcType="VARCHAR"/>
-            <result property="pubDayLines" column="pub_day_lines" jdbcType="VARCHAR"/>
-            <result property="pubYearExcess" column="pub_year_excess" jdbcType="VARCHAR"/>
-            <result property="pubDayLinesExcess" column="pub_day_lines_excess" jdbcType="VARCHAR"/>
-            <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
-            <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
-            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
-            <result property="isDelete" column="is_delete" jdbcType="TINYINT"/>
+        <id property="id" column="id" jdbcType="BIGINT"/>
+        <result property="cardName" column="card_name" jdbcType="VARCHAR"/>
+        <result property="bankCardNum" column="bank_card_num" jdbcType="VARCHAR"/>
+        <result property="accountId" column="account_id" jdbcType="BIGINT"/>
+        <result property="accountQuality" column="account_quality" jdbcType="INTEGER"/>
+        <result property="bankName" column="bank_name" jdbcType="VARCHAR"/>
+        <result property="bank" column="bank" jdbcType="VARCHAR"/>
+        <result property="bankNum" column="bank_num" jdbcType="VARCHAR"/>
+        <result property="startCertExpirationDate" column="start_cert_expiration_date" jdbcType="TIMESTAMP"/>
+        <result property="endCertExpirationDate" column="end_cert_expiration_date" jdbcType="TIMESTAMP"/>
+        <result property="balance" column="balance" jdbcType="VARCHAR"/>
+        <result property="spend" column="spend" jdbcType="VARCHAR"/>
+        <result property="dayStrokeNum" column="day_stroke_num" jdbcType="VARCHAR"/>
+        <result property="dayStrokeNumExcess" column="day_stroke_num_excess" jdbcType="VARCHAR"/>
+        <result property="priDayLines" column="pri_day_lines" jdbcType="VARCHAR"/>
+        <result property="priSingleLines" column="pri_single_lines" jdbcType="VARCHAR"/>
+        <result property="priDayLinesExcess" column="pri_day_lines_excess" jdbcType="VARCHAR"/>
+        <result property="priYearLines" column="pri_year_lines" jdbcType="VARCHAR"/>
+        <result property="priYearExcess" column="pri_year_excess" jdbcType="VARCHAR"/>
+        <result property="pubSingleLines" column="pub_single_lines" jdbcType="VARCHAR"/>
+        <result property="pubYearLines" column="pub_year_lines" jdbcType="VARCHAR"/>
+        <result property="pubDayLines" column="pub_day_lines" jdbcType="VARCHAR"/>
+        <result property="pubYearExcess" column="pub_year_excess" jdbcType="VARCHAR"/>
+        <result property="pubDayLinesExcess" column="pub_day_lines_excess" jdbcType="VARCHAR"/>
+        <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="isDelete" column="is_delete" jdbcType="TINYINT"/>
     </resultMap>
 
     <sql id="Base_Column_List">
@@ -51,7 +51,7 @@
     <select id="queryPage" resultType="com.jzg.commons.entity.account.vo.AccountCardVo">
         select <include refid="Base_Column_List"/>
         FROM inv_account_card iac
-        LEFT JOIN inv_account ia on ia.id = iac.account_id
+        LEFT JOIN inv_account ia on ia.id = iac.account_id AND ia.is_delete = 0
         <where>
             iac.is_delete = 0
             <if test="param.accountName != null and param.accountName != ''">
@@ -72,7 +72,7 @@
     <select id="queryById" resultType="com.jzg.commons.entity.account.vo.AccountCardVo">
         select <include refid="Base_Column_List"/>
         FROM inv_account_card iac
-        LEFT JOIN inv_account ia on ia.id = iac.account_id
+        LEFT JOIN inv_account ia on ia.id = iac.account_id AND ia.is_delete = 0
         <where>
             iac.is_delete = 0
             <if test="id != null and id != ''">
@@ -82,6 +82,11 @@
     </select>
     <!-- 查询业务员提现银行卡信息 lipf 2026年6月8日15:16:59 -->
     <select id="queryByAccountCardId" resultType="com.jzg.commons.entity.account.po.InvAccountCard">
-        select * from inv_account_card iac where iac.id = #{accountCardId} and iac.system_code = #{systemCode}
+        select * from inv_account_card iac
+        <where>
+            iac.id = #{accountCardId}
+            and iac.system_code = #{systemCode}
+            and iac.is_delete = 0
+        </where>
     </select>
-</mapper>
+</mapper>

+ 19 - 19
tenant/organization/src/main/resources/mapper/InvAccountMapper.xml

@@ -5,24 +5,24 @@
 <mapper namespace="com.jzg.organization.mapper.InvAccountMapper">
 
     <resultMap id="BaseResultMap" type="com.jzg.commons.entity.account.po.InvAccount">
-            <id property="id" column="id" jdbcType="BIGINT"/>
-            <result property="accountName" column="account_name" jdbcType="VARCHAR"/>
-            <result property="outerFlag" column="outer_flag" jdbcType="INTEGER"/>
-            <result property="businessQuality" column="business_quality" jdbcType="INTEGER"/>
-            <result property="owned" column="owned" jdbcType="VARCHAR"/>
-            <result property="juridicalPerson" column="juridical_person" jdbcType="VARCHAR"/>
-            <result property="establishTime" column="establish_time" jdbcType="TIMESTAMP"/>
-            <result property="biller" column="biller" jdbcType="VARCHAR"/>
-            <result property="invoicingAmount" column="invoicing_amount" jdbcType="VARCHAR"/>
-            <result property="invoicingAmountExcess" column="invoicing_amount_excess" jdbcType="VARCHAR"/>
-            <result property="quarterInvoicingAmount" column="quarter_invoicing_amount" jdbcType="VARCHAR"/>
-            <result property="sumInvoicingAmount" column="sum_invoicing_amount" jdbcType="VARCHAR"/>
-            <result property="tentativeEstimates" column="tentative_estimates" jdbcType="VARCHAR"/>
-            <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
-            <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
-            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
-            <result property="isDelete" column="is_delete" jdbcType="TINYINT"/>
+        <id property="id" column="id" jdbcType="BIGINT"/>
+        <result property="accountName" column="account_name" jdbcType="VARCHAR"/>
+        <result property="outerFlag" column="outer_flag" jdbcType="INTEGER"/>
+        <result property="businessQuality" column="business_quality" jdbcType="INTEGER"/>
+        <result property="owned" column="owned" jdbcType="VARCHAR"/>
+        <result property="juridicalPerson" column="juridical_person" jdbcType="VARCHAR"/>
+        <result property="establishTime" column="establish_time" jdbcType="TIMESTAMP"/>
+        <result property="biller" column="biller" jdbcType="VARCHAR"/>
+        <result property="invoicingAmount" column="invoicing_amount" jdbcType="VARCHAR"/>
+        <result property="invoicingAmountExcess" column="invoicing_amount_excess" jdbcType="VARCHAR"/>
+        <result property="quarterInvoicingAmount" column="quarter_invoicing_amount" jdbcType="VARCHAR"/>
+        <result property="sumInvoicingAmount" column="sum_invoicing_amount" jdbcType="VARCHAR"/>
+        <result property="tentativeEstimates" column="tentative_estimates" jdbcType="VARCHAR"/>
+        <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="isDelete" column="is_delete" jdbcType="TINYINT"/>
     </resultMap>
 
     <sql id="Base_Column_List">
@@ -74,4 +74,4 @@
         </where>
     </select>
 
-</mapper>
+</mapper>

+ 7 - 6
tenant/organization/src/main/resources/mapper/NewCarJudgeRulesMapper.xml

@@ -2,15 +2,16 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jzg.organization.mapper.NewCarJudgeRulesMapper">
 
-
     <select id="getNewCarList" resultType="com.jzg.commons.entity.po.PtlNewCarJudgeRules">
         select
-            pncjr.*,
-            eic.name as company_name
+        pncjr.*,
+        eic.name as company_name
         from
-            ptl_new_car_judge_rules pncjr
-        left join esm_ins_company eic on eic.id = pncjr.company_id
+        ptl_new_car_judge_rules pncjr
+        left join esm_ins_company eic on eic.id = pncjr.company_id and eic.is_delete = 0
+        <where>
+            pncjr.is_delete = 0
+        </where>
     </select>
 
-
 </mapper>

+ 44 - 32
tenant/organization/src/main/resources/mapper/PtlAgreementCostExternalMapper.xml

@@ -60,7 +60,7 @@
             pa.agreement_title, ce.priority_level
         FROM
             ptl_agreement_cost_external ce
-            LEFT JOIN ptl_agreement pa ON pa.id = ce.ptl_agreement_id
+                LEFT JOIN ptl_agreement pa ON pa.id = ce.ptl_agreement_id AND pa.is_delete = 0
     </sql>
 
     <sql id="Base_Column_type">
@@ -70,37 +70,49 @@
             ptl_agreement_cost_external_type
     </sql>
 
-    <delete id="deleteByIAgreementId">
+    <!--<delete id="deleteByIAgreementId">
         DELETE FROM ptl_agreement_cost_external WHERE ptl_agreement_id = #{ptlAgreementId} AND contact_mobile = #{contactMobile}
-    </delete>
+    </delete>-->
 
 
     <select id="selectById" resultMap="CostExternalListVoMap">
-        <include refid="Base_Column" /> WHERE ce.id = #{id}
+        <include refid="Base_Column" />
+        <where>
+            ce.is_delete = 0
+            AND ce.id = #{id}
+        </where>
     </select>
 
     <select id="costExternalList" resultMap="CostExternalVoMap">
         SELECT
-            contact_person,
-            contact_mobile,
-            GROUP_CONCAT(id) as ids
+        contact_person,
+        contact_mobile,
+        GROUP_CONCAT(id) as ids
         FROM
-            ptl_agreement_cost_external
+        ptl_agreement_cost_external
         <where>
             is_delete = 0
-        <if test="ptlAgreementId != null and ptlAgreementId != ''">
-            AND ptl_agreement_id = #{ptlAgreementId}
-        </if>
-            GROUP BY contact_person,contact_mobile
+            <if test="ptlAgreementId != null and ptlAgreementId != ''">
+                AND ptl_agreement_id = #{ptlAgreementId}
+            </if>
         </where>
+        GROUP BY contact_person,contact_mobile
     </select>
 
     <select id="selectByIds" resultMap="CostExternalListVoMap">
-        <include refid="Base_Column" /> WHERE ce.id in (${ids})
+        <include refid="Base_Column" />
+        <where>
+            ce.is_delete = 0
+            AND ce.id in (${ids})
+        </where>
     </select>
 
     <select id="selectCostExternalTypeVo" resultType="com.jzg.commons.entity.vo.CostExternalTypeVo">
-        <include refid="Base_Column_type" /> WHERE ptl_agreement_cost_external_id = #{id}
+        <include refid="Base_Column_type" />
+        <where>
+            is_delete = 0
+            AND ptl_agreement_cost_external_id = #{id}
+        </where>
     </select>
 
 
@@ -108,25 +120,25 @@
 
     <select id="pageList" resultMap="ExternalListVoMap">
         SELECT
-            ce.id,
-            ce.product_name,
-            ce.product_id,
-            ce.cost_describe,
-            ce.is_inquiry,
-            ce.effective_time,
-            ce.failure_time,
-            ce.audit_status,
-            ce.is_enabled,
-            ce.contact_person,
-            ce.contact_mobile,
-            ce.audit_method,
-            ce.create_time,
-            ce.create_by,
-            pa.agreement_code,
-            pa.agreement_abbreviation
+        ce.id,
+        ce.product_name,
+        ce.product_id,
+        ce.cost_describe,
+        ce.is_inquiry,
+        ce.effective_time,
+        ce.failure_time,
+        ce.audit_status,
+        ce.is_enabled,
+        ce.contact_person,
+        ce.contact_mobile,
+        ce.audit_method,
+        ce.create_time,
+        ce.create_by,
+        pa.agreement_code,
+        pa.agreement_abbreviation
         FROM
-            ptl_agreement_cost_external ce
-                LEFT JOIN ptl_agreement pa ON pa.id = ce.ptl_agreement_id
+        ptl_agreement_cost_external ce
+        LEFT JOIN ptl_agreement pa ON pa.id = ce.ptl_agreement_id AND pa.is_delete = 0
         <where>
             ce.is_delete = 0
             <if test="costParam.agreement != null and costParam.agreement != ''">

+ 134 - 154
tenant/organization/src/main/resources/mapper/PtlAgreementCostMapper.xml

@@ -129,7 +129,7 @@
         <result column="create_time" property="createTime" jdbcType="VARCHAR"/>
         <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
         <collection property="ruleConditions" column="{costId=costId}" ofType="com.jzg.commons.entity.vo.PtlAgreementCostTypeVo" select="selectCostType" />
-     </resultMap>
+    </resultMap>
 
 
     <select id="queryByAgreementIdAndCoverRuleId" resultMap="CostListMap">
@@ -166,7 +166,7 @@
         r.batch as batch
         FROM
         ptl_agreement_cost c
-        left join ptl_agreement_cost_rule r on c.id = r.ptl_agreement_cost_id
+        left join ptl_agreement_cost_rule r on c.id = r.ptl_agreement_cost_id AND r.is_delete = 0
         <where>
             c.is_delete = 0
             AND
@@ -182,60 +182,63 @@
 
     <select id="selectCostById"  resultMap="CostResultMap">
         SELECT
-            t.id,
-            t.priority_level,
-            t.ptl_agreement_id,
-            t.product_name,
-            t.product_id,
-            t.effective_time,
-            t.failure_time,
-            t.audit_method,
-            t.cost_rules,
-            t.cost_describe,
-            t.approved,
-            t.is_valid,
-            t.is_enabled
+        t.id,
+        t.priority_level,
+        t.ptl_agreement_id,
+        t.product_name,
+        t.product_id,
+        t.effective_time,
+        t.failure_time,
+        t.audit_method,
+        t.cost_rules,
+        t.cost_describe,
+        t.approved,
+        t.is_valid,
+        t.is_enabled
         FROM
-            ptl_agreement_cost t
-        WHERE t.id IN (${costId})
+        ptl_agreement_cost t
+        <where>
+            t.is_delete = 0
+            AND t.id IN (${costId})
+        </where>
     </select>
 
 
     <select id="queryById" resultMap="BaseResultMap">
         SELECT
-            t.id,
-            t.ptl_agreement_id,
-            t.cover_rule_id,
-            t.product_name,
-            t.product_id,
-            t.effective_time,
-            t.failure_time,
-            t.audit_method,
-            t.cost_describe,
-            t.approved,
-            t.is_delete,
-            t.create_by,
-            t.create_time,
-            t.update_by,
-            t.update_time,
-            t.audit_person,
-            t.review_description,
-            t.audit_time,
-            t.priority_level,
-            pa.agreement_code,
-            pa.agreement_title,
-            pa.jq_entrance_fee_ratio,
-            pa.sy_entrance_fee_ratio,
-            pa.jy_entrance_fee_ratio
+        t.id,
+        t.ptl_agreement_id,
+        t.cover_rule_id,
+        t.product_name,
+        t.product_id,
+        t.effective_time,
+        t.failure_time,
+        t.audit_method,
+        t.cost_describe,
+        t.approved,
+        t.is_delete,
+        t.create_by,
+        t.create_time,
+        t.update_by,
+        t.update_time,
+        t.audit_person,
+        t.review_description,
+        t.audit_time,
+        t.priority_level,
+        pa.agreement_code,
+        pa.agreement_title,
+        pa.jq_entrance_fee_ratio,
+        pa.sy_entrance_fee_ratio,
+        pa.jy_entrance_fee_ratio
         FROM
-            ptl_agreement_cost t
-            LEFT JOIN ptl_agreement pa ON pa.id = t.ptl_agreement_id
-           <where>
-               t.is_delete = 0
-               <if test="id != null">
-                   AND t.id = #{id}
-               </if>
-           </where>
+        ptl_agreement_cost t
+        LEFT JOIN ptl_agreement pa ON pa.id = t.ptl_agreement_id AND pa.is_delete = 0
+        <where>
+            t.is_delete = 0
+            <if test="id != null">
+                AND t.id = #{id}
+            </if>
+        </where>
     </select>
 
 
@@ -274,101 +277,109 @@
 
     <select id="selectCostRule" resultMap="costRule">
         SELECT
-            tr.id,
-            tr.ptl_agreement_cost_id,
-            tr.rules_id,
-            tr.attr_id,
-            tr.attr_code,
-            tr.min,
-            tr.max,
-            tr.operator,
-            tr.batch,
-            a.attr_name,
-            a.attr_type,
-            a.attr_group,
-            a.dict_id
+        tr.id,
+        tr.ptl_agreement_cost_id,
+        tr.rules_id,
+        tr.attr_id,
+        tr.attr_code,
+        tr.min,
+        tr.max,
+        tr.operator,
+        tr.batch,
+        a.attr_name,
+        a.attr_type,
+        a.attr_group,
+        a.dict_id
         FROM
-            ptl_agreement_cost_rule tr
-            left join ptl_agreement_undwrt_rules_attr a on tr.attr_code = a.attr_code
-        WHERE
-            tr.ptl_agreement_cost_id = #{costId}
+        ptl_agreement_cost_rule tr
+        left join ptl_agreement_undwrt_rules_attr a on tr.attr_code = a.attr_code AND a.is_delete = 0
+        <where>
+            tr.is_delete = 0
+            AND tr.ptl_agreement_cost_id = #{costId}
+        </where>
     </select>
 
     <select id="selectCostType" resultMap="costType">
         SELECT
-            tt.id,
-            tt.ptl_agreement_cost_id,
-            tt.cost_type,
-            tt.inlet,
-            tt.export,
-            tt.add_throw,
-            tt.keep_point_ratio,
-            tt.export_keep_point_ratio,
-            CASE
-                WHEN tt.cost_type = '交强险' THEN pa.jq_entrance_fee_ratio
-                WHEN tt.cost_type = '商业险' THEN pa.sy_entrance_fee_ratio
-                WHEN tt.cost_type = '驾意险' THEN pa.jy_entrance_fee_ratio
-                ELSE NULL
-                END AS commission
+        tt.id,
+        tt.ptl_agreement_cost_id,
+        tt.cost_type,
+        tt.inlet,
+        tt.export,
+        tt.add_throw,
+        tt.keep_point_ratio,
+        tt.export_keep_point_ratio,
+        CASE
+        WHEN tt.cost_type = '交强险' THEN pa.jq_entrance_fee_ratio
+        WHEN tt.cost_type = '商业险' THEN pa.sy_entrance_fee_ratio
+        WHEN tt.cost_type = '驾意险' THEN pa.jy_entrance_fee_ratio
+        ELSE NULL
+        END AS commission
         FROM
-            ptl_agreement_cost_type tt
-                left join ptl_agreement_cost pac on pac.id = tt.ptl_agreement_cost_id
-                left join ptl_agreement pa on pa.id = pac.ptl_agreement_id
-        WHERE
-            tt.ptl_agreement_cost_id = #{costId}
+        ptl_agreement_cost_type tt
+        left join ptl_agreement_cost pac on pac.id = tt.ptl_agreement_cost_id AND pac.is_delete = 0
+        left join ptl_agreement pa on pa.id = pac.ptl_agreement_id AND pa.is_delete = 0
+        <where>
+            tt.is_delete = 0
+            AND tt.ptl_agreement_cost_id = #{costId}
+        </where>
     </select>
 
 
     <select id="selectDictLabal" resultMap="RulesDictLabalMap">
         <if test="dictId != null and dictId != ''">
-            select * from  ptl_agreement_undwrt_rules_dict_labal where dict_id = #{dictId}
+            select * from  ptl_agreement_undwrt_rules_dict_labal
+            <where>
+                is_delete = 0
+                AND dict_id = #{dictId}
+            </where>
         </if>
     </select>
 
 
     <select id="pageList" resultMap="CostManagementVoMap">
         SELECT
-            pc.product_id,
-            pc.product_name,
-            pc.cost_rules,
-            pc.effective_time,
-            pc.failure_time,
-            pc.id costId,
-            pc.ptl_agreement_id,
-            pc.cover_rule_id,
-            pc.approved,
-            pc.cost_describe,
-            pc.priority_level,
-            pc.is_enabled,
-            pc.create_time,
-            pc.create_by,
-            pa.agreement_code,
-            pa.agreement_name,
-            pa.agreement_title,
-            pa.agreement_abbreviation,
-            pa.id as ptlAgreementId,
-            pr.rule_description,
-            eic.name as company_name,
-            pa.docking_person,
-            pc.update_time,
-            CASE
-                WHEN NOW() >= pc.effective_time
-                AND (pc.failure_time IS NULL OR NOW() &lt; pc.failure_time)
-                THEN 1
-                ELSE 0
-            END AS is_valid
+        pc.product_id,
+        pc.product_name,
+        pc.cost_rules,
+        pc.effective_time,
+        pc.failure_time,
+        pc.id costId,
+        pc.ptl_agreement_id,
+        pc.cover_rule_id,
+        pc.approved,
+        pc.cost_describe,
+        pc.priority_level,
+        pc.is_enabled,
+        pc.create_time,
+        pc.create_by,
+        pa.agreement_code,
+        pa.agreement_name,
+        pa.agreement_title,
+        pa.agreement_abbreviation,
+        pa.id as ptlAgreementId,
+        pr.rule_description,
+        eic.name as company_name,
+        pa.docking_person,
+        pc.update_time,
+        CASE
+        WHEN NOW() >= pc.effective_time
+        AND (pc.failure_time IS NULL OR NOW() &lt; pc.failure_time)
+        THEN 1
+        ELSE 0
+        END AS is_valid
         FROM
-            ptl_agreement_cost pc
-                LEFT JOIN ptl_agreement pa ON pa.id = pc.ptl_agreement_id and pa.is_delete = 0
-                LEFT JOIN ptl_agreement_undwrt_rules pr ON pr.id = pc.cover_rule_id AND pr.agreement_id = pc.ptl_agreement_id and pr.is_delete = 0
-        LEFT JOIN esm_ins_company eic on eic.id = pa.company_id
+        ptl_agreement_cost pc
+        LEFT JOIN ptl_agreement pa ON pa.id = pc.ptl_agreement_id AND pa.is_delete = 0
+        LEFT JOIN ptl_agreement_undwrt_rules pr ON pr.id = pc.cover_rule_id AND pr.agreement_id = pc.ptl_agreement_id AND pr.is_delete = 0
+        LEFT JOIN esm_ins_company eic on eic.id = pa.company_id AND eic.is_delete = 0
         <where>
             pc.is_delete = 0
             <if test="costParam.agreement != null and costParam.agreement != ''">
                 AND (pa.agreement_title  like concat('%',#{costParam.agreement},'%') or
-                     pa.agreement_code  like concat('%',#{costParam.agreement},'%') or
-                     pa.agreement_abbreviation  like concat('%',#{costParam.agreement},'%') or
-                     pa.id = #{costParam.agreement})
+                pa.agreement_code  like concat('%',#{costParam.agreement},'%') or
+                pa.agreement_abbreviation  like concat('%',#{costParam.agreement},'%') or
+                pa.id = #{costParam.agreement})
             </if>
             <if test="costParam.productId != null and costParam.productId != ''">
                 AND pc.product_id = #{costParam.productId}
@@ -425,35 +436,4 @@
         order by pc.create_time desc
     </select>
 
-<!--    <select id="selectById" resultMap="BaseResultMap">-->
-<!--        SELECT-->
-<!--        t.id,-->
-<!--        t.ptl_agreement_id,-->
-<!--        t.product_name,-->
-<!--        t.product_id,-->
-<!--        t.effective_time,-->
-<!--        t.failure_time,-->
-<!--        t.audit_method,-->
-<!--        t.cost_describe,-->
-<!--        t.is_delete,-->
-<!--        t.create_by,-->
-<!--        t.create_time,-->
-<!--        t.update_by,-->
-<!--        t.update_time,-->
-<!--        t.audit_person,-->
-<!--        t.review_description,-->
-<!--        t.audit_time,-->
-<!--        pa.agreement_code,-->
-<!--        pa.agreement_title-->
-<!--        FROM-->
-<!--        ptl_agreement_cost t-->
-<!--        LEFT JOIN ptl_agreement pa ON pa.id = t.ptl_agreement_id-->
-<!--        <where>-->
-<!--            t.is_delete = 0-->
-<!--            <if test="id != null">-->
-<!--                AND t.id = #{id}-->
-<!--            </if>-->
-<!--        </where>-->
-<!--    </select>-->
-
-</mapper>
+</mapper>

+ 4 - 4
tenant/organization/src/main/resources/mapper/PtlAgreementCostTypeMapper.xml

@@ -8,10 +8,10 @@
     </resultMap>
     <select id="queryByCostId" resultMap="ResultMap">
         select *
-            from
-        ptl_agreement_cost_type
-        where 1=1
-            and ptl_agreement_cost_type.is_delete = 0
+        from ptl_agreement_cost_type
+        <where>
+            and is_delete = 0
             and ptl_agreement_cost_id = #{costId}
+        </where>
     </select>
 </mapper>

+ 10 - 8
tenant/organization/src/main/resources/mapper/PtlAgreementDispatchActionMapper.xml

@@ -14,12 +14,14 @@
 
     <select id="getActions" resultMap="ActionMap">
         select *
-        from
-            ptl_agreement_dispatch_action
-        where 1=1
-          and dispatch_id in
-        <foreach collection="dispatchIds" item="id" open="(" separator="," close=")">
-            #{id}
-        </foreach>
+        from ptl_agreement_dispatch_action
+        <where>
+            is_delete = 0
+            and dispatch_id in
+            <foreach collection="dispatchIds" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </where>
     </select>
-</mapper>
+
+</mapper>

+ 7 - 5
tenant/organization/src/main/resources/mapper/PtlAgreementDispatchAfterActionMapper.xml

@@ -14,9 +14,11 @@
 
     <select id="getAfterActions" resultMap="ActionMap">
         select *
-        from
-            ptl_agreement_dispatch_after_action
-        where 1=1
-          and company_id = #{id}
+        from ptl_agreement_dispatch_after_action
+        <where>
+            is_delete = 0
+            and company_id = #{id}
+        </where>
     </select>
-</mapper>
+
+</mapper>

+ 86 - 80
tenant/organization/src/main/resources/mapper/PtlAgreementMapper.xml

@@ -5,42 +5,42 @@
 <mapper namespace="com.jzg.organization.mapper.PtlAgreementMapper">
 
     <resultMap id="BaseResultMap" type="com.jzg.commons.entity.po.PtlAgreement">
-            <id property="id" column="id" jdbcType="VARCHAR"/>
-            <result property="agreementType" column="agreement_type" jdbcType="TINYINT"/>
-            <result property="agreementCode" column="agreement_code" jdbcType="VARCHAR"/>
-            <result property="agreementName" column="agreement_name" jdbcType="VARCHAR"/>
-            <result property="agreementTitle" column="agreement_title" jdbcType="VARCHAR"/>
-            <result property="agreementAbbreviation" column="agreement_abbreviation" jdbcType="VARCHAR"/>
-            <result property="isEnable" column="is_enable" jdbcType="TINYINT"/>
-            <result property="companyId" column="company_id" jdbcType="VARCHAR"/>
-            <result property="partnerCompanyId" column="partner_company_id" jdbcType="VARCHAR"/>
-            <result property="startDate" column="start_date" jdbcType="TIMESTAMP"/>
-            <result property="endDate" column="end_date" jdbcType="TIMESTAMP"/>
-            <result property="moneyTime" column="money_time" jdbcType="INTEGER"/>
-            <result property="matchType" column="match_type" jdbcType="VARCHAR"/>
-            <result property="dockingPerson" column="docking_person" jdbcType="VARCHAR"/>
-            <result property="dockingPhone" column="docking_phone" jdbcType="VARCHAR"/>
-            <result property="validStatus" column="valid_status" jdbcType="VARCHAR"/>
-            <result property="moneyType" column="money_type" jdbcType="TINYINT"/>
-            <result property="fileId" column="file_id" jdbcType="VARCHAR"/>
-            <result property="auditContent" column="audit_content" jdbcType="VARCHAR"/>
-            <result property="auditStatus" column="audit_status" jdbcType="TINYINT"/>
-            <result property="serialNumber" column="serial_number" jdbcType="INTEGER"/>
-            <result property="withTax" column="with_tax" jdbcType="TINYINT"/>
-            <result property="auditType" column="audit_type" jdbcType="TINYINT"/>
-            <result property="deptId" column="dept_id" jdbcType="VARCHAR"/>
-            <result property="isExternal" column="is_external" jdbcType="TINYINT"/>
-            <result property="custodianId" column="custodian_id" jdbcType="VARCHAR"/>
-            <result property="systemCode" column="system_code" jdbcType="VARCHAR"/>
-            <result property="attributionId" column="attribution_id" jdbcType="VARCHAR"/>
-            <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
-            <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
-            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
-            <result property="isDelete" column="is_delete" jdbcType="TINYINT"/>
-            <result property="jqEntranceFeeRatio" column="jq_entrance_fee_ratio" jdbcType="VARCHAR"/>
-            <result property="syEntranceFeeRatio" column="sy_entrance_fee_ratio" jdbcType="VARCHAR"/>
-            <result property="jyEntranceFeeRatio" column="jy_entrance_fee_ratio" jdbcType="VARCHAR"/>
+        <id property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="agreementType" column="agreement_type" jdbcType="TINYINT"/>
+        <result property="agreementCode" column="agreement_code" jdbcType="VARCHAR"/>
+        <result property="agreementName" column="agreement_name" jdbcType="VARCHAR"/>
+        <result property="agreementTitle" column="agreement_title" jdbcType="VARCHAR"/>
+        <result property="agreementAbbreviation" column="agreement_abbreviation" jdbcType="VARCHAR"/>
+        <result property="isEnable" column="is_enable" jdbcType="TINYINT"/>
+        <result property="companyId" column="company_id" jdbcType="VARCHAR"/>
+        <result property="partnerCompanyId" column="partner_company_id" jdbcType="VARCHAR"/>
+        <result property="startDate" column="start_date" jdbcType="TIMESTAMP"/>
+        <result property="endDate" column="end_date" jdbcType="TIMESTAMP"/>
+        <result property="moneyTime" column="money_time" jdbcType="INTEGER"/>
+        <result property="matchType" column="match_type" jdbcType="VARCHAR"/>
+        <result property="dockingPerson" column="docking_person" jdbcType="VARCHAR"/>
+        <result property="dockingPhone" column="docking_phone" jdbcType="VARCHAR"/>
+        <result property="validStatus" column="valid_status" jdbcType="VARCHAR"/>
+        <result property="moneyType" column="money_type" jdbcType="TINYINT"/>
+        <result property="fileId" column="file_id" jdbcType="VARCHAR"/>
+        <result property="auditContent" column="audit_content" jdbcType="VARCHAR"/>
+        <result property="auditStatus" column="audit_status" jdbcType="TINYINT"/>
+        <result property="serialNumber" column="serial_number" jdbcType="INTEGER"/>
+        <result property="withTax" column="with_tax" jdbcType="TINYINT"/>
+        <result property="auditType" column="audit_type" jdbcType="TINYINT"/>
+        <result property="deptId" column="dept_id" jdbcType="VARCHAR"/>
+        <result property="isExternal" column="is_external" jdbcType="TINYINT"/>
+        <result property="custodianId" column="custodian_id" jdbcType="VARCHAR"/>
+        <result property="systemCode" column="system_code" jdbcType="VARCHAR"/>
+        <result property="attributionId" column="attribution_id" jdbcType="VARCHAR"/>
+        <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="isDelete" column="is_delete" jdbcType="TINYINT"/>
+        <result property="jqEntranceFeeRatio" column="jq_entrance_fee_ratio" jdbcType="VARCHAR"/>
+        <result property="syEntranceFeeRatio" column="sy_entrance_fee_ratio" jdbcType="VARCHAR"/>
+        <result property="jyEntranceFeeRatio" column="jy_entrance_fee_ratio" jdbcType="VARCHAR"/>
     </resultMap>
 
     <sql id="Base_Column_List">
@@ -64,13 +64,13 @@
     <select id="queryPage" resultType="com.jzg.commons.entity.vo.AgreementVo">
         select <include refid="Base_Column_List"/>
         FROM ptl_agreement pa
-        LEFT JOIN ptl_agreement_attribution paa on pa.attribution_id = paa.id
-        LEFT JOIN sys_dept sdd on pa.dept_id = sdd.id
-        LEFT JOIN sys_user_jzg_info suji on pa.custodian_id = suji.user_id
-        LEFT JOIN sys_dept sd on suji.dept_id = sd.id
-        LEFT JOIN sys_upload_files suf on pa.file_id = suf.id
-        LEFT JOIN esm_ins_company eic on pa.company_id = eic.id
-        LEFT JOIN esm_ins_company eica on pa.partner_company_id = eica.id
+        LEFT JOIN ptl_agreement_attribution paa on pa.attribution_id = paa.id AND paa.is_delete = 0
+        LEFT JOIN sys_dept sdd on pa.dept_id = sdd.id AND sdd.is_delete = 0
+        LEFT JOIN sys_user_jzg_info suji on pa.custodian_id = suji.user_id AND suji.is_delete = 0
+        LEFT JOIN sys_dept sd on suji.dept_id = sd.id AND sd.is_delete = 0
+        LEFT JOIN sys_upload_files suf on pa.file_id = suf.id AND suf.is_delete = 0
+        LEFT JOIN esm_ins_company eic on pa.company_id = eic.id AND eic.is_delete = 0
+        LEFT JOIN esm_ins_company eica on pa.partner_company_id = eica.id AND eica.is_delete = 0
         <where>
             pa.is_delete = 0
             <if test="param.searchValue != null and param.searchValue != ''">
@@ -81,16 +81,18 @@
             </if>
             <if test="param.companyId != null and param.companyId != ''">
                 and pa.company_id in (
-                    WITH RECURSIVE t AS (
-                    SELECT id
-                    FROM esm_ins_company
-                    WHERE id = #{param.companyId}
-                    AND parent_id = 0
-                    UNION ALL
-                    SELECT c.id
-                    FROM esm_ins_company c
-                    JOIN t ON c.parent_id = t.id
-                    )
+                WITH RECURSIVE t AS (
+                SELECT id
+                FROM esm_ins_company
+                WHERE id = #{param.companyId}
+                AND parent_id = 0
+                AND is_delete = 0
+                UNION ALL
+                SELECT c.id
+                FROM esm_ins_company c
+                JOIN t ON c.parent_id = t.id
+                WHERE c.is_delete = 0
+                )
                 SELECT id FROM t)
             </if>
             <if test="param.companyIds != null and param.companyIds != ''">
@@ -134,13 +136,13 @@
     <select id="queryList" resultType="com.jzg.commons.entity.vo.AgreementVo">
         select <include refid="Base_Column_List"/>
         FROM ptl_agreement pa
-        LEFT JOIN ptl_agreement_attribution paa on pa.attribution_id = paa.id
-        LEFT JOIN sys_dept sdd on pa.dept_id = sdd.id
-        LEFT JOIN sys_user_jzg_info suji on pa.custodian_id = suji.user_id
-        LEFT JOIN sys_dept sd on suji.dept_id = sd.id
-        LEFT JOIN sys_upload_files suf on pa.file_id = suf.id
-        LEFT JOIN esm_ins_company eic on pa.company_id = eic.id
-        LEFT JOIN esm_ins_company eica on pa.partner_company_id = eica.id
+        LEFT JOIN ptl_agreement_attribution paa on pa.attribution_id = paa.id AND paa.is_delete = 0
+        LEFT JOIN sys_dept sdd on pa.dept_id = sdd.id AND sdd.is_delete = 0
+        LEFT JOIN sys_user_jzg_info suji on pa.custodian_id = suji.user_id AND suji.is_delete = 0
+        LEFT JOIN sys_dept sd on suji.dept_id = sd.id AND sd.is_delete = 0
+        LEFT JOIN sys_upload_files suf on pa.file_id = suf.id AND suf.is_delete = 0
+        LEFT JOIN esm_ins_company eic on pa.company_id = eic.id AND eic.is_delete = 0
+        LEFT JOIN esm_ins_company eica on pa.partner_company_id = eica.id AND eica.is_delete = 0
         <where>
             pa.is_delete = 0
             <if test="param.searchValue != null and param.searchValue != ''">
@@ -189,14 +191,15 @@
     <select id="queryById" resultType="com.jzg.commons.entity.vo.AgreementVo">
         select <include refid="Base_Column_List"/>
         FROM ptl_agreement pa
-        LEFT JOIN ptl_agreement_attribution paa on pa.attribution_id = paa.id
-        LEFT JOIN sys_dept sdd on pa.dept_id = sdd.id
-        LEFT JOIN sys_user_jzg_info suji on pa.custodian_id = suji.user_id
-        LEFT JOIN sys_dept sd on suji.dept_id = sd.id
---         LEFT JOIN sys_upload_files suf on suf.id = pa.file_id
-        LEFT JOIN esm_ins_company eic on pa.company_id = eic.id
-        LEFT JOIN esm_ins_company eica on pa.partner_company_id = eica.id
+        LEFT JOIN ptl_agreement_attribution paa on pa.attribution_id = paa.id AND paa.is_delete = 0
+        LEFT JOIN sys_dept sdd on pa.dept_id = sdd.id AND sdd.is_delete = 0
+        LEFT JOIN sys_user_jzg_info suji on pa.custodian_id = suji.user_id AND suji.is_delete = 0
+        LEFT JOIN sys_dept sd on suji.dept_id = sd.id AND sd.is_delete = 0
+        --         LEFT JOIN sys_upload_files suf on suf.id = pa.file_id
+        LEFT JOIN esm_ins_company eic on pa.company_id = eic.id AND eic.is_delete = 0
+        LEFT JOIN esm_ins_company eica on pa.partner_company_id = eica.id AND eica.is_delete = 0
         <where>
+            pa.is_delete = 0
             <if test="id != null and id != ''">
                 and pa.id = #{id}
             </if>
@@ -205,22 +208,25 @@
 
     <select id="getByCompanyId" resultType="com.jzg.commons.entity.po.PtlAgreement">
         select
-            *
+        *
         FROM
-            ptl_agreement
-        where
+        ptl_agreement
+        <where>
             is_delete = 0
-          and company_id in (
+            and company_id in (
             WITH RECURSIVE t AS (
-                SELECT id
-                FROM esm_ins_company
-                WHERE id = #{companyId}
-                  AND parent_id = 0
-                UNION ALL
-                SELECT c.id
-                FROM esm_ins_company c
-                         JOIN t ON c.parent_id = t.id
+            SELECT id
+            FROM esm_ins_company
+            WHERE id = #{companyId}
+            AND parent_id = 0
+            AND is_delete = 0
+            UNION ALL
+            SELECT c.id
+            FROM esm_ins_company c
+            JOIN t ON c.parent_id = t.id
+            WHERE c.is_delete = 0
             )
             SELECT id FROM t)
+        </where>
     </select>
-</mapper>
+</mapper>

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

@@ -5,18 +5,18 @@
 <mapper namespace="com.jzg.organization.mapper.PtlAgreementUndwrtRulesAttrLinkMapper">
 
     <resultMap id="BaseResultMap" type="com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink">
-            <id property="id" column="id" jdbcType="VARCHAR"/>
-            <result property="rulesId" column="rules_id" jdbcType="VARCHAR"/>
-            <result property="attrId" column="attr_id" jdbcType="VARCHAR"/>
-            <result property="attrCode" column="attr_code" jdbcType="VARCHAR"/>
-            <result property="min" column="min" jdbcType="VARCHAR"/>
-            <result property="operator" column="operator" jdbcType="VARCHAR"/>
-            <result property="max" column="max" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
-            <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
-            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
-            <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
-            <result property="isDelete" column="is_delete" jdbcType="TINYINT"/>
+        <id property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="rulesId" column="rules_id" jdbcType="VARCHAR"/>
+        <result property="attrId" column="attr_id" jdbcType="VARCHAR"/>
+        <result property="attrCode" column="attr_code" jdbcType="VARCHAR"/>
+        <result property="min" column="min" jdbcType="VARCHAR"/>
+        <result property="operator" column="operator" jdbcType="VARCHAR"/>
+        <result property="max" column="max" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
+        <result property="isDelete" column="is_delete" jdbcType="TINYINT"/>
     </resultMap>
 
     <sql id="Base_Column_List">
@@ -29,7 +29,7 @@
     <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
+        LEFT JOIN ptl_agreement_undwrt_rules_attr pa on pl.attr_code = pa.attr_code AND pa.is_delete = 0
         <where>
             pl.is_delete = 0
             <if test="ruleId != null and ruleId != ''">
@@ -37,4 +37,4 @@
             </if>
         </where>
     </select>
-</mapper>
+</mapper>