|
@@ -18,6 +18,7 @@
|
|
|
<result column="updatetime" property="updateTime"/>
|
|
|
<result column="sender_email" property="senderEmail"/>
|
|
|
<result column="review_status" property="reviewStatus"/>
|
|
|
+ <result column="company_name" property="companyName"/>
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
@@ -96,8 +97,63 @@
|
|
|
</where>
|
|
|
</sql>
|
|
|
<select id="searchEmailList" resultMap="BaseResultMap">
|
|
|
- <include refid="selectEmailParse"/>
|
|
|
- <include refid="sqlwhereSearch"/>
|
|
|
+ SELECT
|
|
|
+ epi.id,
|
|
|
+ epi.email,
|
|
|
+ pci.company_name,
|
|
|
+ epi.email_date,
|
|
|
+ epi.parse_date,
|
|
|
+ epi.email_title,
|
|
|
+ epi.email_type,
|
|
|
+ epi.parse_status,
|
|
|
+ epi.fail_reason,
|
|
|
+ epi.isvalid,
|
|
|
+ epi.creatorid,
|
|
|
+ epi.createtime,
|
|
|
+ epi.updatetime,
|
|
|
+ epi.updaterid,
|
|
|
+ epi.sender_email,
|
|
|
+ epi.review_status
|
|
|
+ FROM
|
|
|
+ email_parse_info epi
|
|
|
+ left join hosted_email_info hei
|
|
|
+ on hei.email = epi.sender_email and hei.isvalid=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="emailType !=null">
|
|
|
+ and epi.email_type = #{emailType}
|
|
|
+ </if>
|
|
|
+ <if test="reviewStatus !=null and reviewStatus != ''">
|
|
|
+ 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>
|
|
|
<choose>
|
|
|
<when test="sort != null and sort !='' and sort=='parseDate' and order != null and order !=''">
|
|
|
order by epi.parse_date ${order}
|