|
@@ -46,7 +46,19 @@
|
|
PPW_EMAIL.company_email_config cec
|
|
PPW_EMAIL.company_email_config cec
|
|
JOIN PPW_EMAIL.pvn_company_info c
|
|
JOIN PPW_EMAIL.pvn_company_info c
|
|
ON cec.company_id = c.company_id
|
|
ON cec.company_id = c.company_id
|
|
- LEFT JOIN (select me.email as email,max(me.send_time) as send_time,me.company_id,me.send_remark,me.send_status from PPW_EMAIL.company_email_send_history me where isvalid =1 group by me.email,me.company_id) maxce
|
|
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ (SELECT
|
|
|
|
+ me.email AS email,
|
|
|
|
+ me.send_time AS send_time,
|
|
|
|
+ me.company_id,
|
|
|
|
+ me.send_remark,
|
|
|
|
+ me.send_status
|
|
|
|
+ FROM
|
|
|
|
+ PPW_EMAIL.company_email_send_history me
|
|
|
|
+ join (select mx.company_id,mx.email,max(mx.send_time) as max_send_time from PPW_EMAIL.company_email_send_history mx where mx.isvalid=1
|
|
|
|
+ GROUP BY mx.email,
|
|
|
|
+ mx.company_id) as mx on me.email=mx.email and me.company_id=mx.company_id and me.send_time=mx.max_send_time
|
|
|
|
+ WHERE me.isvalid = 1) maxce
|
|
ON cec.email = maxce.email and cec.company_id = maxce.company_id
|
|
ON cec.email = maxce.email and cec.company_id = maxce.company_id
|
|
WHERE cec.isvalid = 1 and c.isvalid=1
|
|
WHERE cec.isvalid = 1 and c.isvalid=1
|
|
<if test="companyName != null and companyName !=''">
|
|
<if test="companyName != null and companyName !=''">
|
|
@@ -78,7 +90,19 @@
|
|
PPW_EMAIL.company_email_config cec
|
|
PPW_EMAIL.company_email_config cec
|
|
JOIN PPW_EMAIL.pvn_company_info c
|
|
JOIN PPW_EMAIL.pvn_company_info c
|
|
ON cec.company_id = c.company_id
|
|
ON cec.company_id = c.company_id
|
|
- LEFT JOIN (select me.email as email,max(me.send_time) as send_time,me.company_id,me.send_remark,me.send_status from PPW_EMAIL.company_email_send_history me where isvalid =1 group by me.email,me.company_id) maxce
|
|
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ (SELECT
|
|
|
|
+ me.email AS email,
|
|
|
|
+ me.send_time AS send_time,
|
|
|
|
+ me.company_id,
|
|
|
|
+ me.send_remark,
|
|
|
|
+ me.send_status
|
|
|
|
+ FROM
|
|
|
|
+ PPW_EMAIL.company_email_send_history me
|
|
|
|
+ join (select mx.company_id,mx.email,max(mx.send_time) as max_send_time from PPW_EMAIL.company_email_send_history mx where mx.isvalid=1
|
|
|
|
+ GROUP BY mx.email,
|
|
|
|
+ mx.company_id) as mx on me.email=mx.email and me.company_id=mx.company_id and me.send_time=mx.max_send_time
|
|
|
|
+ WHERE me.isvalid = 1) maxce
|
|
ON cec.email = maxce.email and cec.company_id = maxce.company_id
|
|
ON cec.email = maxce.email and cec.company_id = maxce.company_id
|
|
WHERE cec.isvalid = 1 and c.isvalid=1
|
|
WHERE cec.isvalid = 1 and c.isvalid=1
|
|
<if test="companyName != null and companyName !=''">
|
|
<if test="companyName != null and companyName !=''">
|