|
@@ -2,6 +2,117 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
<mapper namespace="com.backendsys.modules.crt.dao.CrtDramaProjectStoryboardDao">
|
|
|
|
|
|
+ <sql id="includeStoryboard">
|
|
|
+ id,
|
|
|
+ id drama_project_storyboard_id,
|
|
|
+ user_id,
|
|
|
+ drama_project_id,
|
|
|
+ episode_num,
|
|
|
+ sort,
|
|
|
+ COALESCE(story_prompt, '') story_prompt,
|
|
|
+ COALESCE(story_framing, '') story_framing,
|
|
|
+ COALESCE(story_scene, '') story_scene,
|
|
|
+ COALESCE(story_weather_time, '') story_weather_time,
|
|
|
+ COALESCE(lora_figure_ids, '') lora_figure_ids,
|
|
|
+
|
|
|
+ param_batch_size,
|
|
|
+ param_prompt_flux_guidance,
|
|
|
+ param_sampler,
|
|
|
+ param_step,
|
|
|
+ param_seed_type,
|
|
|
+ COALESCE(param_seed, 0) param_seed,
|
|
|
+ COALESCE(text_to_image_prompt, '') text_to_image_prompt,
|
|
|
+
|
|
|
+ param_video_reference_type,
|
|
|
+ COALESCE(param_video_reference_images, '') param_video_reference_images,
|
|
|
+ COALESCE(image_to_video_prompt, '') image_to_video_prompt,
|
|
|
+
|
|
|
+ generate_image_status,
|
|
|
+ generate_video_status,
|
|
|
+ create_time,
|
|
|
+ update_time
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <resultMap id="resultMapStoryboard" type="com.backendsys.modules.crt.entity.CrtDramaProjectStoryboard">
|
|
|
+ <id property="id" column="id" jdbcType="BIGINT" />
|
|
|
+ <result property="user_id" column="user_id" javaType="java.lang.Long" />
|
|
|
+ <result property="drama_project_id" column="drama_project_id" javaType="java.lang.Long" />
|
|
|
+ <result property="episode_num" column="episode_num" javaType="java.lang.Integer" />
|
|
|
+ <result property="sort" column="sort" javaType="java.lang.Integer" />
|
|
|
+ <result property="story_prompt" column="story_prompt" />
|
|
|
+ <result property="story_framing" column="story_framing" />
|
|
|
+ <result property="story_scene" column="story_scene" />
|
|
|
+ <result property="story_weather_time" column="story_weather_time" />
|
|
|
+ <result property="lora_figure_ids" column="lora_figure_ids" />
|
|
|
+ <result property="param_batch_size" column="param_batch_size" javaType="java.lang.Integer" />
|
|
|
+ <result property="param_prompt_flux_guidance" column="param_prompt_flux_guidance" javaType="java.lang.Float" />
|
|
|
+ <result property="param_sampler" column="param_sampler" />
|
|
|
+ <result property="param_step" column="param_step" javaType="java.lang.Integer" />
|
|
|
+ <result property="param_seed_type" column="param_seed_type" javaType="java.lang.Integer" />
|
|
|
+ <result property="param_seed" column="param_seed" />
|
|
|
+ <result property="text_to_image_prompt" column="text_to_image_prompt" />
|
|
|
+ <result property="param_video_reference_type" column="param_video_reference_type" javaType="java.lang.Integer" />
|
|
|
+ <result property="param_video_reference_images" column="param_video_reference_images" />
|
|
|
+ <result property="image_to_video_prompt" column="image_to_video_prompt" />
|
|
|
+ <result property="generate_image_status" column="generate_image_status" javaType="java.lang.Integer" />
|
|
|
+ <result property="generate_video_status" column="generate_video_status" javaType="java.lang.Integer" />
|
|
|
+ <result property="create_time" column="create_time" />
|
|
|
+ <result property="update_time" column="update_time" />
|
|
|
+ <collection property="generate_images" javaType="java.util.List"
|
|
|
+ select="queryGenerateImageById" column="id">
|
|
|
+ <id property="id" column="id" jdbcType="BIGINT" />
|
|
|
+ <result property="user_id" column="user_id" javaType="java.lang.Long" />
|
|
|
+ <result property="drama_project_storyboard_id" column="drama_project_storyboard_id" javaType="java.lang.Long" />
|
|
|
+ <result property="prompt_id" column="prompt_id" />
|
|
|
+ <result property="url_origin" column="url_origin" />
|
|
|
+ <result property="url" column="url" />
|
|
|
+ <result property="url_thumb" column="url_thumb" />
|
|
|
+ <result property="object_key" column="object_key" />
|
|
|
+ <result property="target" column="target" javaType="java.lang.Integer" />
|
|
|
+ <result property="create_time" column="create_time" />
|
|
|
+ <result property="update_time" column="update_time" />
|
|
|
+ </collection>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 子查询 (生图结果) -->
|
|
|
+ <sql id="includeGenerateImage">
|
|
|
+ id,
|
|
|
+ user_id,
|
|
|
+ drama_project_storyboard_id,
|
|
|
+ COALESCE(prompt_id, "") prompt_id,
|
|
|
+ COALESCE(url_origin, "") url_origin,
|
|
|
+ COALESCE(url, "") url,
|
|
|
+ COALESCE(object_key, "") object_key,
|
|
|
+ COALESCE(target, -1) target,
|
|
|
+ create_time,
|
|
|
+ update_time
|
|
|
+ </sql>
|
|
|
+ <select id="queryGenerateImageById" resultType="com.backendsys.modules.crt.entity.CrtGenerateImage">
|
|
|
+ SELECT <include refid="includeGenerateImage" />
|
|
|
+ FROM crt_generate_image
|
|
|
+ WHERE drama_project_storyboard_id = #{id}
|
|
|
+ ORDER BY create_time DESC
|
|
|
+ LIMIT 8
|
|
|
+ </select>
|
|
|
+ <!-- -->
|
|
|
+
|
|
|
+ <select id="selectStoryboardList" resultMap="resultMapStoryboard">
|
|
|
+ SELECT <include refid="includeStoryboard" />
|
|
|
+ FROM crt_drama_project_storyboard
|
|
|
+ <where>
|
|
|
+ <if test="user_id != null and user_id != ''">
|
|
|
+ AND user_id = #{user_id}
|
|
|
+ </if>
|
|
|
+ <if test="drama_project_id != null and drama_project_id != ''">
|
|
|
+ AND drama_project_id = #{drama_project_id}
|
|
|
+ </if>
|
|
|
+ <if test="episode_num != null and episode_num != ''">
|
|
|
+ AND episode_num = #{episode_num}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY sort ASC
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 编辑分镜 -->
|
|
|
<!-- { user_id } 用户ID不能改 -->
|
|
|
<!-- { drama_project_id, episode_num } 项目ID、集数 不能改 -->
|