select id, plan_id, seq, send_type, send_time, title_name, content, template_id, url,
send_status, retry_count, next_retry_time, send_time_actual,
followup_date, followup_user_id, followup_user_name, followup_situation, followup_status,
result_msg, provider_msg_id, create_time, update_time
from mch_followup_plan_item
insert into mch_followup_plan_item
(plan_id, seq, send_type, send_time, title_name, content, template_id, url,
send_status, retry_count, next_retry_time, send_time_actual,
followup_date, followup_user_id, followup_user_name, followup_situation, followup_status,
result_msg, provider_msg_id, create_time, update_time)
values
(#{planId}, #{seq}, #{sendType}, #{sendTime}, #{titleName}, #{content}, #{templateId}, #{url},
#{sendStatus}, #{retryCount}, #{nextRetryTime}, #{sendTimeActual},
#{followupDate}, #{followupUserId}, #{followupUserName}, #{followupSituation},
COALESCE(#{followupStatus,jdbcType=CHAR}, '0'),
#{resultMsg}, #{providerMsgId}, #{createTime}, #{updateTime})
update mch_followup_plan_item
send_type = #{sendType},
send_time = #{sendTime},
title_name = #{titleName},
content = #{content},
template_id = #{templateId},
url = #{url},
send_status = #{sendStatus},
retry_count = #{retryCount},
next_retry_time = #{nextRetryTime},
send_time_actual = #{sendTimeActual},
followup_date = #{followupDate},
followup_user_id = #{followupUserId},
followup_user_name = #{followupUserName},
followup_situation = #{followupSituation},
followup_status = #{followupStatus},
result_msg = #{resultMsg},
provider_msg_id = #{providerMsgId},
update_time = #{updateTime},
where id = #{id}
update mch_followup_plan_item
set send_status = #{sendStatus,jdbcType=CHAR},
retry_count = #{retryCount,jdbcType=INTEGER},
next_retry_time = #{nextRetryTime,jdbcType=TIMESTAMP},
send_time_actual = #{sendTimeActual,jdbcType=TIMESTAMP},
result_msg = #{resultMsg,jdbcType=VARCHAR},
provider_msg_id = #{providerMsgId,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id}
update mch_followup_plan_item
set followup_date = #{followupDate,jdbcType=TIMESTAMP},
followup_user_id = #{followupUserId,jdbcType=VARCHAR},
followup_user_name = #{followupUserName,jdbcType=VARCHAR},
followup_situation = #{followupSituation,jdbcType=VARCHAR},
followup_status = #{followupStatus,jdbcType=CHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id}
update mch_followup_plan_item
set send_status = '1',
update_time = #{now}
where id = #{id}
and send_status = '0'
update mch_followup_plan_item
set send_status = '5',
result_msg = '计划重建,取消未发送节点',
update_time = #{now}
where plan_id = #{planId}
and send_status = '0'