package com.sw.mes.fb.turnstore.dao;


import com.sw.mes.core.base.BaseDao;
import com.sw.mes.fb.turnstore.entity.TurnStoreSend;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
* @Author
* @Description：
* @Date:
* @Modified By:
*/
public interface TurnStoreSendDao extends BaseDao<TurnStoreSend, Long> {

    @Modifying
    @Transactional
    @Query(value = "UPDATE zhxx_turnstore_send SET `state`=?2,remark=?3,update_user_id=?4,update_user_name=?5,update_time=?6 WHERE id =?1 ", nativeQuery = true)
    void updateStateById(Long id, int i, String remark, Integer userID, String username, Date date);

    @Modifying
    @Transactional
    @Query(value = "UPDATE zhxx_turnstore_send SET `state`=?2,update_user_id=?3,update_user_name=?4,remark=?5,update_time=?6 WHERE id =?1 ", nativeQuery = true)
    void affirmById(Long id, int i, Integer userID, String username, String remark, Date date);

    @Modifying
    @Transactional
    @Query(value = "UPDATE zhxx_turnstore_send SET `state`=?2 WHERE id =?1 ", nativeQuery = true)
    void cancel(Long id, int i);
}
