feat(student): 新增学生详情接口及相关服务层支持
- 优化ClassDOMapper,重命名查询方法为selectClassDOById,并移除多余CRUD方法 - 新增ClassService接口及ClassServiceImpl实现,用于通过ID查询班级信息 - 新增GradeDO及GradeDOMapper,实现根据班级ID查询年级信息 - 新增GradeService接口及GradeServiceImpl实现根据班级ID查询年级数据 - StudentDO增加isDeleted和startTime字段,补充学生实体 - StudentDOMapper新增selectStudentById方法实现单个学生信息查询 - StudentService及其实现类新增getStudentById方法提供学生单条数据查询 - StudentController新增/detail接口,实现学生详情查询,返回学生姓名、班级、年级等信息 - 创建FindStudentDetailReqVO和FindStudentDetailRspVO用于请求和响应数据传输 - enlish-vue端新增getStudentDetail接口调用 后台学生详情接口 - 修改ExamWordsDetailCard组件,展示学生姓名及其班级、年级信息,新增fetchStudent异步方法拉取学生详情数据并显示
This commit is contained in:
@@ -6,60 +6,11 @@
|
||||
<result column="title" jdbcType="VARCHAR" property="title" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, title
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from class
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
<select id="selectClassDOById" resultType="com.yinlihupo.enlish.service.domain.dataobject.ClassDO">
|
||||
select *
|
||||
from `class`
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from class
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
|
||||
<insert id="insert" parameterType="com.yinlihupo.enlish.service.domain.dataobject.ClassDO">
|
||||
insert into class (id, title)
|
||||
values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
<insert id="insertSelective" parameterType="com.yinlihupo.enlish.service.domain.dataobject.ClassDO">
|
||||
insert into class
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="title != null">
|
||||
title,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="title != null">
|
||||
#{title,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.yinlihupo.enlish.service.domain.dataobject.ClassDO">
|
||||
update class
|
||||
<set>
|
||||
<if test="title != null">
|
||||
title = #{title,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<update id="updateByPrimaryKey" parameterType="com.yinlihupo.enlish.service.domain.dataobject.ClassDO">
|
||||
update class
|
||||
set title = #{title,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
16
enlish-service/src/main/resources/mapper/GradeDOMapper.xml
Normal file
16
enlish-service/src/main/resources/mapper/GradeDOMapper.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?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.GradeDOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.yinlihupo.enlish.service.domain.dataobject.GradeDO">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="title" jdbcType="VARCHAR" property="title" />
|
||||
<result column="time" jdbcType="TIMESTAMP" property="time" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
select *
|
||||
from grade
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -8,12 +8,10 @@
|
||||
<result column="grade_id" jdbcType="INTEGER" property="gradeId" />
|
||||
<result column="initial_vocabulary_size" jdbcType="INTEGER" property="initialVocabularySize" />
|
||||
<result column="current_vocabulary_size" jdbcType="INTEGER" property="currentVocabularySize" />
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
|
||||
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, `name`, class_id, grade_id, initial_vocabulary_size, current_vocabulary_size
|
||||
</sql>
|
||||
|
||||
<select id="selectStudentDOListByClassIdAndGradeId" resultMap="BaseResultMap">
|
||||
select *
|
||||
from student
|
||||
@@ -31,4 +29,10 @@
|
||||
select count(1)
|
||||
from student
|
||||
</select>
|
||||
|
||||
<select id="selectStudentById" resultMap="BaseResultMap">
|
||||
select *
|
||||
from student
|
||||
where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user