package com.yeejoin.amos.fas.business.dao.repository;

import com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

//import com.yeejoin.amos.fas.dao.entity.FireStrength;

/**
 * <pre>
 *
 * </pre>
 *
 * @author HK
 * @version $Id: IMessageRepository.java, v 0.1 2018年1月18日 下午7:52:13 HK Exp $
 */
@Repository
public interface IContingencyOriginalDataDao  extends BaseDao<ContingencyOriginalData, String> {


    ContingencyOriginalData findByBatchNo(String batchNo);

    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(value = "update contingency_original_data c set c.confirm = ?1,c.runstep=?2 ,c.step_state=?3 where c.batch_No = ?4",nativeQuery = true)
    int updateByButton(String confirm,Boolean runstep,String stepState,String batchNo);
    

    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(value = "update contingency_original_data c set c.step = ?1 where c.batch_No = ?2",nativeQuery = true)
    int updateByButtonStep(String step,String batchNo);


}
