123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606 |
- <?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">
- <mapper namespace="com.fs.sop.mapper.QwSopLogsMapper">
- <resultMap type="QwSopLogs" id="QwSopLogsResult">
- <result property="id" column="id" />
- <result property="qwUserid" column="qw_userid" />
- <result property="externalUserId" column="external_user_id" />
- <result property="externalUserName" column="external_user_name" />
- <result property="logType" column="log_type" />
- <result property="contentJson" column="content_json" />
- <result property="sendStatus" column="send_status" />
- <result property="sendTime" column="send_time" jdbcType="VARCHAR" />
- <result property="realSendTime" column="real_send_time" jdbcType="VARCHAR" />
- <result property="companyId" column="company_id" />
- <result property="receivingStatus" column="receiving_status" />
- <result property="msgId" column="msg_id" />
- <result property="sendType" column="send_type" />
- <result property="sopId" column="sop_id" />
- <result property="remark" column="remark" />
- <result property="corpId" column="corp_id" />
- <result property="customerId" column="customer_id" />
- <result property="fsUserId" column="fs_user_id" />
- <result property="takeRecords" column="take_records" />
- <result property="sort" column="sort" />
- </resultMap>
- <sql id="selectQwSopLogsVo">
- select id,sop_id,customer_id, qw_userid,corp_id,external_user_id,external_user_name, log_type, content_json, send_status,receiving_status,msg_id, send_time, real_send_time, company_id, send_type,remark,fs_user_id,take_records from qw_sop_logs
- </sql>
- <select id="selectQwSopLogsListVO" parameterType="QwSopLogs" resultMap="QwSopLogsResult">
- <include refid="selectQwSopLogsVo"/>
- <where>
- <if test="qwUserid != null "> and qw_userid = #{qwUserid}</if>
- <if test="externalUserId != null and externalUserId != ''"> and external_user_id = #{externalUserId}</if>
- <if test="sendStatus != null "> and send_status = #{sendStatus}</if>
- <if test="corpId != null "> and corp_id = #{corpId}</if>
- </where>
- order by send_time desc
- </select>
- <select id="selectQwSopLogsList" parameterType="QwSopLogs" resultMap="QwSopLogsResult">
- <include refid="selectQwSopLogsVo"/>
- <where>
- <if test="qwUserid != null "> and qw_userid = #{qwUserid}</if>
- <if test="externalUserId != null and externalUserId != ''"> and external_user_id = #{externalUserId}</if>
- <if test="externalUserName != null and externalUserName != ''"> and external_user_name = #{externalUserName}</if>
- <if test="logType != null and logType != ''"> and log_type = #{logType}</if>
- <if test="contentJson != null and contentJson != ''"> and content_json = #{contentJson}</if>
- <if test="sendStatus != null "> and send_status = #{sendStatus}</if>
- <if test="sendTime != null "> and send_time = #{sendTime}</if>
- <if test="realSendTime != null "> and real_send_time = #{realSendTime}</if>
- <if test="companyId != null "> and company_id = #{companyId}</if>
- <if test="receivingStatus != null "> and receiving_status = #{receivingStatus}</if>
- <if test="msgId != null "> and msg_id = #{msgId}</if>
- <if test="corpId != null "> and corp_id = #{corpId}</if>
- <if test="sendType != null "> and send_type = #{sendType}</if>
- <if test="sopId != null "> and sop_id = #{sopId}</if>
- <if test="remark != null "> and remark = #{remark}</if>
- <if test="customerId != null "> and customer_id = #{customerId}</if>
- <if test="fsUserId != null "> and fs_user_id = #{fsUserId}</if>
- <if test="takeRecords != null "> and take_records = #{takeRecords}</if>
- </where>
- </select>
- <select id="selectQwSopLogsById" parameterType="String" resultMap="QwSopLogsResult">
- <include refid="selectQwSopLogsVo"/>
- where id = #{id} order by send_time
- </select>
- <insert id="insertQwSopLogs" parameterType="QwSopLogs" useGeneratedKeys="false">
- insert into qw_sop_logs
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="data.qwUserid != null">qw_userid,</if>
- <if test="data.externalUserId != null">external_user_id,</if>
- <if test="data.externalUserName != null">external_user_name,</if>
- <if test="data.logType != null">log_type,</if>
- <if test="data.contentJson != null">content_json,</if>
- <if test="data.sendStatus != null">send_status,</if>
- <if test="data.sendTime != null">send_time,</if>
- <if test="data.realSendTime != null">real_send_time,</if>
- <if test="data.sendType != null ">send_type,</if>
- <if test="data.companyId != null">company_id,</if>
- <if test="data.receivingStatus != null ">receiving_status,</if>
- <if test="data.msgId != null ">msg_id,</if>
- <if test="data.sopId != null ">sop_id,</if>
- <if test="data.remark != null ">remark,</if>
- <if test="data.corpId != null">corp_id,</if>
- <if test="data.customerId != null">customer_id,</if>
- <if test="data.fsUserId != null">fs_user_id,</if>
- <if test="data.takeRecords != null">take_records,</if>
- <if test="data.sort != null">sort,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="data.qwUserid != null">#{data.qwUserid},</if>
- <if test="data.externalUserId != null">#{data.externalUserId},</if>
- <if test="data.externalUserName != null">#{data.externalUserName},</if>
- <if test="data.logType != null">#{data.logType},</if>
- <if test="data.contentJson != null">#{data.contentJson},</if>
- <if test="data.sendStatus != null">#{data.sendStatus},</if>
- <if test="data.sendTime != null">#{data.sendTime},</if>
- <if test="data.realSendTime != null">#{data.realSendTime},</if>
- <if test="data.sendType != null ">#{data.sendType},</if>
- <if test="data.companyId != null">#{data.companyId},</if>
- <if test="data.receivingStatus != null "> #{data.receivingStatus},</if>
- <if test="data.msgId != null ">#{data.msgId},</if>
- <if test="data.sopId != null ">#{data.sopId},</if>
- <if test="data.remark != null ">#{data.remark},</if>
- <if test="data.corpId != null">#{data.corpId},</if>
- <if test="data.customerId != null">#{data.customerId},</if>
- <if test="data.fsUserId != null">#{data.fsUserId},</if>
- <if test="data.takeRecords != null">#{data.takeRecords},</if>
- <if test="data.sort != null">#{data.sort},</if>
- </trim>
- </insert>
- <update id="updateQwSopLogs" parameterType="QwSopLogs" >
- update qw_sop_logs
- <trim prefix="SET" suffixOverrides=",">
- <if test="data.externalUserName != null">external_user_name = #{data.externalUserName},</if>
- <if test="data.logType != null">log_type = #{data.logType},</if>
- <if test="data.contentJson != null">content_json = #{data.contentJson},</if>
- <if test="data.sendStatus != null">send_status = #{data.sendStatus},</if>
- <if test="data.sendTime != null">send_time = #{data.sendTime},</if>
- <if test="data.realSendTime != null">real_send_time = #{data.realSendTime},</if>
- <if test="data.companyId != null">company_id = #{data.companyId},</if>
- <if test="data.receivingStatus != null ">receiving_status = #{data.receivingStatus},</if>
- <if test="data.msgId != null ">msg_id = #{data.msgId},</if>
- <if test="data.sendType != null ">send_type = #{data.sendType},</if>
- <if test="data.sopId != null ">sop_id = #{data.sopId},</if>
- <if test="data.customerId != null ">customer_id = #{data.customerId},</if>
- <if test="data.remark != null ">remark = #{data.remark},</if>
- <if test="data.fsUserId != null ">fs_user_id = #{data.fsUserId},</if>
- <if test="data.sort != null ">sort = #{data.sort},</if>
- </trim>
- where id = #{data.id}
- </update>
- <select id="selectQwSopLogsDoSendList" resultType="com.fs.sop.vo.QwSopLogsDoSendListTVO">
- <![CDATA[
- select ql.id as id,
- ql.qw_userid,
- ql.external_user_id,
- ql.external_user_name,
- qs.name,
- ql.content_json,
- ql.send_time,
- ql.fs_user_id,
- qs.expiry_time as expiryTime
- from qw_sop_logs ql
- INNER join qw_sop qs on qs.id = ql.sop_id
- where ql.qw_userid=#{qwUserId} and ql.corp_id=#{corpId}
- and ql.log_type = 2
- and ql.send_type = 2
- and ql.send_status = 3
- and ql.send_time <= now()
- order by ql.send_time desc
- limit 5
- ]]>
- </select>
- <select id="selectQwSopLogsListByQwSopId" parameterType="com.fs.sop.params.QwSopLogsParam" resultMap="QwSopLogsResult" >
- SELECT * FROM qw_sop_logs
- <where>
- <if test="map.sopId != null">sop_id = #{map.sopId}</if>
- <if test="map.corpId != null">AND corp_id = #{map.corpId}</if>
- <if test="map.sendType != null">AND send_type = #{map.sendType}</if>
- <if test="map.sendStatus != null">AND send_status = #{map.sendStatus}</if>
- <if test="map.receivingStatus != null">AND receiving_status = #{map.receivingStatus}</if>
- <if test="map.qwUserid != null and map.qwUserid !='' ">AND qw_userid = #{map.qwUserid}</if>
- <if test="map.externalUserName != null and map.externalUserName!= '' ">AND external_user_name = #{map.externalUserName}</if>
- <if test="map.scheduleStartTime != null">AND send_time >= #{map.scheduleStartTime}</if>
- <if test="map.scheduleEndTime != null">AND send_time <= #{map.scheduleEndTime}</if>
- </where>
- ORDER BY send_time desc
- </select>
- <update id="updateQwSopLogsByWatchLogType" >
- UPDATE qw_sop_logs
- SET
- send_status = 5,
- receiving_status = 4,
- remark = #{remark},
- real_send_time = NOW()
- WHERE
- id = #{id}
- </update>
- <update id="updateQwSopLogsBycollectIds" useGeneratedKeys="false" keyProperty="id" >
- UPDATE qw_sop_logs SET
- send_status = #{sendStatus},
- msg_id = #{msgId},
- real_send_time = NOW()
- WHERE id IN
- <foreach collection="collectIds" item="id" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <delete id="deleteQwSopLogsById" parameterType="String">
- delete from qw_sop_logs where id = #{id}
- </delete>
- <delete id="deleteQwSopLogsByIds" parameterType="String">
- delete from qw_sop_logs
- where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <update id="deleteQwSopLogsBySopID" parameterType="String">
- update qw_sop_logs
- SET send_status = 5, receiving_status = 2 , remark='已删除' where sop_id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <update id="updateQwSopLogsBySendStatus">
- <![CDATA[
- update qw_sop_logs
- set
- send_status = 5,
- receiving_status = 4,
- remark = '已过期,不发送',
- real_send_time = NOW()
- WHERE
- send_status = '3'
- AND send_time <= NOW() - INTERVAL (
- SELECT expiry_time
- FROM qw_sop
- WHERE id IN (SELECT sop_id FROM qw_sop_logs WHERE send_status = '3')
- LIMIT 1
- ) HOUR
- ]]>
- </update>
- <select id="checkQwSopLogs" resultType="QwSopLogs" >
- <![CDATA[
- select * from qw_sop_logs where log_type=2 and send_status=3 and send_type=1 and send_time <= NOW()
- ]]>
- </select>
- <select id="selectSopLogsByCreateCorpMassSending" parameterType="String" resultType="QwSopLogs" >
- <![CDATA[
- select * from qw_sop_logs where log_type=2 and send_status=3 and send_type=1 and send_time >= #{date}
- ]]>
- </select>
- <select id="selectSopLogsByCreateCorpMassSendResult" resultType="QwSopLogs" >
- <![CDATA[
- SELECT
- *
- FROM
- qw_sop_logs
- WHERE
- log_type = 2
- AND send_type = 1
- AND send_status = 1
- AND receiving_status = 0
- AND msg_id IS NOT NULL
- AND DATE(send_time) = CURDATE();
- ]]>
- </select>
- <select id="qwSopLogsResult" resultType="QwSopLogs">
- <![CDATA[
- select * from qw_sop_logs
- where log_type=2
- and send_type=1
- and send_status=1
- and receiving_status=0
- AND send_time BETWEEN DATE_SUB(NOW(), INTERVAL 3 DAY) AND NOW()
- ]]>
- </select>
- <select id="getQwSopLogsByJsApiAll" parameterType="com.fs.sop.params.GetQwSopLogsByJsApiParam" resultType="com.fs.sop.vo.QwSopLogsDoSendListTVO">
- <![CDATA[
- select ql.id as id,
- ql.qw_userid,
- ql.external_user_id,
- ql.external_user_name,
- qs.name,
- ql.content_json,
- ql.send_time,
- ql.fs_user_id,
- ql.send_type,
- qs.expiry_time as expiryTime
- from qw_sop_logs ql
- left join qw_sop qs on qs.id = ql.sop_id
- where ql.qw_userid=#{data.qwUserId}
- and ql.corp_id=#{data.corpId}
- and ql.external_user_id =#{data.externalUserId}
- and ql.log_type = 2
- and ql.send_type != 1
- and ql.send_status = 3
- and ql.receiving_status = 0
- and ql.send_time <= now()
- order by ql.sort DESC ,ql.send_time asc
- LIMIT 3
- ]]>
- </select>
- <select id="getQwSopLogsByJsApi" parameterType="com.fs.sop.params.GetQwSopLogsByJsApiParam" resultType="com.fs.sop.vo.QwSopLogsDoSendListTVO">
- <![CDATA[
- select ql.id as id,
- ql.qw_userid,
- ql.external_user_id,
- ql.external_user_name,
- qs.name,
- ql.content_json,
- ql.send_time,
- ql.fs_user_id,
- qs.expiry_time as expiryTime
- from qw_sop_logs ql
- left join qw_sop qs on qs.id = ql.sop_id
- where ql.qw_userid=#{data.qwUserId}
- and ql.corp_id=#{data.corpId}
- and ql.external_user_id =#{data.externalUserId}
- and ql.log_type = 2
- and ql.send_type in (2,5)
- and ql.send_status = 3
- and ql.receiving_status = 0
- and ql.send_time <= now()
- order by ql.sort DESC ,ql.send_time asc
- ]]>
- </select>
- <select id="getQwSopLogsByJsApiOver" parameterType="com.fs.sop.params.GetQwSopLogsByJsApiParam" resultType="com.fs.sop.vo.QwSopLogsDoSendListTVO">
- <![CDATA[
- select ql.id as id,
- ql.qw_userid,
- ql.external_user_id,
- ql.external_user_name,
- ql.content_json,
- ql.send_time,
- ql.fs_user_id
- from qw_sop_logs ql
- where ql.qw_userid=#{data.qwUserId}
- and ql.corp_id=#{data.corpId}
- and ql.external_user_id =#{data.externalUserId}
- and ql.log_type = 2
- and ql.send_type = 3
- and ql.send_status = 3
- and ql.receiving_status = 0
- and ql.send_time <= now()
- order by ql.sort DESC ,ql.send_time asc
- ]]>
- </select>
- <select id="getExpiredMessagesByQwSopLogs" resultType="com.fs.sop.vo.QwSopLogsDoSendListTVO">
- <![CDATA[
- SELECT
- ql.id
- FROM
- qw_sop_logs ql
- LEFT JOIN qw_sop qs ON qs.id = ql.sop_id
- WHERE
- ql.log_type = 2
- AND ql.send_type IN (2, 5)
- AND ql.send_status = 3
- AND ql.receiving_status = 0
- AND ql.send_time <= now()
- AND (qs.expiry_time IS NOT NULL AND ql.send_time <= now() - interval qs.expiry_time hour)
- ORDER BY
- ql.sort DESC,
- ql.send_time asc;
- ]]>
- </select>
- <select id="getQwSopLogsByJsApiNext" parameterType="com.fs.sop.params.GetQwSopLogsByJsApiParam" resultType="QwSopLogs">
- <![CDATA[
- SELECT external_user_id,send_type
- FROM qw_sop_logs
- WHERE qw_userid = #{data.qwUserId}
- AND corp_id = #{data.corpId}
- AND external_user_id != #{data.externalUserId}
- AND log_type = 2
- AND send_status = 3
- AND send_type !=1
- AND receiving_status = 0
- AND send_time <= now()
- ORDER BY sort DESC,send_time ASC, rand()
- LIMIT 1
- ]]>
- </select>
- <delete id="deleteQwSopLogsByJsApi" parameterType="com.fs.sop.params.GetQwSopLogsByJsApiParam" >
- delete FROM qw_sop_logs
- where qw_userid = #{data.qwUserId}
- AND corp_id = #{data.corpId}
- AND external_user_id = #{data.externalUserId}
- </delete>
- <delete id="deleteQwSopLogsByRemoveSop" parameterType="String" >
- delete FROM qw_sop_logs
- where qw_userid = #{qwUserId}
- AND corp_id = #{corpId}
- AND sop_id = #{sopId}
- </delete>
- <delete id="deleteQwSopLogsByExternalUserIdList" parameterType="com.fs.sop.params.DeleteQwSopParam" >
- delete FROM qw_sop_logs
- where qw_userid = #{data.qwUserId}
- AND corp_id = #{data.corpId}
- AND external_user_id IN
- <foreach collection="data.externalUserIds" item="extId" open="(" separator="," close=")">
- #{extId}
- </foreach>
- </delete>
- <insert id="batchInsertQwSopLogsOneTouch" parameterType="java.util.List" useGeneratedKeys="false">
- INSERT INTO qw_sop_logs
- (
- qw_userid, external_user_id, external_user_name, log_type,
- content_json, send_status, send_time, real_send_time, send_type,
- company_id, receiving_status, msg_id, sop_id, remark,
- corp_id, customer_id, fs_user_id,sort
- )
- VALUES
- <foreach collection="qwSopLogs" item="log" separator=",">
- (
- #{log.qwUserid},
- #{log.externalUserId},
- #{log.externalUserName},
- #{log.logType},
- #{log.contentJson},
- #{log.sendStatus},
- #{log.sendTime},
- #{log.realSendTime},
- #{log.sendType},
- #{log.companyId},
- #{log.receivingStatus},
- #{log.msgId},
- #{log.sopId},
- #{log.remark},
- #{log.corpId},
- #{log.customerId},
- #{log.fsUserId},
- #{log.sort}
- )
- </foreach>
- </insert>
- <!-- 批量插入 QwSopLogs -->
- <insert id="batchInsertQwSopLogs" parameterType="java.util.List" useGeneratedKeys="false">
- INSERT INTO qw_sop_logs
- (
- qw_userid, external_user_id, external_user_name, log_type,
- content_json, send_status, send_time, real_send_time, send_type,
- company_id, receiving_status, msg_id, sop_id, remark,
- corp_id, customer_id, fs_user_id
- )
- VALUES
- <foreach collection="qwSopLogs" item="log" separator=",">
- (
- #{log.qwUserid},
- #{log.externalUserId},
- #{log.externalUserName},
- #{log.logType},
- #{log.contentJson},
- #{log.sendStatus},
- #{log.sendTime},
- #{log.realSendTime},
- #{log.sendType},
- #{log.companyId},
- #{log.receivingStatus},
- #{log.msgId},
- #{log.sopId},
- #{log.remark},
- #{log.corpId},
- #{log.customerId},
- #{log.fsUserId}
- )
- </foreach>
- </insert>
- <!-- 批量更新 QwSopLogs -->
- <update id="batchUpdateQwSopLogsByTakeRecordsList" parameterType="java.util.List" useGeneratedKeys="false">
- UPDATE qw_sop_logs
- SET take_records = 1
- WHERE id IN
- <foreach collection="data" item="log" open="(" separator="," close=")">
- #{log.id}
- </foreach>
- </update>
- <update id="updateQwSopLogsByDeleted" parameterType="com.fs.sop.params.GetQwSopLogsByJsApiParam" useGeneratedKeys="false">
- <![CDATA[
- UPDATE qw_sop_logs
- SET
- send_status = 5,
- receiving_status = 4,
- remark = '非外部联系人',
- real_send_time = NOW()
- WHERE qw_userid = #{data.qwUserId}
- AND corp_id = #{data.corpId}
- AND external_user_id = #{data.externalUserId}
- AND send_time <= now()
- ]]>
- </update>
- <!-- 批量更新 QwSopLogs -->
- <update id="batchUpdateQwSopLogsBySendTime" parameterType="java.util.List" useGeneratedKeys="false">
- UPDATE qw_sop_logs
- SET
- send_status = 5,
- receiving_status = 4,
- remark = '已过期,不发送',
- real_send_time = NOW()
- WHERE id IN
- <foreach collection="data" item="log" open="(" separator="," close=")">
- #{log.id}
- </foreach>
- </update>
- <select id="selectQwSopLogsByCancel" resultMap="QwSopLogsResult">
- <include refid="selectQwSopLogsVo"/>
- <![CDATA[
- WHERE send_type = 3
- AND send_status = 5
- AND receiving_status = 4
- AND remark = '已过期,不发送'
- AND real_send_time >= now() - INTERVAL 1 HOUR
- AND real_send_time < now()
- ]]>
- </select>
- <select id="selectQwSopLogsListByChatSopId" resultType="com.fs.sop.vo.QwSopLogsListCVO">
- SELECT * FROM qw_sop_logs
- <where>
- <if test="map.sopId != null">sop_id = #{map.sopId}</if>
- <if test="map.corpId != null">AND corp_id = #{map.corpId}</if>
- <if test="map.sendType != null">AND send_type = #{map.sendType}</if>
- <if test="map.sendStatus != null">AND send_status = #{map.sendStatus}</if>
- <if test="map.receivingStatus != null">AND receiving_status = #{map.receivingStatus}</if>
- <if test="map.qwUserid != null and map.qwUserid !='' ">AND qw_userid = #{map.qwUserid}</if>
- <if test="map.externalUserName != null and map.externalUserName!= '' ">AND external_user_name = #{map.externalUserName}</if>
- <if test="map.scheduleStartTime != null">AND send_time >= #{map.scheduleStartTime}</if>
- <if test="map.scheduleEndTime != null">AND send_time <= #{map.scheduleEndTime}</if>
- </where>
- ORDER BY send_time desc
- </select>
- <select id="selectQwSopLogsCountByQwUserId" resultType="java.lang.Long">
- select count(1) from qw_sop_logs
- <where>
- AND type = '0'
- AND send_status = '1'
- AND DATE(real_send_time) = #{previousDay}
- AND user_logs_id = #{periodId}
- <if test="data != null and data.size() > 0">
- AND qw_userid in
- <foreach collection="data" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </where>
- </select>
- <!-- 批量更新 QwSopLogs -->
- <update id="batchUpdateQwSopLogsByCancel" parameterType="java.util.List" useGeneratedKeys="false">
- UPDATE qw_sop_logs
- SET
- send_status = 3,
- receiving_status = 0,
- remark = null,
- real_send_time = null,
- send_time = DATE_ADD(now(), INTERVAL 30 MINUTE)
- WHERE id IN
- <foreach collection="data" item="log" open="(" separator="," close=")">
- #{log.id}
- </foreach>
- </update>
- <update id="batchUpdateQwSopLogsById" parameterType="java.util.List" useGeneratedKeys="false">
- UPDATE qw_sop_logs
- SET
- send_status = 5,
- remark = 'ai回复超时过期'
- WHERE id IN
- <foreach collection="data" item="log" open="(" separator="," close=")">
- #{log.id}
- </foreach>
- </update>
- <delete id="deleteQwSopLogsByDate" >
- <![CDATA[
- DELETE FROM qw_sop_logs WHERE DATE(send_time) < CURDATE() - INTERVAL 2 DAY;
- ]]>
- </delete>
- </mapper>
|