FileMapper.java 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. package com.gis.mapper;
  2. import com.gis.domain.po.FileEntity;
  3. import org.apache.ibatis.annotations.Mapper;
  4. import org.apache.ibatis.annotations.Select;
  5. import org.apache.ibatis.annotations.Update;
  6. import org.springframework.stereotype.Component;
  7. import java.util.List;
  8. @Component
  9. @Mapper
  10. public interface FileMapper extends IBaseMapper<FileEntity, Long> {
  11. @Update("update tb_file set is_index = 1 , update_time = NOW() where is_delete = 0 and id = #{fileId} ")
  12. void indexEnabled(Long fileId);
  13. @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}")
  14. void indexDisable(Long moduleId, String module);
  15. @Update("update tb_file set module_id = #{moduleId} , update_time = NOW() where is_delete = 0 and module = #{module} and id in ( ${fileIds} )")
  16. void addModuleIdToFile(String fileIds, Long moduleId, String module);
  17. @Select("select * from tb_file where is_delete = 0 and is_index = 1 and module = #{module} and module_id = #{moduleId} limit 1")
  18. List<FileEntity> findIndexByModule(Long moduleId, String module);
  19. @Select("select * from tb_file where is_delete = 0 and module = #{module} and module_id = #{moduleId} ")
  20. List<FileEntity> findByModuleId(Long moduleId, String module);
  21. }