|
|
@@ -11,123 +11,26 @@ import java.util.List;
|
|
|
@Mapper
|
|
|
public interface FsTagUpdateQueueMapper {
|
|
|
|
|
|
- @Select("select * from fs_tag_update_queue where retry_count < 3 and status in (0,3) and (next_execute_time < now() or next_execute_time is null) limit 500")
|
|
|
+ @Select("select * from fs_tag_update_queue where retry_count < 3 and status in (0,3) and (next_execute_time < now() or next_execute_time is null) limit 1000")
|
|
|
List<FsTagUpdateQueue> selectPending();
|
|
|
|
|
|
- @Select("<script>" +
|
|
|
- "SELECT * FROM fs_tag_update_queue " +
|
|
|
- "<where>" +
|
|
|
- "<if test='id != null'> AND id = #{id} </if>" +
|
|
|
- "<if test='courseLogId != null'> AND course_log_id = #{courseLogId} </if>" +
|
|
|
- "<if test='courseId != null'> AND course_id = #{courseId} </if>" +
|
|
|
- "<if test='tagId != null'> AND tag_id = #{tagId} </if>" +
|
|
|
- "<if test='tagName != null'> AND tag_name = #{tagName} </if>" +
|
|
|
- "<if test='operationType != null'> AND operation_type = #{operationType} </if>" +
|
|
|
- "<if test='videoId != null'> AND video_id = #{videoId} </if>" +
|
|
|
- "<if test='status != null'> AND status = #{status} </if>" +
|
|
|
- "<if test='retryCount != null'> AND retry_count = #{retryCount} </if>" +
|
|
|
- "<if test='corpId != null'> AND corp_id = #{corpId} </if>" +
|
|
|
- "<if test='qwUserId != null'> AND qw_user_id = #{qwUserId} </if>" +
|
|
|
- "</where>" +
|
|
|
- "</script>")
|
|
|
- List<FsTagUpdateQueue> selectByConditions(FsTagUpdateQueue condition);
|
|
|
-
|
|
|
- @Insert("<script>" +
|
|
|
- "INSERT INTO fs_tag_update_queue " +
|
|
|
- "(course_log_id, course_id, tag_id, tag_name, operation_type, video_id, status, retry_count, corp_id, qw_user_id, fail_msg, payload, response, create_time, update_time, update_by, create_by,log_type) " +
|
|
|
- "VALUES " +
|
|
|
- "<trim prefix='(' suffix=')' suffixOverrides=','>" +
|
|
|
- "<if test='courseLogId != null'>course_log_id,</if>" +
|
|
|
- "<if test='courseId != null'>course_id,</if>" +
|
|
|
- "<if test='tagId != null'>tag_id,</if>" +
|
|
|
- "<if test='tagName != null'>tag_name,</if>" +
|
|
|
- "<if test='operationType != null'>operation_type,</if>" +
|
|
|
- "<if test='videoId != null'>video_id,</if>" +
|
|
|
- "<if test='status != null'>status,</if>" +
|
|
|
- "<if test='retryCount != null'>retry_count,</if>" +
|
|
|
- "<if test='corpId != null'>corp_id,</if>" +
|
|
|
- "<if test='qwUserId != null'>qw_user_id,</if>" +
|
|
|
- "<if test='qwExternalContactId != null'>qw_external_contact_id,</if>" +
|
|
|
- "<if test='failMsg != null'>fail_msg,</if>" +
|
|
|
- "<if test='payload != null'>payload,</if>" +
|
|
|
- "<if test='response != null'>response,</if>" +
|
|
|
- "<if test='createTime != null'>create_time,</if>" +
|
|
|
- "<if test='updateTime != null'>update_time,</if>" +
|
|
|
- "<if test='updateBy != null'>update_by,</if>" +
|
|
|
- "<if test='createBy != null'>create_by,</if>" +
|
|
|
- "<if test='logType != null'>log_type,</if>" +
|
|
|
- "</trim>" +
|
|
|
- "<trim prefix='VALUES (' suffix=')' suffixOverrides=','>" +
|
|
|
- "<if test='courseLogId != null'>#{courseLogId},</if>" +
|
|
|
- "<if test='courseId != null'>#{courseId},</if>" +
|
|
|
- "<if test='tagId != null'>#{tagId},</if>" +
|
|
|
- "<if test='tagName != null'>#{tagName},</if>" +
|
|
|
- "<if test='operationType != null'>#{operationType},</if>" +
|
|
|
- "<if test='videoId != null'>#{videoId},</if>" +
|
|
|
- "<if test='status != null'>#{status},</if>" +
|
|
|
- "<if test='retryCount != null'>#{retryCount},</if>" +
|
|
|
- "<if test='corpId != null'>#{corpId},</if>" +
|
|
|
- "<if test='qwExternalContactId != null'>#{qwExternalContactId},</if>" +
|
|
|
- "<if test='qwUserId != null'>#{qwUserId},</if>" +
|
|
|
- "<if test='failMsg != null'>#{failMsg},</if>" +
|
|
|
- "<if test='payload != null'>#{payload},</if>" +
|
|
|
- "<if test='response != null'>#{response},</if>" +
|
|
|
- "<if test='createTime != null'>#{createTime},</if>" +
|
|
|
- "<if test='updateTime != null'>#{updateTime},</if>" +
|
|
|
- "<if test='updateBy != null'>#{updateBy},</if>" +
|
|
|
- "<if test='createBy != null'>#{createBy},</if>" +
|
|
|
- "<if test='log_type != null'>#{logType},</if>" +
|
|
|
- "</trim>" +
|
|
|
- "</script>")
|
|
|
- @Options(useGeneratedKeys=true, keyProperty="id", keyColumn="id")
|
|
|
- int insertSelective(FsTagUpdateQueue record);
|
|
|
-
|
|
|
-
|
|
|
|
|
|
@Insert("<script>" +
|
|
|
"INSERT IGNORE INTO fs_tag_update_queue (" +
|
|
|
- "course_log_id, is_first, course_id, tag_id, tag_name, operation_type, video_id, status, retry_count, " +
|
|
|
- "corp_id, qw_user_id, qw_external_contact_id, fail_msg, payload, response, create_time, update_time, update_by, create_by, log_type,tg_id,watching_tg_id,watched_tg_id,watching_tag_id,watched_tag_id,tag_group_id" +
|
|
|
+ "course_log_id, is_first, course_id, operation_type, video_id, status, retry_count, " +
|
|
|
+ "corp_id, qw_user_id, qw_external_contact_id, fail_msg, payload, response, create_time, update_time, update_by, create_by, log_type,watching_tg_id,watched_tg_id,watching_tag_id,watched_tag_id,watching_tg_group_id,watched_tg_group_id" +
|
|
|
") VALUES " +
|
|
|
"<foreach collection='list' item='item' separator=','>" +
|
|
|
"(" +
|
|
|
- "#{item.courseLogId}, #{item.isFirst}, #{item.courseId}, #{item.tagId}, #{item.tagName}, #{item.operationType}, #{item.videoId}, #{item.status}, #{item.retryCount}, " +
|
|
|
+ "#{item.courseLogId}, #{item.isFirst}, #{item.courseId}, #{item.operationType}, #{item.videoId}, #{item.status}, #{item.retryCount}, " +
|
|
|
"#{item.corpId}, #{item.qwUserId}, #{item.qwExternalContactId}, #{item.failMsg}, #{item.payload}, #{item.response}, #{item.createTime}," +
|
|
|
- " #{item.updateTime}, #{item.updateBy}, #{item.createBy}, #{item.logType},#{item.tgId},#{item.watchingTgId},#{item.watchedTgId},#{item.watchingTagId},#{item.watchedTagId},#{item.tagGroupId}" +
|
|
|
+ " #{item.updateTime}, #{item.updateBy}, #{item.createBy}, #{item.logType},#{item.watchingTgId},#{item.watchedTgId},#{item.watchingTagId},#{item.watchedTagId},#{item.watchingTgGroupId},#{item.watchedTgGroupId}" +
|
|
|
")" +
|
|
|
"</foreach>" +
|
|
|
"</script>")
|
|
|
int batchInsert(@Param("list") List<FsTagUpdateQueue> list);
|
|
|
|
|
|
|
|
|
- @Update("<script>" +
|
|
|
- "UPDATE fs_tag_update_queue " +
|
|
|
- "<set>" +
|
|
|
- "<if test='courseLogId != null'>course_log_id = #{courseLogId},</if>" +
|
|
|
- "<if test='courseId != null'>course_id = #{courseId},</if>" +
|
|
|
- "<if test='tagId != null'>tag_id = #{tagId},</if>" +
|
|
|
- "<if test='tagName != null'>tag_name = #{tagName},</if>" +
|
|
|
- "<if test='operationType != null'>operation_type = #{operationType},</if>" +
|
|
|
- "<if test='videoId != null'>video_id = #{videoId},</if>" +
|
|
|
- "<if test='status != null'>status = #{status},</if>" +
|
|
|
- "<if test='retryCount != null'>retry_count = #{retryCount},</if>" +
|
|
|
- "<if test='corpId != null'>corp_id = #{corpId},</if>" +
|
|
|
- "<if test='qwUserId != null'>qw_user_id = #{qwUserId},</if>" +
|
|
|
- "<if test='failMsg != null'>fail_msg = #{failMsg},</if>" +
|
|
|
- "<if test='payload != null'>payload = #{payload},</if>" +
|
|
|
- "<if test='response != null'>response = #{response},</if>" +
|
|
|
- "<if test='createTime != null'>create_time = #{createTime},</if>" +
|
|
|
- "<if test='updateTime != null'>update_time = #{updateTime},</if>" +
|
|
|
- "<if test='updateBy != null'>update_by = #{updateBy},</if>" +
|
|
|
- "<if test='createBy != null'>create_by = #{createBy},</if>" +
|
|
|
- "<if test='logType != null'>log_type = #{logType},</if>" +
|
|
|
- "</set> " +
|
|
|
- "WHERE id = #{id}" +
|
|
|
- "</script>")
|
|
|
- int updateSelective(FsTagUpdateQueue record);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
@Update("<script>" +
|
|
|
"<foreach collection='list' item='item' separator=';'>" +
|
|
|
"UPDATE fs_tag_update_queue" +
|
|
|
@@ -135,8 +38,6 @@ public interface FsTagUpdateQueueMapper {
|
|
|
"<if test='item.courseLogId != null'>course_log_id = #{item.courseLogId},</if>" +
|
|
|
"<if test='item.isFirst != null'>is_first = #{item.isFirst},</if>" +
|
|
|
"<if test='item.courseId != null'>course_id = #{item.courseId},</if>" +
|
|
|
- "<if test='item.tagId != null'>tag_id = #{item.tagId},</if>" +
|
|
|
- "<if test='item.tagName != null'>tag_name = #{item.tagName},</if>" +
|
|
|
"<if test='item.operationType != null'>operation_type = #{item.operationType},</if>" +
|
|
|
"<if test='item.videoId != null'>video_id = #{item.videoId},</if>" +
|
|
|
"<if test='item.status != null'>status = #{item.status},</if>" +
|