package com.ankaibei.workFlow.webadmin.ankaibei.mapper;


import com.ankaibei.workFlow.webadmin.ankaibei.entity.PurchaseInfoEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;

/**
 * @author lwq
 * @version 1.0
 * @description:
 * @date 2022/9/26 18:05
 */
public interface PurchaseInfoMapper extends JpaRepository<PurchaseInfoEntity, Integer>, JpaSpecificationExecutor<PurchaseInfoEntity> {

    @Transactional
    @Modifying
    @Query(value = "update purchase_info SET flow_task_status = ?1 WHERE purchase_id = ?2", nativeQuery = true)
    void updatePurchaseInfoFlowStatus(String flowTaskStatus, Integer purchaseId);

}
