【优化】统一名称

This commit is contained in:
2025-10-28 15:24:03 +08:00
parent 577b37b768
commit 53d3a88a1c
24 changed files with 130 additions and 127 deletions

View File

@@ -18,12 +18,12 @@ SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for app_course
-- Table structure for app_tutorial
-- ----------------------------
DROP TABLE IF EXISTS `app_course`;
CREATE TABLE `app_course` (
DROP TABLE IF EXISTS `app_tutorial`;
CREATE TABLE `app_tutorial` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
`course_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '教程标题',
`tutorial_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '教程标题',
`description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '教程描述',
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '教程详情',
`view_count` int DEFAULT '0' COMMENT '查看次数',
@@ -35,10 +35,10 @@ CREATE TABLE `app_course` (
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='使用教程表';
-- ----------------------------
-- Records of app_course
-- Records of app_tutorial
-- ----------------------------
BEGIN;
INSERT INTO `app_course` (`id`, `course_title`, `description`, `content`, `view_count`, `recommend_status`, `status`, `create_time`, `update_time`) VALUES (1, '快速开始指南', '了解酷翼应用的基本功能与布局,快速上手使用各项功能。', NULL, 0, 0, 1, '2025-10-28 12:03:52', NULL);
INSERT INTO `app_tutorial` (`id`, `tutorial_title`, `description`, `content`, `view_count`, `recommend_status`, `status`, `create_time`, `update_time`) VALUES (1, '快速开始指南', '了解酷翼应用的基本功能与布局,快速上手使用各项功能。', NULL, 0, 0, 1, '2025-10-28 12:03:52', NULL);
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -18,10 +18,10 @@ SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for app_course_category
-- Table structure for app_tutorial_category
-- ----------------------------
DROP TABLE IF EXISTS `app_course_category`;
CREATE TABLE `app_course_category` (
DROP TABLE IF EXISTS `app_tutorial_category`;
CREATE TABLE `app_tutorial_category` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
`icon` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '图标',
`category_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类名称',
@@ -35,10 +35,10 @@ CREATE TABLE `app_course_category` (
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='使用教程分类/标签表';
-- ----------------------------
-- Records of app_course_category
-- Records of app_tutorial_category
-- ----------------------------
BEGIN;
INSERT INTO `app_course_category` (`id`, `icon`, `category_title`, `description`, `first_status`, `type`, `status`, `create_time`, `update_time`) VALUES (1, NULL, '快速指南', NULL, 1, 'category', 1, '2025-10-28 12:06:03', NULL);
INSERT INTO `app_tutorial_category` (`id`, `icon`, `category_title`, `description`, `first_status`, `type`, `status`, `create_time`, `update_time`) VALUES (1, NULL, '快速指南', NULL, 1, 'category', 1, '2025-10-28 12:06:03', NULL);
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -18,21 +18,21 @@ SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for app_course_category_relation
-- Table structure for app_tutorial_category_relation
-- ----------------------------
DROP TABLE IF EXISTS `app_course_category_relation`;
CREATE TABLE `app_course_category_relation` (
DROP TABLE IF EXISTS `app_tutorial_category_relation`;
CREATE TABLE `app_tutorial_category_relation` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
`course_id` bigint DEFAULT NULL COMMENT '教程id',
`tutorial_id` bigint DEFAULT NULL COMMENT '教程id',
`category_id` bigint DEFAULT NULL COMMENT '教程分类id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='教程与教程分类关系表';
-- ----------------------------
-- Records of app_course_category_relation
-- Records of app_tutorial_category_relation
-- ----------------------------
BEGIN;
INSERT INTO `app_course_category_relation` (`id`, `course_id`, `category_id`) VALUES (1, 1, 1);
INSERT INTO `app_tutorial_category_relation` (`id`, `tutorial_id`, `category_id`) VALUES (1, 1, 1);
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -1,11 +1,11 @@
<?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.corewing.app.mapper.CourseMapper">
<mapper namespace="com.corewing.app.mapper.TutorialMapper">
<!-- 结果映射 -->
<resultMap id="VOResultMap" type="com.corewing.app.vo.CourseVO">
<resultMap id="VOResultMap" type="com.corewing.app.vo.TutorialVO">
<id column="id" property="id"/>
<result column="course_title" property="courseTitle"/>
<result column="tutorial_title" property="tutorialTitle"/>
<result column="description" property="description"/>
<result column="content" property="content"/>
<result column="view_count" property="viewCount"/>
@@ -19,9 +19,9 @@
<!-- 基础查询SQL片段 -->
<sql id="selectVOSql">
select c.*, cc.category_title
from app_course c
left join app_course_category_relation ccr on c.id = ccr.course_id
left join app_course_category cc on cc.id = ccr.category_id
from app_tutorial c
left join app_tutorial_category_relation ccr on c.id = ccr.tutorial_id
left join app_tutorial_category cc on cc.id = ccr.category_id
</sql>
<!-- 分页查询 -->
@@ -33,8 +33,8 @@
<if test="categoryId != null and categoryId != 0">
AND cc.id = #{categoryId}
</if>
<if test="courseTitle != null and courseTitle != ''">
AND c.course_title like CONCAT('%', #{courseTitle}, '%')
<if test="tutorialTitle != null and tutorialTitle != ''">
AND c.tutorial_title like CONCAT('%', #{tutorialTitle}, '%')
</if>
</where>