Files
en-edu/enlish-service/src/main/resources/mapper/LessonPlansDOMapper.xml
lbw fd828442b1 feat(plan): 支持学案文件下载功能
- 新增 DownLoadLessonPlanReqVO 请求类用于下载请求封装
- 在前端学案列表增加“下载”按钮,支持单条学案下载操作
- 实现前端下载接口,处理后端返回的 Blob 文件流并触发文件保存
- 后端新增下载接口,根据学案 ID 生成对应的 Word 文档并作为附件响应
- WordExportUtil 中新增按模板生成学案 Word 文档方法,支持工作日和周末模板切换
- LessonPlansService 新增根据 ID 查询学案的方法及对应 Mapper 实现
- 修改学案列表中“学案ID”标签为“计划ID”,提升表述准确性
- 下载过程中添加加载状态和错误信息提示,提升用户体验
2025-12-17 15:56:55 +08:00

42 lines
1.8 KiB
XML

<?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.yinlihupo.enlish.service.domain.mapper.LessonPlansDOMapper">
<resultMap id="BaseResultMap" type="com.yinlihupo.enlish.service.domain.dataobject.LessonPlansDO">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="grade_id" jdbcType="VARCHAR" property="gradeId" />
<result column="unit_id" jdbcType="INTEGER" property="unitId" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.yinlihupo.enlish.service.domain.dataobject.LessonPlansDO">
<result column="content_details" jdbcType="LONGVARCHAR" property="contentDetails" />
</resultMap>
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
insert into lesson_plans (title, grade_id, unit_id, content_details, created_at)
values (#{title}, #{gradeId}, #{unitId}, #{contentDetails}, now())
</insert>
<select id="selectById" resultMap="ResultMapWithBLOBs">
select *
from lesson_plans
where id = #{id}
</select>
<select id="findLessonPlansByStudentId" resultMap="BaseResultMap">
select *
from lesson_plans
<if test="ids != null">
where id in
<foreach item="id" collection="ids" separator="," open="(" close=")" index="">
#{id}
</foreach>
</if>
</select>
<select id="selectByLessonId" resultMap="ResultMapWithBLOBs">
select *
from lesson_plans
where id = #{lessonId}
</select>
</mapper>