36 lines
1.7 KiB
XML
36 lines
1.7 KiB
XML
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||
|
|
<mapper namespace="com.labelsys.backend.mapper.SourceResourceMapper">
|
||
|
|
<resultMap id="SourceResourceResultMap" type="com.labelsys.backend.entity.SourceResource">
|
||
|
|
<id column="id" property="id"/>
|
||
|
|
<result column="company_id" property="companyId"/>
|
||
|
|
<result column="creator_id" property="creatorId"/>
|
||
|
|
<result column="creator_role" property="creatorRole"/>
|
||
|
|
<result column="resource_name" property="resourceName"/>
|
||
|
|
<result column="resource_type" property="resourceType"/>
|
||
|
|
<result column="bucket_name" property="bucketName"/>
|
||
|
|
<result column="file_path" property="filePath"/>
|
||
|
|
<result column="file_size" property="fileSize"/>
|
||
|
|
<result column="source_status" property="sourceStatus"/>
|
||
|
|
<result column="storage_provider" property="storageProvider"/>
|
||
|
|
<result column="remark" property="remark"/>
|
||
|
|
<result column="created_at" property="createdAt"/>
|
||
|
|
<result column="updated_at" property="updatedAt"/>
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="SourceResourceColumns">
|
||
|
|
id, company_id, creator_id, creator_role, resource_name, resource_type, bucket_name, file_path,
|
||
|
|
file_size, source_status, storage_provider, remark, created_at, updated_at
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectByCompanyIdAndIds" resultMap="SourceResourceResultMap">
|
||
|
|
select <include refid="SourceResourceColumns"/>
|
||
|
|
from source_resource
|
||
|
|
where company_id = #{companyId}
|
||
|
|
and id in
|
||
|
|
<foreach collection="resourceIds" item="resourceId" open="(" separator="," close=")">
|
||
|
|
#{resourceId}
|
||
|
|
</foreach>
|
||
|
|
</select>
|
||
|
|
</mapper>
|