feat:新增查询学生列表功能

This commit is contained in:
lbw
2025-12-10 19:30:08 +08:00
parent d777437e82
commit d424f72183
10 changed files with 210 additions and 1 deletions

View File

@@ -45,7 +45,7 @@
targetProject="src/main/java"/>
<!-- 需要生成的表-实体类 -->
<table tableName="assessments" domainObjectName="AssessmentsDO"
<table tableName="student" domainObjectName="StudentDO"
enableCountByExample="false"
enableUpdateByExample="false"
enableDeleteByExample="false"

View File

@@ -0,0 +1,34 @@
<?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.StudentDOMapper">
<resultMap id="BaseResultMap" type="com.yinlihupo.enlish.service.domain.dataobject.StudentDO">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="class_id" jdbcType="INTEGER" property="classId" />
<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" />
</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
where 1 = 1
<if test="classId != null">
AND class_id = #{classId}
</if>
<if test="gradeId != null">
AND grade_id = #{gradeId}
</if>
LIMIT #{offset}, #{pageSize}
</select>
<select id="selectStudentCount">
select count(1)
from student
</select>
</mapper>