feat(class): 实现班级列表分页查询功能
- 新增班级后端分页接口及相关服务实现 - 实现班级与年级关联数据查询及映射 - 新增分页请求和响应VO类支持前后端数据传输 - 修改前端class.vue,增加班级列表分页展示组件 - 增加前端分页逻辑及状态管理,支持切换页码和页面大小 - 创建GradeClassDO实体及对应Mapper实现关联查询 - 优化数据库Mapper XML,增加分页查询及计数SQL语句 - 调整MyBatis配置生成grade_class表实体类和Mapper接口
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
targetProject="src/main/java"/>
|
||||
|
||||
<!-- 需要生成的表-实体类 -->
|
||||
<table tableName="grade" domainObjectName="GradeDO"
|
||||
<table tableName="grade_class" domainObjectName="GradeClassDO"
|
||||
enableCountByExample="false"
|
||||
enableUpdateByExample="false"
|
||||
enableDeleteByExample="false"
|
||||
|
||||
@@ -12,5 +12,16 @@
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectClassDOList" resultMap="BaseResultMap">
|
||||
select *
|
||||
from `class`
|
||||
limit #{startIndex}, #{pageSize}
|
||||
</select>
|
||||
|
||||
<select id="selectClassDOCount" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from `class`
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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.GradeClassDOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.yinlihupo.enlish.service.domain.dataobject.GradeClassDO">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="class_id" jdbcType="INTEGER" property="classId" />
|
||||
<result column="grade_id" jdbcType="INTEGER" property="gradeId" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByClassIds" resultMap="BaseResultMap">
|
||||
select * from grade_class where class_id in
|
||||
<foreach collection="classIds" item="classId" separator="," open="(" close=")">
|
||||
#{classId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -12,5 +12,13 @@
|
||||
from grade
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectByGradeIds" resultMap="BaseResultMap">
|
||||
select *
|
||||
from grade
|
||||
where id in
|
||||
<foreach collection="gradeIds" item="gradeId" separator="," open="(" close=")">
|
||||
#{gradeId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user