|
@@ -11,7 +11,10 @@
|
|
<result column="send_remark" property="sendRemark"/>
|
|
<result column="send_remark" property="sendRemark"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
<update id="deleteEmailHistory">
|
|
<update id="deleteEmailHistory">
|
|
- update PPW_EMAIL.company_email_send_history set isvalid =0,updatetime=sysdate() where email=#{email}
|
|
|
|
|
|
+ update PPW_EMAIL.company_email_send_history set isvalid =0,updatetime=sysdate() where email in
|
|
|
|
+ <foreach item="email" collection="emailList" open="(" separator="," close=")">
|
|
|
|
+ #{email}
|
|
|
|
+ </foreach>
|
|
</update>
|
|
</update>
|
|
<update id="deleteEmailHistoryByIds">
|
|
<update id="deleteEmailHistoryByIds">
|
|
update PPW_EMAIL.company_email_send_history set isvalid =0,updatetime=sysdate() where id in
|
|
update PPW_EMAIL.company_email_send_history set isvalid =0,updatetime=sysdate() where id in
|
|
@@ -25,16 +28,16 @@
|
|
cec.id,
|
|
cec.id,
|
|
cec.company_id,
|
|
cec.company_id,
|
|
c.company_name,
|
|
c.company_name,
|
|
- cec.email,
|
|
|
|
- MAX(cesh.send_time) AS send_time,
|
|
|
|
|
|
+ listagg(cec.email,',') as email,
|
|
|
|
+ max(cesh.send_time) as send_time,
|
|
cesh.send_remark,
|
|
cesh.send_remark,
|
|
cesh.send_status
|
|
cesh.send_status
|
|
FROM
|
|
FROM
|
|
- PPW_EMAIL.company_email_config cec
|
|
|
|
- JOIN PPW_EMAIL.company_information 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
|
|
|
|
|
|
+ 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
|
|
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},''))
|
|
@@ -45,6 +48,7 @@
|
|
<if test="sendStatus != null and sendStatus !=''">
|
|
<if test="sendStatus != null and sendStatus !=''">
|
|
and cesh.send_status=#{sendStatus}
|
|
and cesh.send_status=#{sendStatus}
|
|
</if>
|
|
</if>
|
|
|
|
+ group by cec.company_id
|
|
</select>
|
|
</select>
|
|
<select id="searchEmailHistory" resultMap="BaseResultMap">
|
|
<select id="searchEmailHistory" resultMap="BaseResultMap">
|
|
SELECT
|
|
SELECT
|
|
@@ -58,13 +62,25 @@
|
|
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
|
|
- JOIN PPW_EMAIL.company_information 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
|
|
ON cec.email = cesh.email
|
|
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="email != null and email !=''">
|
|
|
|
- and cec.email=#{email}
|
|
|
|
|
|
+ <if test="companyId != null and companyId !=''">
|
|
|
|
+ and c.company_id=#{companyId}
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <resultMap id="BaseVOMap" type="com.simuwang.base.pojo.vo.CompanyEmailConfigVO">
|
|
|
|
+ <id column="id" property="id"/>
|
|
|
|
+ <result column="company_id" property="companyId"/>
|
|
|
|
+ <result column="company_name" property="companyName"/>
|
|
|
|
+ <result column="email" property="email"/>
|
|
|
|
+ <result column="open_status" property="openStatus"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+ <select id="searchEmailConfig" resultMap="BaseVOMap"
|
|
|
|
+ parameterType="java.lang.String">
|
|
|
|
+ select id,company_id,company_name,email,open_status from PPW_EMAIL.company_email_config where isvalid =1 and company_id=#{companyId}
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|