|
|
@@ -63,7 +63,7 @@ public interface OrderDonTicketRecordMapper extends BaseMapper<OrderDonTicketRec
|
|
|
OrderDonTicketRecord lockClaim(@Param("id") Long id,
|
|
|
@Param("workerToken") String workerToken);
|
|
|
|
|
|
- @Update("update order_don_ticket_record set status = 'success', relation_id = #{relationId}, active_relation_id = #{relationId}, worker_token = null, processing_time = null, error_msg = null, update_time = now() where id = #{id} and status = 'processing' and worker_token = #{workerToken}")
|
|
|
+ @Update("update order_don_ticket_record set status = 'success', relation_id = #{relationId}, worker_token = null, processing_time = null, error_msg = null, update_time = now() where id = #{id} and status = 'processing' and worker_token = #{workerToken}")
|
|
|
int markSuccess(@Param("id") Long id, @Param("relationId") Long relationId, @Param("workerToken") String workerToken);
|
|
|
|
|
|
@Update("update order_don_ticket_record set status = 'failed', worker_token = null, processing_time = null, error_msg = #{errorMsg}, update_time = now() where id = #{id} and status = 'processing' and worker_token = #{workerToken}")
|
|
|
@@ -107,33 +107,33 @@ public interface OrderDonTicketRecordMapper extends BaseMapper<OrderDonTicketRec
|
|
|
int countAvailable(@Param("orderId") Long orderId);
|
|
|
|
|
|
@Update("update order_don_ticket_record r " +
|
|
|
- "inner join groups_relation old_gr on old_gr.id = coalesce(r.active_relation_id, r.relation_id) " +
|
|
|
+ "inner join groups_relation old_gr on old_gr.id = r.active_relation_id " +
|
|
|
"inner join groups_trips old_gt on old_gt.id = old_gr.groups_id " +
|
|
|
"inner join groups_relation new_gr on new_gr.id = #{newRelationId} " +
|
|
|
"inner join groups_trips new_gt on new_gt.id = new_gr.groups_id " +
|
|
|
- "set r.active_relation_id = #{newRelationId}, r.update_time = now() " +
|
|
|
- "where coalesce(r.active_relation_id, r.relation_id) = #{oldRelationId} and r.status = 'success' " +
|
|
|
+ "set r.relation_id = #{newRelationId}, r.update_time = now() " +
|
|
|
+ "where r.active_relation_id = #{oldRelationId} and r.status = 'success' " +
|
|
|
"and old_gt.sku_id = new_gt.sku_id")
|
|
|
int replaceActiveRelation(@Param("oldRelationId") Long oldRelationId,
|
|
|
@Param("newRelationId") Long newRelationId);
|
|
|
|
|
|
- @Select("select r.* from order_don_ticket_record r inner join groups_relation gr on gr.id = coalesce(r.active_relation_id, r.relation_id) where gr.groups_id = #{groupsId} and r.status = 'success' order by r.item_index")
|
|
|
+ @Select("select r.* from order_don_ticket_record r inner join groups_relation gr on gr.id = r.relation_id where gr.groups_id = #{groupsId} and r.status = 'success' order by r.item_index")
|
|
|
List<OrderDonTicketRecord> selectSuccessfulByGroupsId(@Param("groupsId") Long groupsId);
|
|
|
|
|
|
@Select("select distinct r.order_id from order_don_ticket_record r " +
|
|
|
"inner join order_don o on o.id = r.order_id " +
|
|
|
- "inner join groups_relation gr on gr.id = coalesce(r.active_relation_id, r.relation_id) " +
|
|
|
+ "inner join groups_relation gr on gr.id = r.relation_id " +
|
|
|
"where gr.groups_id = #{groupsId} and r.status = 'success' " +
|
|
|
"and o.status in ('hasPayment', 'complete') order by r.order_id")
|
|
|
List<Long> selectSuccessfulOrderIdsByGroupsId(@Param("groupsId") Long groupsId);
|
|
|
|
|
|
- @Update("update order_don_ticket_record set status = 'cleared', worker_token = null, processing_time = null, error_msg = null, update_time = now() where coalesce(active_relation_id, relation_id) = #{relationId} and status = 'success'")
|
|
|
+ @Update("update order_don_ticket_record set status = 'cleared', worker_token = null, processing_time = null, error_msg = null, update_time = now() where active_relation_id = #{relationId} and status = 'success'")
|
|
|
int clearActiveRelation(@Param("relationId") Long relationId);
|
|
|
|
|
|
- @Select("select * from order_don_ticket_record where coalesce(active_relation_id, relation_id) = #{relationId} limit 1")
|
|
|
+ @Select("select * from order_don_ticket_record where active_relation_id = #{relationId} limit 1")
|
|
|
OrderDonTicketRecord selectActiveByRelationId(@Param("relationId") Long relationId);
|
|
|
|
|
|
- @Select("select * from order_don_ticket_record where coalesce(active_relation_id, relation_id) = #{relationId} limit 1 for update")
|
|
|
+ @Select("select * from order_don_ticket_record where active_relation_id = #{relationId} limit 1 for update")
|
|
|
OrderDonTicketRecord selectActiveByRelationIdForUpdate(@Param("relationId") Long relationId);
|
|
|
|
|
|
@Select("select count(*) from order_don_ticket_record where order_id = #{orderId} and status = #{status}")
|