FileMapper.java 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. package com.gis.mapper;
  2. import com.gis.domain.po.FileEntity;
  3. import org.apache.ibatis.annotations.*;
  4. import org.springframework.stereotype.Component;
  5. import java.util.List;
  6. @Component
  7. @Mapper
  8. public interface FileMapper extends IBaseMapper<FileEntity, Long> {
  9. @Update(value = "update tb_file set fk_id = #{fkId}, type = #{type} where id = #{id} ")
  10. void setFkIdByIds(String id, Long fkId, String type);
  11. @Select(value = "select * from tb_file where rec_status = 'A' AND fk_id = #{fkId}")
  12. List<FileEntity> findByFkId(String fkId);
  13. @Delete(value = "DELETE FROM tb_file WHERE fk_id = #{fkId}")
  14. void deleteByFkId(String fkId);
  15. @Update(value = "update tb_file set cover = 0 where type = #{modelType} ")
  16. void setCoverDefault(String modelType);
  17. @Update(value = "update tb_file set cover = 1 where id = #{id}")
  18. void setCover(Long id);
  19. @Update(value = "update tb_file set cover = 0 where type = #{modelType} and fk_id = #{fkId} ")
  20. void setCoverByFkId(Long fkId, String modelType);
  21. }