38 lines
1.1 KiB
Java
38 lines
1.1 KiB
Java
package com.gunshi.project.xyt.mapper;
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
import com.gunshi.project.xyt.model.FileAssociations;
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 描述: 文件关联业务表
|
|
* author: xusan
|
|
* date: 2024-07-17 10:09:40
|
|
*/
|
|
@Mapper
|
|
public interface FileAssociationsMapper extends BaseMapper<FileAssociations> {
|
|
|
|
@Select("""
|
|
<script>
|
|
SELECT
|
|
fa.*,
|
|
fd.file_name,
|
|
fd.file_size,
|
|
fd.file_path
|
|
FROM
|
|
file_associations fa
|
|
LEFT JOIN file_descriptor fd ON fa.file_id = fd.file_id
|
|
WHERE
|
|
fa.del = '1'
|
|
AND fa.business_id = #{businessId}
|
|
AND fa."table_name" = #{tableName}
|
|
AND fd.group_id = #{tableName}
|
|
ORDER BY fa.tm desc
|
|
</script>
|
|
""")
|
|
List<FileAssociations> getFiles(@Param("tableName") String tableName,@Param("businessId") String businessId);
|
|
} |