package com.gis.mapper; import com.gis.domain.po.FileEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import org.springframework.stereotype.Component; import java.util.List; @Component @Mapper public interface FileMapper extends IBaseMapper { @Update("update tb_file set is_index = 1 , update_time = NOW() where is_delete = 0 and id = #{fileId} ") void indexEnabled(Long fileId); @Update("update tb_file set is_index = 0 , update_time = NOW() where is_delete = 0 and is_index = 1 and module = #{module} and module_id = #{moduleId}") void indexDisable(Long moduleId, String module); @Update("update tb_file set module_id = #{moduleId} , update_time = NOW() where is_delete = 0 and module = #{module} and id in ( ${fileIds} )") void addModuleIdToFile(String fileIds, Long moduleId, String module); @Select("select * from tb_file where is_delete = 0 and is_index = 1 and module = #{module} and module_id = #{moduleId} limit 1") List findIndexByModule(Long moduleId, String module); @Select("select * from tb_file where is_delete = 0 and module = #{module} and module_id = #{moduleId} ") List findByModuleId(Long moduleId, String module); }