feat(puzzle): 添加批量替换模板元素功能

- 在 PuzzleTemplateController 中新增 replaceElements 接口
- 在 PuzzleElementMapper 中新增 getByTemplateIdAndKey 查询方法
- 在 PuzzleTemplateServiceImpl 中实现 replaceElements 业务逻辑
- 在 IPuzzleTemplateService 接口中定义 replaceElements 方法
- 在 PuzzleElementMapper.xml 中添加对应 SQL 查询语句
This commit is contained in:
2025-11-18 12:47:24 +08:00
parent a49e581915
commit 42e806df76
5 changed files with 101 additions and 0 deletions

View File

@@ -49,6 +49,14 @@
ORDER BY z_index ASC, id ASC
</select>
<!-- 根据模板ID和元素Key查询元素 -->
<select id="getByTemplateIdAndKey" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"/>
FROM puzzle_element
WHERE template_id = #{templateId} AND element_key = #{elementKey} AND deleted = 0
LIMIT 1
</select>
<!-- 插入(重构版) -->
<insert id="insert" parameterType="com.ycwl.basic.puzzle.entity.PuzzleElementEntity"
useGeneratedKeys="true" keyProperty="id">