package com.ssj.dao.sys.jxy.dao;

import com.ssj.bean.sys.jxy.domain.JxyImg;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface JxyImgDao extends JpaRepository<JxyImg, String>{

	 Optional<JxyImg> findById(String Id);
   
	 @Query(nativeQuery = true, value = "update tb_jxy_read_file set img_index = ?2  where id = ?1 ")
	 @Modifying
	 public void updateImgIndex(String id, Integer imgIndex);
	 
	 @Query(nativeQuery = true, value = "select  count(1)  from  tb_jxy_read_file where leady_id = ?1 ")
	 public Integer countLeadyId(String leadyId);
}
