| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.takai.ai.mapper.TakaiSliceInfoMapper">
-
- <resultMap type="com.takai.ai.domain.entity.TakaiSliceInfo" id="SliceInfoResult" >
- <id property="sliceId" column="slice_id"/>
- <result property="knowledgeId" column="knowledge_id"/>
- <result property="documentId" column="document_id"/>
- <result property="sliceIndex" column="slice_index"/>
- <result property="sliceType" column="slice_type"/>
- <result property="sliceText" column="slice_text"/>
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <resultMap type="com.takai.ai.domain.entity.SliceInfo" id="SliceInfoScoreResult" >
- <id property="sliceId" column="slice_id"/>
- <result property="knowledgeId" column="knowledge_id"/>
- <result property="documentId" column="document_id"/>
- <result property="sliceIndex" column="slice_index"/>
- <result property="sliceType" column="slice_type"/>
- <result property="sliceText" column="slice_text"/>
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <sql id="Base_Column">
- slice_id, knowledge_id, document_id, slice_index, slice_type, slice_text, create_by, create_time, update_by, update_time
- </sql>
- <select id="selectByDocumentId" resultMap="SliceInfoResult">
- select
- <include refid="Base_Column"/>
- from slice_info
- where document_id = #{documentId}
- <if test="sliceText != null and sliceText != ''">
- AND slice_text LIKE CONCAT('%', #{sliceText}, '%')
- </if>
- order by slice_index asc
- </select>
- <select id="selectBySliceId" resultMap="SliceInfoResult">
- select
- <include refid="Base_Column"/>
- from slice_info
- where slice_id = #{sliceId}
- </select>
- <select id="slicePageInfoList" resultMap="SliceInfoScoreResult">
- select
- <include refid="Base_Column"/>
- from slice_info
- where slice_id in
- <foreach collection="list" item="sliceId" open="(" separator="," close=")">
- #{sliceId}
- </foreach>
- </select>
-
- </mapper>
|