|
@@ -117,13 +117,19 @@
|
|
|
FROM
|
|
|
email_parse_info epi
|
|
|
left join hosted_email_info hei
|
|
|
- on hei.email = epi.sender_email and hei.isvalid=1
|
|
|
+ on hei.email = epi.sender_email and hei.isvalid=1 and hei.open_status=1
|
|
|
left join pvn_company_info pci
|
|
|
on pci.company_id = hei.company_id and pci.isvalid=1
|
|
|
where epi.isvalid=1
|
|
|
<if test="emailTitle !=null and emailTitle !=''">
|
|
|
and epi.email_title like concat('%',#{emailTitle},'%')
|
|
|
</if>
|
|
|
+ <if test="isHosted !=null and isHosted ==0">
|
|
|
+ and pci.company_name is null
|
|
|
+ </if>
|
|
|
+ <if test="isHosted !=null and isHosted ==1">
|
|
|
+ and pci.company_name is not null
|
|
|
+ </if>
|
|
|
<if test="emailType !=null">
|
|
|
and epi.email_type = #{emailType}
|
|
|
</if>
|
|
@@ -196,8 +202,53 @@
|
|
|
</select>
|
|
|
<select id="countEmailList" resultType="java.lang.Long"
|
|
|
parameterType="com.simuwang.base.pojo.dto.query.EmailParseQuery">
|
|
|
- select count(*) from email_parse_info epi
|
|
|
- <include refid="sqlwhereSearch"/>
|
|
|
+ select count(epi.id)
|
|
|
+ FROM
|
|
|
+ email_parse_info epi
|
|
|
+ left join hosted_email_info hei
|
|
|
+ on hei.email = epi.sender_email and hei.isvalid=1 and hei.open_status=1
|
|
|
+ left join pvn_company_info pci
|
|
|
+ on pci.company_id = hei.company_id and pci.isvalid=1
|
|
|
+ where epi.isvalid=1
|
|
|
+ <if test="emailTitle !=null and emailTitle !=''">
|
|
|
+ and epi.email_title like concat('%',#{emailTitle},'%')
|
|
|
+ </if>
|
|
|
+ <if test="isHosted !=null and isHosted ==0">
|
|
|
+ and pci.company_name is null
|
|
|
+ </if>
|
|
|
+ <if test="isHosted !=null and isHosted ==1">
|
|
|
+ and pci.company_name is not null
|
|
|
+ </if>
|
|
|
+ <if test="emailType !=null">
|
|
|
+ and epi.email_type = #{emailType}
|
|
|
+ </if>
|
|
|
+ <if test="reviewStatus !=null">
|
|
|
+ and epi.review_status = #{reviewStatus}
|
|
|
+ </if>
|
|
|
+ <if test="parseStatus !=null">
|
|
|
+ and epi.parse_status = #{parseStatus}
|
|
|
+ </if>
|
|
|
+ <if test="startDate !=null and startDate != ''">
|
|
|
+ and epi.parse_date <![CDATA[ >= ]]> #{startDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate !=null and endDate != ''">
|
|
|
+ and epi.parse_date <![CDATA[ <= ]]> #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="emailStartDate !=null and emailStartDate != ''">
|
|
|
+ and epi.email_date <![CDATA[ >= ]]> #{emailStartDate}
|
|
|
+ </if>
|
|
|
+ <if test="emailEndDate !=null and emailEndDate != ''">
|
|
|
+ and epi.email_date <![CDATA[ <= ]]> #{emailEndDate}
|
|
|
+ </if>
|
|
|
+ <if test="id !=null">
|
|
|
+ and epi.id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="email !=null and email !=''">
|
|
|
+ and epi.email like concat('%',#{email},'%')
|
|
|
+ </if>
|
|
|
+ <if test="senderEmail !=null and senderEmail !=''">
|
|
|
+ and epi.sender_email like concat('%',#{senderEmail},'%')
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<update id="updateParseTime">
|