刘光辉
昨天 bb638871a7fb692d80f1b7a758f991dc0879002c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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);
}