|
@@ -1,7 +1,7 @@
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.simuwang.base.mapper.CompanyEmailSendHistoryMapper">
|
|
<mapper namespace="com.simuwang.base.mapper.CompanyEmailSendHistoryMapper">
|
|
- <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.vo.CompanyEmailSendHistoryVO">
|
|
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.CompanyEmailSendHistoryDO">
|
|
<id column="id" property="id"/>
|
|
<id column="id" property="id"/>
|
|
<result column="company_id" property="companyId"/>
|
|
<result column="company_id" property="companyId"/>
|
|
<result column="company_name" property="companyName"/>
|
|
<result column="company_name" property="companyName"/>
|
|
@@ -9,6 +9,11 @@
|
|
<result column="send_status" property="sendStatus"/>
|
|
<result column="send_status" property="sendStatus"/>
|
|
<result column="send_time" property="sendTime"/>
|
|
<result column="send_time" property="sendTime"/>
|
|
<result column="send_remark" property="sendRemark"/>
|
|
<result column="send_remark" property="sendRemark"/>
|
|
|
|
+ <result column="isvalid" property="isvalid"/>
|
|
|
|
+ <result column="createtime" property="createTime"/>
|
|
|
|
+ <result column="updatetime" property="updateTime"/>
|
|
|
|
+ <result column="creatorid" property="creatorId"/>
|
|
|
|
+ <result column="updaterid" property="updaterId"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
<update id="deleteEmailHistory">
|
|
<update id="deleteEmailHistory">
|
|
update PPW_EMAIL.company_email_send_history set isvalid =0,updatetime=sysdate() where email in
|
|
update PPW_EMAIL.company_email_send_history set isvalid =0,updatetime=sysdate() where email in
|
|
@@ -39,7 +44,7 @@
|
|
LEFT JOIN PPW_EMAIL.company_email_send_history cesh
|
|
LEFT JOIN PPW_EMAIL.company_email_send_history cesh
|
|
ON cec.email = cesh.email AND cesh.isvalid = 1
|
|
ON cec.email = cesh.email AND cesh.isvalid = 1
|
|
LEFT JOIN (select me.email as email,max(me.send_time) as send_time from PPW_EMAIL.company_email_send_history me where isvalid =1 group by me.email) maxce
|
|
LEFT JOIN (select me.email as email,max(me.send_time) as send_time from PPW_EMAIL.company_email_send_history me where isvalid =1 group by me.email) maxce
|
|
- ON cec.email = maxce.email
|
|
|
|
|
|
+ ON cesh.email = maxce.email
|
|
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 !=''">
|
|
and (c.company_name like concat('',#{companyName},'') or c.company_short_name like concat('',#{companyName},''))
|
|
and (c.company_name like concat('',#{companyName},'') or c.company_short_name like concat('',#{companyName},''))
|
|
@@ -51,26 +56,72 @@
|
|
and cesh.send_status=#{sendStatus}
|
|
and cesh.send_status=#{sendStatus}
|
|
</if>
|
|
</if>
|
|
group by cec.company_id
|
|
group by cec.company_id
|
|
|
|
+ limit #{offset},#{pageSize}
|
|
</select>
|
|
</select>
|
|
- <select id="searchEmailHistory" resultMap="BaseResultMap">
|
|
|
|
|
|
+
|
|
|
|
+ <select id="countCompanyEmailList" resultType="java.lang.Long"
|
|
|
|
+ parameterType="com.simuwang.base.pojo.dto.query.CompanyEmailPageQuery">
|
|
|
|
+ select count(*) from (
|
|
SELECT
|
|
SELECT
|
|
- cec.id,
|
|
|
|
|
|
+ count(cec.company_id)
|
|
|
|
+ FROM
|
|
|
|
+ PPW_EMAIL.company_email_config cec
|
|
|
|
+ JOIN PPW_EMAIL.pvn_company_info c
|
|
|
|
+ ON cec.company_id = c.company_id
|
|
|
|
+ LEFT JOIN PPW_EMAIL.company_email_send_history cesh
|
|
|
|
+ ON cec.email = cesh.email AND cesh.isvalid = 1
|
|
|
|
+ LEFT JOIN (select me.email as email,max(me.send_time) as send_time from PPW_EMAIL.company_email_send_history me where isvalid =1 group by me.email) maxce
|
|
|
|
+ ON cesh.email = maxce.email
|
|
|
|
+ WHERE cec.isvalid = 1 and c.isvalid=1
|
|
|
|
+ <if test="companyName != null and companyName !=''">
|
|
|
|
+ and (c.company_name like concat('',#{companyName},'') or c.company_short_name like concat('',#{companyName},''))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="email != null and email !=''">
|
|
|
|
+ and cec.email like concat('',#{email},'')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sendStatus != null">
|
|
|
|
+ and cesh.send_status=#{sendStatus}
|
|
|
|
+ </if>
|
|
|
|
+ group by cec.company_id) a
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="searchEmailHistory" resultMap="BaseResultMap">
|
|
|
|
+ SELECT distinct
|
|
|
|
+ cesh.id,
|
|
cec.company_id,
|
|
cec.company_id,
|
|
c.company_name,
|
|
c.company_name,
|
|
- cec.email,
|
|
|
|
|
|
+ cesh.email,
|
|
cesh.send_time,
|
|
cesh.send_time,
|
|
cesh.send_remark,
|
|
cesh.send_remark,
|
|
cesh.send_status
|
|
cesh.send_status
|
|
FROM
|
|
FROM
|
|
PPW_EMAIL.company_email_send_history cesh
|
|
PPW_EMAIL.company_email_send_history cesh
|
|
JOIN PPW_EMAIL.company_email_config cec
|
|
JOIN PPW_EMAIL.company_email_config cec
|
|
|
|
+ ON cec.email = cesh.email
|
|
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
|
|
- ON cec.email = cesh.email
|
|
|
|
|
|
+ WHERE cec.isvalid = 1
|
|
|
|
+ AND cesh.isvalid = 1 and c.isvalid =1
|
|
|
|
+ <if test="companyId != null and companyId !=''">
|
|
|
|
+ and c.company_id=#{companyId}
|
|
|
|
+ </if>
|
|
|
|
+ limit #{offset},#{pageSize}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="countCompanyEmailhistory" resultType="java.lang.Long"
|
|
|
|
+ parameterType="com.simuwang.base.pojo.dto.query.CompanyEmailHistoryPageQuery">
|
|
|
|
+ SELECT
|
|
|
|
+ count(distinct cesh.id)
|
|
|
|
+ FROM
|
|
|
|
+ PPW_EMAIL.company_email_send_history cesh
|
|
|
|
+ JOIN PPW_EMAIL.company_email_config cec
|
|
|
|
+ ON cec.email = cesh.email
|
|
|
|
+ JOIN PPW_EMAIL.pvn_company_info c
|
|
|
|
+ ON cec.company_id = c.company_id
|
|
WHERE cec.isvalid = 1
|
|
WHERE cec.isvalid = 1
|
|
AND cesh.isvalid = 1 and c.isvalid =1
|
|
AND cesh.isvalid = 1 and c.isvalid =1
|
|
<if test="companyId != null and companyId !=''">
|
|
<if test="companyId != null and companyId !=''">
|
|
and c.company_id=#{companyId}
|
|
and c.company_id=#{companyId}
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|