|
@@ -0,0 +1,54 @@
|
|
|
+package com.fs.erp.mapper;
|
|
|
+
|
|
|
+import com.fs.erp.domain.FsJstAftersalePush;
|
|
|
+import org.apache.ibatis.annotations.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 订阅物流Mapper
|
|
|
+ */
|
|
|
+@Mapper
|
|
|
+public interface FsJstAftersalePushMapper {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据ID查询
|
|
|
+ */
|
|
|
+ @Select("SELECT * FROM fs_jst_aftersale_push WHERE id = #{id}")
|
|
|
+ FsJstAftersalePush selectById(Long id);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据订单ID查询
|
|
|
+ */
|
|
|
+ @Select("SELECT * FROM fs_jst_aftersale_push WHERE order_id = #{orderId}")
|
|
|
+ FsJstAftersalePush selectByOrderId(String orderId);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询待处理的任务
|
|
|
+ */
|
|
|
+ @Select("SELECT * FROM fs_jst_aftersale_push WHERE task_status = #{status} AND retry_count < #{maxRetry} LIMIT #{limit}")
|
|
|
+ List<FsJstAftersalePush> selectByStatusAndRetry(Byte status, Integer maxRetry, Integer limit);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 插入记录
|
|
|
+ */
|
|
|
+ @Insert("INSERT INTO fs_jst_aftersale_push(order_id, type, task_status, retry_count, last_execute_time, params) " +
|
|
|
+ "VALUES(#{orderId}, #{type}, #{taskStatus}, #{retryCount}, #{lastExecuteTime}, #{params})")
|
|
|
+ @Options(useGeneratedKeys = true, keyProperty = "id")
|
|
|
+ int insert(FsJstAftersalePush push);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新记录
|
|
|
+ */
|
|
|
+ @Update("UPDATE fs_jst_aftersale_push SET task_status = #{taskStatus}, retry_count = #{retryCount}, " +
|
|
|
+ "last_execute_time = #{lastExecuteTime}, result = #{result}, error_message = #{errorMessage} " +
|
|
|
+ "WHERE id = #{id}")
|
|
|
+ int update(FsJstAftersalePush push);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新任务状态
|
|
|
+ */
|
|
|
+ @Update("UPDATE fs_jst_aftersale_push SET task_status = #{taskStatus}, " +
|
|
|
+ "last_execute_time = now() WHERE id = #{id}")
|
|
|
+ int updateStatus(@Param("id") Long id, @Param("taskStatus") Byte taskStatus);
|
|
|
+}
|