package jnpf.dmsMapper;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import jnpf.dmsEntity.permission.entity.DmsDocumentEntity;
|
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Select;
|
|
import java.util.List;
|
import java.util.UUID;
|
|
@Mapper
|
public interface DmsDocumentMapper extends BaseMapper<DmsDocumentEntity> {
|
@Select("SELECT id, tenant_id, folder_id, document_no, name, document_type, responsible_dept_id, "
|
+ "created_by, created_at "
|
+ "FROM public.dms_documents WHERE tenant_id = #{tenantId} AND id = #{id}")
|
DmsDocumentEntity selectByTenantAndId(@Param("tenantId") String tenantId, @Param("id") UUID id);
|
|
@Select("SELECT id, tenant_id, folder_id, document_no, name, document_type, responsible_dept_id, "
|
+ "created_by, created_at FROM public.dms_documents "
|
+ "WHERE tenant_id = #{tenantId} AND id = #{id} FOR UPDATE")
|
DmsDocumentEntity selectByTenantAndIdForUpdate(@Param("tenantId") String tenantId,
|
@Param("id") UUID id);
|
|
@Select({"<script>",
|
"SELECT id, tenant_id, folder_id, document_no, name, document_type, responsible_dept_id,",
|
"created_by, created_at",
|
"FROM public.dms_documents WHERE tenant_id = #{tenantId} AND id IN",
|
"<foreach collection='ids' item='id' open='(' separator=',' close=')'>#{id}</foreach>",
|
"</script>"})
|
List<DmsDocumentEntity> selectByTenantAndIds(@Param("tenantId") String tenantId,
|
@Param("ids") List<UUID> ids);
|
}
|