Переглянути джерело

fix: 发送历史查询数据有误修复

chenjianhua 6 місяців тому
батько
коміт
48d4ef671b

+ 12 - 12
service-base/src/main/resources/mapper/CompanyEmailHistoryMapper.xml

@@ -129,15 +129,15 @@
             cesh.send_remark,
             cesh.send_status
         FROM
-            company_email_send_history cesh
-            JOIN company_email_config cec
-            ON cec.email = cesh.email
-            JOIN pvn_company_info c
-            ON cec.company_id = c.company_id
+        PPW_EMAIL.company_email_send_history cesh
+        JOIN PPW_EMAIL.company_email_config cec
+        ON cec.email = cesh.email and cesh.company_id=cec.company_id
+        JOIN PPW_EMAIL.pvn_company_info c
+        ON cesh.company_id = c.company_id
         WHERE cec.isvalid = 1
         AND cesh.isvalid = 1 and c.isvalid =1
         <if test="companyId != null and companyId !=''">
-            and c.company_id=#{companyId}
+            and cesh.company_id=#{companyId}
         </if>
         <if test="email != null and email !=''">
             and cesh.email=#{email}
@@ -150,15 +150,15 @@
         SELECT
         count(distinct cesh.id)
         FROM
-        company_email_send_history cesh
-        JOIN company_email_config cec
-        ON cec.email = cesh.email
-        JOIN pvn_company_info c
-        ON cec.company_id = c.company_id
+        PPW_EMAIL.company_email_send_history cesh
+        JOIN PPW_EMAIL.company_email_config cec
+        ON cec.email = cesh.email and cesh.company_id=cec.company_id
+        JOIN PPW_EMAIL.pvn_company_info c
+        ON cesh.company_id = c.company_id
         WHERE cec.isvalid = 1
         AND cesh.isvalid = 1 and c.isvalid =1
         <if test="companyId != null and companyId !=''">
-            and c.company_id=#{companyId}
+            and cesh.company_id=#{companyId}
         </if>
         <if test="email != null and email !=''">
             and cesh.email=#{email}