From 1199cbc1769818b2fc1891382ff35268397330ec Mon Sep 17 00:00:00 2001 From: wangys <3401275564@qq.com> Date: Thu, 16 Oct 2025 14:31:56 +0800 Subject: [PATCH] =?UTF-8?q?serv-mapper=E5=92=8C.xml=20=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E5=A2=9E=E5=88=A0=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- schoolNewsServ/.bin/mysql/sql/initAll.sql | 3 + schoolNewsServ/admin/pom.xml | 20 + .../admin/src/main/java/org/xyzh/App.java | 3 +- .../xyzh/common/core/entity/BaseEntity.java | 72 +++ .../xyzh/common/core/entity/DataEntity.java | 97 ++++ .../main/java/org/xyzh/common/vo/UserVO.java | 108 ++++ schoolNewsServ/common/common-jdbc/pom.xml | 21 + .../src/main/java/org/xyzh/Main.java | 7 - .../org/xyzh/news/mapper/BannerMapper.java | 113 +++- .../mapper/DataCollectionConfigMapper.java | 122 ++++- .../news/mapper/DataCollectionLogMapper.java | 122 ++++- .../news/mapper/ResourceCategoryMapper.java | 113 +++- .../org/xyzh/news/mapper/ResourceMapper.java | 141 ++++- .../news/mapper/ResourceRecommendMapper.java | 122 ++++- .../xyzh/news/mapper/ResourceTagMapper.java | 134 ++++- .../java/org/xyzh/news/mapper/TagMapper.java | 123 ++++- .../main/resources/mapper/BannerMapper.xml | 144 ++++++ .../mapper/DataCollectionConfigMapper.xml | 155 ++++++ .../mapper/DataCollectionLogMapper.xml | 144 ++++++ .../mapper/ResourceCategoryMapper.xml | 141 +++++ .../main/resources/mapper/ResourceMapper.xml | 212 ++++++++ .../mapper/ResourceRecommendMapper.xml | 145 ++++++ .../resources/mapper/ResourceTagMapper.xml | 129 +++++ .../src/main/resources/mapper/TagMapper.xml | 146 ++++++ .../study/mapper/CourseChapterMapper.java | 132 ++++- .../org/xyzh/study/mapper/CourseMapper.java | 150 +++++- .../xyzh/study/mapper/CourseTagMapper.java | 134 ++++- .../study/mapper/LearningRecordMapper.java | 123 ++++- .../mapper/LearningStatisticsMapper.java | 123 ++++- .../xyzh/study/mapper/LearningTaskMapper.java | 141 ++++- .../xyzh/study/mapper/TaskCourseMapper.java | 134 ++++- .../xyzh/study/mapper/TaskResourceMapper.java | 134 ++++- .../org/xyzh/study/mapper/TaskUserMapper.java | 153 +++++- .../resources/mapper/CourseChapterMapper.xml | 155 ++++++ .../main/resources/mapper/CourseMapper.xml | 205 ++++++++ .../main/resources/mapper/CourseTagMapper.xml | 129 +++++ .../resources/mapper/LearningRecordMapper.xml | 152 ++++++ .../mapper/LearningStatisticsMapper.xml | 140 +++++ .../resources/mapper/LearningTaskMapper.xml | 167 ++++++ .../resources/mapper/TaskCourseMapper.xml | 136 +++++ .../resources/mapper/TaskResourceMapper.xml | 136 +++++ .../main/resources/mapper/TaskUserMapper.xml | 166 ++++++ .../usercenter/mapper/AchievementMapper.java | 115 +++- .../usercenter/mapper/PointsRecordMapper.java | 105 +++- .../mapper/UserAchievementMapper.java | 105 +++- .../mapper/UserBrowseRecordMapper.java | 105 +++- .../mapper/UserCollectionMapper.java | 105 +++- .../usercenter/mapper/UserPointsMapper.java | 107 +++- .../resources/mapper/AchievementMapper.xml | 489 ++++++++++++++++-- .../resources/mapper/PointsRecordMapper.xml | 349 +++++++++++-- .../mapper/UserAchievementMapper.xml | 290 ++++++++++- .../mapper/UserBrowseRecordMapper.xml | 327 +++++++++++- .../resources/mapper/UserCollectionMapper.xml | 298 ++++++++++- .../resources/mapper/UserPointsMapper.xml | 171 +++++- 54 files changed, 7516 insertions(+), 197 deletions(-) delete mode 100644 schoolNewsServ/common/common-jdbc/src/main/java/org/xyzh/Main.java diff --git a/schoolNewsServ/.bin/mysql/sql/initAll.sql b/schoolNewsServ/.bin/mysql/sql/initAll.sql index 1b1eb32..f4a3741 100644 --- a/schoolNewsServ/.bin/mysql/sql/initAll.sql +++ b/schoolNewsServ/.bin/mysql/sql/initAll.sql @@ -35,6 +35,9 @@ SOURCE createTableAI.sql; -- 10. 创建系统配置和日志相关表 SOURCE createTableSystem.sql; +-- 11. 创建文件系统相关表 +SOURCE createTableFile.sql; + -- ===================================================== -- 初始化完成 -- ===================================================== diff --git a/schoolNewsServ/admin/pom.xml b/schoolNewsServ/admin/pom.xml index 8d8e9ed..2b9d03f 100644 --- a/schoolNewsServ/admin/pom.xml +++ b/schoolNewsServ/admin/pom.xml @@ -44,6 +44,26 @@ news ${school-news.version} + + org.xyzh + study + ${school-news.version} + + + org.xyzh + usercenter + ${school-news.version} + + + org.xyzh + file + ${school-news.version} + + + org.xyzh + ai + ${school-news.version} + diff --git a/schoolNewsServ/admin/src/main/java/org/xyzh/App.java b/schoolNewsServ/admin/src/main/java/org/xyzh/App.java index b1c8e8d..bbc940c 100644 --- a/schoolNewsServ/admin/src/main/java/org/xyzh/App.java +++ b/schoolNewsServ/admin/src/main/java/org/xyzh/App.java @@ -14,7 +14,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; */ @EnableTransactionManagement @SpringBootApplication(scanBasePackages = "org.xyzh") -@MapperScan({"org.xyzh.system.mapper", "org.xyzh.news.mapper"}) +@MapperScan({"org.xyzh.system.mapper", "org.xyzh.file.mapper", "org.xyzh.news.mapper", "org.xyzh.study.mapper", + "org.xyzh.usercenter.mapper", "org.xyzh.ai.mapper", "org.xyzh.file.mapper"}) public class App { public static void main(String[] args) { diff --git a/schoolNewsServ/common/common-core/src/main/java/org/xyzh/common/core/entity/BaseEntity.java b/schoolNewsServ/common/common-core/src/main/java/org/xyzh/common/core/entity/BaseEntity.java index 2b12e81..e27df12 100644 --- a/schoolNewsServ/common/common-core/src/main/java/org/xyzh/common/core/entity/BaseEntity.java +++ b/schoolNewsServ/common/common-core/src/main/java/org/xyzh/common/core/entity/BaseEntity.java @@ -63,4 +63,76 @@ public class BaseEntity implements Serializable { */ private String remark; + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public Date getCreateTime() { + return createTime; + } + + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + + public Date getUpdateTime() { + return updateTime; + } + + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + + public Date getDeleteTime() { + return deleteTime; + } + + + public void setDeleteTime(Date deleteTime) { + this.deleteTime = deleteTime; + } + + + public Integer getIsDeleted() { + return isDeleted; + } + + + public void setIsDeleted(Integer isDeleted) { + this.isDeleted = isDeleted; + } + + + public Integer getVersion() { + return version; + } + + + public void setVersion(Integer version) { + this.version = version; + } + + + public String getRemark() { + return remark; + } + + + public void setRemark(String remark) { + this.remark = remark; + } + + + } diff --git a/schoolNewsServ/common/common-core/src/main/java/org/xyzh/common/core/entity/DataEntity.java b/schoolNewsServ/common/common-core/src/main/java/org/xyzh/common/core/entity/DataEntity.java index e1e6cb7..9862373 100644 --- a/schoolNewsServ/common/common-core/src/main/java/org/xyzh/common/core/entity/DataEntity.java +++ b/schoolNewsServ/common/common-core/src/main/java/org/xyzh/common/core/entity/DataEntity.java @@ -97,4 +97,101 @@ public class DataEntity extends BaseEntity { */ private List dataList; + public String getCreatorID() { + return creatorID; + } + + public void setCreatorID(String creatorID) { + this.creatorID = creatorID; + } + + public String getCreatorName() { + return creatorName; + } + + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + + public String getUpdatorID() { + return updatorID; + } + + public void setUpdatorID(String updatorID) { + this.updatorID = updatorID; + } + + public String getUpdatorName() { + return updatorName; + } + + public void setUpdatorName(String updatorName) { + this.updatorName = updatorName; + } + + public String getDeleterID() { + return deleterID; + } + + public void setDeleterID(String deleterID) { + this.deleterID = deleterID; + } + + public String getDeleterName() { + return deleterName; + } + + public void setDeleterName(String deleterName) { + this.deleterName = deleterName; + } + + public String getOwnerID() { + return ownerID; + } + + public void setOwnerID(String ownerID) { + this.ownerID = ownerID; + } + + public String getOwnerName() { + return ownerName; + } + + public void setOwnerName(String ownerName) { + this.ownerName = ownerName; + } + + public DataStatus getDataStatus() { + return dataStatus; + } + + public void setDataStatus(DataStatus dataStatus) { + this.dataStatus = dataStatus; + } + + public Boolean getVisible() { + return visible; + } + + public void setVisible(Boolean visible) { + this.visible = visible; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + public List getDataList() { + return dataList; + } + + public void setDataList(List dataList) { + this.dataList = dataList; + } + + } diff --git a/schoolNewsServ/common/common-dto/src/main/java/org/xyzh/common/vo/UserVO.java b/schoolNewsServ/common/common-dto/src/main/java/org/xyzh/common/vo/UserVO.java index 76f9523..0d80551 100644 --- a/schoolNewsServ/common/common-dto/src/main/java/org/xyzh/common/vo/UserVO.java +++ b/schoolNewsServ/common/common-dto/src/main/java/org/xyzh/common/vo/UserVO.java @@ -20,6 +20,114 @@ public class UserVO { private String deleteTime; private String deleted; private String status; + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + public String getUserID() { + return userID; + } + public void setUserID(String userID) { + this.userID = userID; + } + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + public String getWechatID() { + return wechatID; + } + public void setWechatID(String wechatID) { + this.wechatID = wechatID; + } + public String getAvatar() { + return avatar; + } + public void setAvatar(String avatar) { + this.avatar = avatar; + } + public String getGender() { + return gender; + } + public void setGender(String gender) { + this.gender = gender; + } + public String getFamilyName() { + return familyName; + } + public void setFamilyName(String familyName) { + this.familyName = familyName; + } + public String getGivenName() { + return givenName; + } + public void setGivenName(String givenName) { + this.givenName = givenName; + } + public String getFullName() { + return fullName; + } + public void setFullName(String fullName) { + this.fullName = fullName; + } + public String getIdCard() { + return idCard; + } + public void setIdCard(String idCard) { + this.idCard = idCard; + } + public String getAddress() { + return address; + } + public void setAddress(String address) { + this.address = address; + } + public String getCreateTime() { + return createTime; + } + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + public String getUpdateTime() { + return updateTime; + } + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + public String getDeleteTime() { + return deleteTime; + } + public void setDeleteTime(String deleteTime) { + this.deleteTime = deleteTime; + } + public String getDeleted() { + return deleted; + } + public void setDeleted(String deleted) { + this.deleted = deleted; + } + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } diff --git a/schoolNewsServ/common/common-jdbc/pom.xml b/schoolNewsServ/common/common-jdbc/pom.xml index 1cb3b7c..22fa995 100644 --- a/schoolNewsServ/common/common-jdbc/pom.xml +++ b/schoolNewsServ/common/common-jdbc/pom.xml @@ -19,4 +19,25 @@ 21 + + + + com.baomidou + mybatis-plus-spring-boot3-starter + + + + + + + org.xyzh + common-dto + ${school-news.version} + + + \ No newline at end of file diff --git a/schoolNewsServ/common/common-jdbc/src/main/java/org/xyzh/Main.java b/schoolNewsServ/common/common-jdbc/src/main/java/org/xyzh/Main.java deleted file mode 100644 index f660b7a..0000000 --- a/schoolNewsServ/common/common-jdbc/src/main/java/org/xyzh/Main.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.xyzh; - -public class Main { - public static void main(String[] args) { - System.out.println("Hello world!"); - } -} \ No newline at end of file diff --git a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/BannerMapper.java b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/BannerMapper.java index 646566f..4baeced 100644 --- a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/BannerMapper.java +++ b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/BannerMapper.java @@ -2,12 +2,14 @@ package org.xyzh.news.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.resource.TbBanner; import java.util.List; /** - * @description Banner数据访问层 + * @description BannerMapper.java文件描述 Banner数据访问层 * @filename BannerMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,113 @@ public interface BannerMapper extends BaseMapper { * @since 2025-10-15 */ List selectBanners(TbBanner filter); + + /** + * @description 根据Banner ID查询Banner信息 + * @param bannerId Banner ID + * @return TbBanner Banner信息 + * @author yslg + * @since 2025-10-15 + */ + TbBanner selectByBannerId(@Param("bannerId") String bannerId); + + /** + * @description 根据状态查询Banner列表 + * @param status 状态 + * @return List Banner列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByStatus(@Param("status") Integer status); + + /** + * @description 根据位置查询Banner列表 + * @param position 位置 + * @return List Banner列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByPosition(@Param("position") String position); + + /** + * @description 查询有效的Banner列表(按排序) + * @return List Banner列表 + * @author yslg + * @since 2025-10-15 + */ + List selectActiveBanners(); + + /** + * @description 检查Banner标题是否存在 + * @param title Banner标题 + * @param excludeId 排除的Banner ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByTitle(@Param("title") String title, @Param("excludeId") String excludeId); + + /** + * @description 插入Banner + * @param banner Banner + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertBanner(TbBanner banner); + + /** + * @description 更新Banner + * @param banner Banner + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateBanner(TbBanner banner); + + /** + * @description 删除Banner + * @param banner Banner + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteBanner(TbBanner banner); + + /** + * @description 批量插入Banner + * @param bannerList Banner列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertBanners(@Param("bannerList") List bannerList); + + /** + * @description 批量删除Banner + * @param ids Banner ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteBanners(@Param("ids") List ids); + + /** + * @description 分页查询Banner + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List Banner列表 + * @author yslg + * @since 2025-10-15 + */ + List selectBannersPage(@Param("filter") TbBanner filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计Banner总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countBanners(@Param("filter") TbBanner filter); } diff --git a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/DataCollectionConfigMapper.java b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/DataCollectionConfigMapper.java index df5efb4..9f202e3 100644 --- a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/DataCollectionConfigMapper.java +++ b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/DataCollectionConfigMapper.java @@ -2,12 +2,14 @@ package org.xyzh.news.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.resource.TbDataCollectionConfig; import java.util.List; /** - * @description 数据采集配置数据访问层 + * @description DataCollectionConfigMapper.java文件描述 数据采集配置数据访问层 * @filename DataCollectionConfigMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,122 @@ public interface DataCollectionConfigMapper extends BaseMapper selectDataCollectionConfigs(TbDataCollectionConfig filter); + + /** + * @description 根据配置ID查询配置信息 + * @param configId 配置ID + * @return TbDataCollectionConfig 配置信息 + * @author yslg + * @since 2025-10-15 + */ + TbDataCollectionConfig selectByConfigId(@Param("configId") String configId); + + /** + * @description 根据名称查询配置 + * @param name 配置名称 + * @return TbDataCollectionConfig 配置信息 + * @author yslg + * @since 2025-10-15 + */ + TbDataCollectionConfig selectByName(@Param("name") String name); + + /** + * @description 根据状态查询配置列表 + * @param status 状态 + * @return List 配置列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByStatus(@Param("status") Integer status); + + /** + * @description 根据类型查询配置列表 + * @param type 类型 + * @return List 配置列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByType(@Param("type") Integer type); + + /** + * @description 查询启用的配置列表 + * @return List 配置列表 + * @author yslg + * @since 2025-10-15 + */ + List selectActiveConfigs(); + + /** + * @description 检查配置名称是否存在 + * @param name 配置名称 + * @param excludeId 排除的配置ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByName(@Param("name") String name, @Param("excludeId") String excludeId); + + /** + * @description 插入数据采集配置 + * @param dataCollectionConfig 数据采集配置 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertDataCollectionConfig(TbDataCollectionConfig dataCollectionConfig); + + /** + * @description 更新数据采集配置 + * @param dataCollectionConfig 数据采集配置 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateDataCollectionConfig(TbDataCollectionConfig dataCollectionConfig); + + /** + * @description 删除数据采集配置 + * @param dataCollectionConfig 数据采集配置 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteDataCollectionConfig(TbDataCollectionConfig dataCollectionConfig); + + /** + * @description 批量插入数据采集配置 + * @param dataCollectionConfigList 数据采集配置列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertDataCollectionConfigs(@Param("dataCollectionConfigList") List dataCollectionConfigList); + + /** + * @description 批量删除数据采集配置 + * @param ids 配置ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteDataCollectionConfigs(@Param("ids") List ids); + + /** + * @description 分页查询数据采集配置 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 数据采集配置列表 + * @author yslg + * @since 2025-10-15 + */ + List selectDataCollectionConfigsPage(@Param("filter") TbDataCollectionConfig filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计数据采集配置总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countDataCollectionConfigs(@Param("filter") TbDataCollectionConfig filter); } diff --git a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/DataCollectionLogMapper.java b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/DataCollectionLogMapper.java index f5ec75a..640005b 100644 --- a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/DataCollectionLogMapper.java +++ b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/DataCollectionLogMapper.java @@ -2,12 +2,14 @@ package org.xyzh.news.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.resource.TbDataCollectionLog; import java.util.List; /** - * @description 数据采集记录数据访问层 + * @description DataCollectionLogMapper.java文件描述 数据采集记录数据访问层 * @filename DataCollectionLogMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,122 @@ public interface DataCollectionLogMapper extends BaseMapper * @since 2025-10-15 */ List selectDataCollectionLogs(TbDataCollectionLog filter); + + /** + * @description 根据记录ID查询记录信息 + * @param logId 记录ID + * @return TbDataCollectionLog 记录信息 + * @author yslg + * @since 2025-10-15 + */ + TbDataCollectionLog selectByLogId(@Param("logId") String logId); + + /** + * @description 根据配置ID查询记录列表 + * @param configId 配置ID + * @return List 记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByConfigId(@Param("configId") String configId); + + /** + * @description 根据状态查询记录列表 + * @param status 状态 + * @return List 记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByStatus(@Param("status") Integer status); + + /** + * @description 根据类型查询记录列表 + * @param type 类型 + * @return List 记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByType(@Param("type") Integer type); + + /** + * @description 查询最新的记录列表 + * @param limit 限制数量 + * @return List 记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectLatestLogs(@Param("limit") Integer limit); + + /** + * @description 查询采集统计信息 + * @param configId 配置ID + * @return TbDataCollectionLog 统计信息 + * @author yslg + * @since 2025-10-15 + */ + TbDataCollectionLog selectCollectionStatistics(@Param("configId") String configId); + + /** + * @description 插入数据采集记录 + * @param dataCollectionLog 数据采集记录 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertDataCollectionLog(TbDataCollectionLog dataCollectionLog); + + /** + * @description 更新数据采集记录 + * @param dataCollectionLog 数据采集记录 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateDataCollectionLog(TbDataCollectionLog dataCollectionLog); + + /** + * @description 删除数据采集记录 + * @param dataCollectionLog 数据采集记录 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteDataCollectionLog(TbDataCollectionLog dataCollectionLog); + + /** + * @description 批量插入数据采集记录 + * @param dataCollectionLogList 数据采集记录列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertDataCollectionLogs(@Param("dataCollectionLogList") List dataCollectionLogList); + + /** + * @description 批量删除数据采集记录 + * @param ids 记录ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteDataCollectionLogs(@Param("ids") List ids); + + /** + * @description 分页查询数据采集记录 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 数据采集记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectDataCollectionLogsPage(@Param("filter") TbDataCollectionLog filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计数据采集记录总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countDataCollectionLogs(@Param("filter") TbDataCollectionLog filter); } diff --git a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceCategoryMapper.java b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceCategoryMapper.java index d888e47..f6f4b8c 100644 --- a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceCategoryMapper.java +++ b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceCategoryMapper.java @@ -2,12 +2,14 @@ package org.xyzh.news.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.resource.TbResourceCategory; import java.util.List; /** - * @description 资源分类数据访问层 + * @description ResourceCategoryMapper.java文件描述 资源分类数据访问层 * @filename ResourceCategoryMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,113 @@ public interface ResourceCategoryMapper extends BaseMapper { * @since 2025-10-15 */ List selectResourceCategories(TbResourceCategory filter); + + /** + * @description 根据分类ID查询分类信息 + * @param categoryId 分类ID + * @return TbResourceCategory 分类信息 + * @author yslg + * @since 2025-10-15 + */ + TbResourceCategory selectByCategoryId(@Param("categoryId") String categoryId); + + /** + * @description 根据父分类ID查询子分类列表 + * @param parentId 父分类ID + * @return List 子分类列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByParentId(@Param("parentId") String parentId); + + /** + * @description 根据状态查询分类列表 + * @param status 状态 + * @return List 分类列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByStatus(@Param("status") Integer status); + + /** + * @description 查询分类树结构 + * @return List 分类树 + * @author yslg + * @since 2025-10-15 + */ + List selectCategoryTree(); + + /** + * @description 检查分类名称是否存在 + * @param name 分类名称 + * @param excludeId 排除的分类ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByName(@Param("name") String name, @Param("excludeId") String excludeId); + + /** + * @description 插入资源分类 + * @param resourceCategory 资源分类 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertResourceCategory(TbResourceCategory resourceCategory); + + /** + * @description 更新资源分类 + * @param resourceCategory 资源分类 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateResourceCategory(TbResourceCategory resourceCategory); + + /** + * @description 删除资源分类 + * @param resourceCategory 资源分类 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteResourceCategory(TbResourceCategory resourceCategory); + + /** + * @description 批量插入资源分类 + * @param resourceCategoryList 资源分类列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertResourceCategories(@Param("resourceCategoryList") List resourceCategoryList); + + /** + * @description 批量删除资源分类 + * @param ids 分类ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteResourceCategories(@Param("ids") List ids); + + /** + * @description 分页查询资源分类 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 资源分类列表 + * @author yslg + * @since 2025-10-15 + */ + List selectResourceCategoriesPage(@Param("filter") TbResourceCategory filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计资源分类总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countResourceCategories(@Param("filter") TbResourceCategory filter); } diff --git a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceMapper.java b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceMapper.java index b768943..b3ec576 100644 --- a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceMapper.java +++ b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceMapper.java @@ -2,12 +2,14 @@ package org.xyzh.news.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.resource.TbResource; import java.util.List; /** - * @description 资源数据访问层 + * @description ResourceMapper.java文件描述 资源数据访问层 * @filename ResourceMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,141 @@ public interface ResourceMapper extends BaseMapper { * @since 2025-10-15 */ List selectResources(TbResource filter); + + /** + * @description 根据资源ID查询资源信息 + * @param resourceId 资源ID + * @return TbResource 资源信息 + * @author yslg + * @since 2025-10-15 + */ + TbResource selectByResourceId(@Param("resourceId") String resourceId); + + /** + * @description 根据分类ID查询资源列表 + * @param categoryId 分类ID + * @return List 资源列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByCategoryId(@Param("categoryId") String categoryId); + + /** + * @description 根据状态查询资源列表 + * @param status 状态 + * @return List 资源列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByStatus(@Param("status") Integer status); + + /** + * @description 根据类型查询资源列表 + * @param type 类型 + * @return List 资源列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByType(@Param("type") Integer type); + + /** + * @description 查询热门资源列表 + * @param limit 限制数量 + * @return List 资源列表 + * @author yslg + * @since 2025-10-15 + */ + List selectHotResources(@Param("limit") Integer limit); + + /** + * @description 查询最新资源列表 + * @param limit 限制数量 + * @return List 资源列表 + * @author yslg + * @since 2025-10-15 + */ + List selectLatestResources(@Param("limit") Integer limit); + + /** + * @description 根据关键词搜索资源 + * @param keyword 关键词 + * @return List 资源列表 + * @author yslg + * @since 2025-10-15 + */ + List searchByKeyword(@Param("keyword") String keyword); + + /** + * @description 检查资源标题是否存在 + * @param title 资源标题 + * @param excludeId 排除的资源ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByTitle(@Param("title") String title, @Param("excludeId") String excludeId); + + /** + * @description 插入资源 + * @param resource 资源 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertResource(TbResource resource); + + /** + * @description 更新资源 + * @param resource 资源 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateResource(TbResource resource); + + /** + * @description 删除资源 + * @param resource 资源 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteResource(TbResource resource); + + /** + * @description 批量插入资源 + * @param resourceList 资源列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertResources(@Param("resourceList") List resourceList); + + /** + * @description 批量删除资源 + * @param ids 资源ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteResources(@Param("ids") List ids); + + /** + * @description 分页查询资源 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 资源列表 + * @author yslg + * @since 2025-10-15 + */ + List selectResourcesPage(@Param("filter") TbResource filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计资源总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countResources(@Param("filter") TbResource filter); } diff --git a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceRecommendMapper.java b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceRecommendMapper.java index 80975e2..509d026 100644 --- a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceRecommendMapper.java +++ b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceRecommendMapper.java @@ -2,12 +2,14 @@ package org.xyzh.news.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.resource.TbResourceRecommend; import java.util.List; /** - * @description 资源推荐数据访问层 + * @description ResourceRecommendMapper.java文件描述 资源推荐数据访问层 * @filename ResourceRecommendMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,122 @@ public interface ResourceRecommendMapper extends BaseMapper * @since 2025-10-15 */ List selectResourceRecommends(TbResourceRecommend filter); + + /** + * @description 根据推荐ID查询推荐信息 + * @param recommendId 推荐ID + * @return TbResourceRecommend 推荐信息 + * @author yslg + * @since 2025-10-15 + */ + TbResourceRecommend selectByRecommendId(@Param("recommendId") String recommendId); + + /** + * @description 根据资源ID查询推荐列表 + * @param resourceId 资源ID + * @return List 推荐列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByResourceId(@Param("resourceId") String resourceId); + + /** + * @description 根据状态查询推荐列表 + * @param status 状态 + * @return List 推荐列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByStatus(@Param("status") Integer status); + + /** + * @description 根据类型查询推荐列表 + * @param type 类型 + * @return List 推荐列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByType(@Param("type") Integer type); + + /** + * @description 查询热门推荐列表 + * @param limit 限制数量 + * @return List 推荐列表 + * @author yslg + * @since 2025-10-15 + */ + List selectHotRecommends(@Param("limit") Integer limit); + + /** + * @description 查询最新推荐列表 + * @param limit 限制数量 + * @return List 推荐列表 + * @author yslg + * @since 2025-10-15 + */ + List selectLatestRecommends(@Param("limit") Integer limit); + + /** + * @description 插入资源推荐 + * @param resourceRecommend 资源推荐 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertResourceRecommend(TbResourceRecommend resourceRecommend); + + /** + * @description 更新资源推荐 + * @param resourceRecommend 资源推荐 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateResourceRecommend(TbResourceRecommend resourceRecommend); + + /** + * @description 删除资源推荐 + * @param resourceRecommend 资源推荐 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteResourceRecommend(TbResourceRecommend resourceRecommend); + + /** + * @description 批量插入资源推荐 + * @param resourceRecommendList 资源推荐列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertResourceRecommends(@Param("resourceRecommendList") List resourceRecommendList); + + /** + * @description 批量删除资源推荐 + * @param ids 推荐ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteResourceRecommends(@Param("ids") List ids); + + /** + * @description 分页查询资源推荐 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 资源推荐列表 + * @author yslg + * @since 2025-10-15 + */ + List selectResourceRecommendsPage(@Param("filter") TbResourceRecommend filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计资源推荐总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countResourceRecommends(@Param("filter") TbResourceRecommend filter); } diff --git a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceTagMapper.java b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceTagMapper.java index 00881da..7f56caf 100644 --- a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceTagMapper.java +++ b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/ResourceTagMapper.java @@ -2,12 +2,14 @@ package org.xyzh.news.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.resource.TbResourceTag; import java.util.List; /** - * @description 资源标签关联数据访问层 + * @description ResourceTagMapper.java文件描述 资源标签关联数据访问层 * @filename ResourceTagMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,134 @@ public interface ResourceTagMapper extends BaseMapper { * @since 2025-10-15 */ List selectResourceTags(TbResourceTag filter); + + /** + * @description 根据关联ID查询关联信息 + * @param relationId 关联ID + * @return TbResourceTag 关联信息 + * @author yslg + * @since 2025-10-15 + */ + TbResourceTag selectByRelationId(@Param("relationId") String relationId); + + /** + * @description 根据资源ID查询标签关联列表 + * @param resourceId 资源ID + * @return List 标签关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByResourceId(@Param("resourceId") String resourceId); + + /** + * @description 根据标签ID查询资源关联列表 + * @param tagId 标签ID + * @return List 资源关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByTagId(@Param("tagId") String tagId); + + /** + * @description 根据资源ID和标签ID查询关联信息 + * @param resourceId 资源ID + * @param tagId 标签ID + * @return TbResourceTag 关联信息 + * @author yslg + * @since 2025-10-15 + */ + TbResourceTag selectByResourceIdAndTagId(@Param("resourceId") String resourceId, @Param("tagId") String tagId); + + /** + * @description 检查资源标签关联是否存在 + * @param resourceId 资源ID + * @param tagId 标签ID + * @param excludeId 排除的关联ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByResourceIdAndTagId(@Param("resourceId") String resourceId, @Param("tagId") String tagId, @Param("excludeId") String excludeId); + + /** + * @description 插入资源标签关联 + * @param resourceTag 资源标签关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertResourceTag(TbResourceTag resourceTag); + + /** + * @description 更新资源标签关联 + * @param resourceTag 资源标签关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateResourceTag(TbResourceTag resourceTag); + + /** + * @description 删除资源标签关联 + * @param resourceTag 资源标签关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteResourceTag(TbResourceTag resourceTag); + + /** + * @description 批量插入资源标签关联 + * @param resourceTagList 资源标签关联列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertResourceTags(@Param("resourceTagList") List resourceTagList); + + /** + * @description 批量删除资源标签关联 + * @param ids 关联ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteResourceTags(@Param("ids") List ids); + + /** + * @description 根据资源ID批量删除标签关联 + * @param resourceId 资源ID + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteByResourceId(@Param("resourceId") String resourceId); + + /** + * @description 根据标签ID批量删除资源关联 + * @param tagId 标签ID + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteByTagId(@Param("tagId") String tagId); + + /** + * @description 分页查询资源标签关联 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 资源标签关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectResourceTagsPage(@Param("filter") TbResourceTag filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计资源标签关联总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countResourceTags(@Param("filter") TbResourceTag filter); } diff --git a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/TagMapper.java b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/TagMapper.java index 4ed126e..d574af7 100644 --- a/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/TagMapper.java +++ b/schoolNewsServ/news/src/main/java/org/xyzh/news/mapper/TagMapper.java @@ -2,12 +2,14 @@ package org.xyzh.news.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.resource.TbTag; import java.util.List; /** - * @description 标签数据访问层 + * @description TagMapper.java文件描述 标签数据访问层 * @filename TagMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,123 @@ public interface TagMapper extends BaseMapper { * @since 2025-10-15 */ List selectTags(TbTag filter); + + /** + * @description 根据标签ID查询标签信息 + * @param tagId 标签ID + * @return TbTag 标签信息 + * @author yslg + * @since 2025-10-15 + */ + TbTag selectByTagId(@Param("tagId") String tagId); + + /** + * @description 根据标签名称查询标签 + * @param name 标签名称 + * @return TbTag 标签信息 + * @author yslg + * @since 2025-10-15 + */ + TbTag selectByName(@Param("name") String name); + + /** + * @description 根据状态查询标签列表 + * @param status 状态 + * @return List 标签列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByStatus(@Param("status") Integer status); + + /** + * @description 根据类型查询标签列表 + * @param type 类型 + * @return List 标签列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByType(@Param("type") Integer type); + + /** + * @description 查询热门标签列表 + * @param limit 限制数量 + * @return List 标签列表 + * @author yslg + * @since 2025-10-15 + */ + List selectHotTags(@Param("limit") Integer limit); + + /** + * @description 检查标签名称是否存在 + * @param name 标签名称 + * @param excludeId 排除的标签ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByName(@Param("name") String name, @Param("excludeId") String excludeId); + + /** + * @description 插入标签 + * @param tag 标签 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertTag(TbTag tag); + + /** + * @description 更新标签 + * @param tag 标签 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateTag(TbTag tag); + + /** + * @description 删除标签 + * @param tag 标签 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteTag(TbTag tag); + + /** + * @description 批量插入标签 + * @param tagList 标签列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertTags(@Param("tagList") List tagList); + + /** + * @description 批量删除标签 + * @param ids 标签ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteTags(@Param("ids") List ids); + + /** + * @description 分页查询标签 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 标签列表 + * @author yslg + * @since 2025-10-15 + */ + List selectTagsPage(@Param("filter") TbTag filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计标签总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countTags(@Param("filter") TbTag filter); } diff --git a/schoolNewsServ/news/src/main/resources/mapper/BannerMapper.xml b/schoolNewsServ/news/src/main/resources/mapper/BannerMapper.xml index 76ff5f4..801c96e 100644 --- a/schoolNewsServ/news/src/main/resources/mapper/BannerMapper.xml +++ b/schoolNewsServ/news/src/main/resources/mapper/BannerMapper.xml @@ -54,4 +54,148 @@ ORDER BY order_num ASC, create_time DESC + + + + + + + + + + + + + + + + + + INSERT INTO tb_banner ( + id, title, image_url, link_type, link_id, link_url, order_num, status, + creator, updater, create_time, update_time, delete_time, deleted + ) VALUES ( + #{id}, #{title}, #{imageUrl}, #{linkType}, #{linkID}, #{linkUrl}, #{orderNum}, #{status}, + #{creator}, #{updater}, #{createTime}, #{updateTime}, #{deleteTime}, #{deleted} + ) + + + + + UPDATE tb_banner + + + title = #{title}, + + + image_url = #{imageUrl}, + + + link_type = #{linkType}, + + + link_id = #{linkID}, + + + link_url = #{linkUrl}, + + + order_num = #{orderNum}, + + + status = #{status}, + + + updater = #{updater}, + + + update_time = #{updateTime}, + + + delete_time = #{deleteTime}, + + + deleted = #{deleted}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_banner + WHERE id = #{id} + + + + + INSERT INTO tb_banner ( + id, title, image_url, link_type, link_id, link_url, order_num, status, + creator, updater, create_time, update_time, delete_time, deleted + ) VALUES + + ( + #{item.id}, #{item.title}, #{item.imageUrl}, #{item.linkType}, #{item.linkID}, + #{item.linkUrl}, #{item.orderNum}, #{item.status}, #{item.creator}, #{item.updater}, + #{item.createTime}, #{item.updateTime}, #{item.deleteTime}, #{item.deleted} + ) + + + + + + DELETE FROM tb_banner + WHERE id IN + + #{id} + + + + + + + + + diff --git a/schoolNewsServ/news/src/main/resources/mapper/DataCollectionConfigMapper.xml b/schoolNewsServ/news/src/main/resources/mapper/DataCollectionConfigMapper.xml index 77490c5..e150af9 100644 --- a/schoolNewsServ/news/src/main/resources/mapper/DataCollectionConfigMapper.xml +++ b/schoolNewsServ/news/src/main/resources/mapper/DataCollectionConfigMapper.xml @@ -58,4 +58,159 @@ ORDER BY create_time DESC + + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_data_collection_config ( + id, name, source_url, source_type, frequency, category_id, status, + last_collect_time, creator, updater, create_time, update_time, + delete_time, deleted + ) VALUES ( + #{id}, #{name}, #{sourceUrl}, #{sourceType}, #{frequency}, #{categoryID}, #{status}, + #{lastCollectTime}, #{creator}, #{updater}, #{createTime}, #{updateTime}, + #{deleteTime}, #{deleted} + ) + + + + + UPDATE tb_data_collection_config + + + name = #{name}, + + + source_url = #{sourceUrl}, + + + source_type = #{sourceType}, + + + frequency = #{frequency}, + + + category_id = #{categoryID}, + + + status = #{status}, + + + last_collect_time = #{lastCollectTime}, + + + updater = #{updater}, + + + update_time = #{updateTime}, + + + delete_time = #{deleteTime}, + + + deleted = #{deleted}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_data_collection_config + WHERE id = #{id} + + + + + INSERT INTO tb_data_collection_config ( + id, name, source_url, source_type, frequency, category_id, status, + last_collect_time, creator, updater, create_time, update_time, + delete_time, deleted + ) VALUES + + ( + #{item.id}, #{item.name}, #{item.sourceUrl}, #{item.sourceType}, #{item.frequency}, + #{item.categoryID}, #{item.status}, #{item.lastCollectTime}, #{item.creator}, + #{item.updater}, #{item.createTime}, #{item.updateTime}, #{item.deleteTime}, #{item.deleted} + ) + + + + + + DELETE FROM tb_data_collection_config + WHERE id IN + + #{id} + + + + + + + + + diff --git a/schoolNewsServ/news/src/main/resources/mapper/DataCollectionLogMapper.xml b/schoolNewsServ/news/src/main/resources/mapper/DataCollectionLogMapper.xml index 0575a65..8598032 100644 --- a/schoolNewsServ/news/src/main/resources/mapper/DataCollectionLogMapper.xml +++ b/schoolNewsServ/news/src/main/resources/mapper/DataCollectionLogMapper.xml @@ -41,4 +41,148 @@ ORDER BY collect_time DESC + + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_data_collection_log ( + id, config_id, collect_count, success_count, fail_count, status, + message, collect_time + ) VALUES ( + #{id}, #{configID}, #{collectCount}, #{successCount}, #{failCount}, #{status}, + #{message}, #{collectTime} + ) + + + + + UPDATE tb_data_collection_log + + + config_id = #{configID}, + + + collect_count = #{collectCount}, + + + success_count = #{successCount}, + + + fail_count = #{failCount}, + + + status = #{status}, + + + message = #{message}, + + + collect_time = #{collectTime}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_data_collection_log + WHERE id = #{id} + + + + + INSERT INTO tb_data_collection_log ( + id, config_id, collect_count, success_count, fail_count, status, + message, collect_time + ) VALUES + + ( + #{item.id}, #{item.configID}, #{item.collectCount}, #{item.successCount}, + #{item.failCount}, #{item.status}, #{item.message}, #{item.collectTime} + ) + + + + + + DELETE FROM tb_data_collection_log + WHERE id IN + + #{id} + + + + + + + + + diff --git a/schoolNewsServ/news/src/main/resources/mapper/ResourceCategoryMapper.xml b/schoolNewsServ/news/src/main/resources/mapper/ResourceCategoryMapper.xml index 15eaada..289607c 100644 --- a/schoolNewsServ/news/src/main/resources/mapper/ResourceCategoryMapper.xml +++ b/schoolNewsServ/news/src/main/resources/mapper/ResourceCategoryMapper.xml @@ -50,4 +50,145 @@ ORDER BY order_num ASC, create_time ASC + + + + + + + + + + + + + + + + + + INSERT INTO tb_resource_category ( + id, category_id, name, parent_id, description, icon, order_num, + creator, updater, create_time, update_time, delete_time, deleted + ) VALUES ( + #{id}, #{categoryID}, #{name}, #{parentID}, #{description}, #{icon}, #{orderNum}, + #{creator}, #{updater}, #{createTime}, #{updateTime}, #{deleteTime}, #{deleted} + ) + + + + + UPDATE tb_resource_category + + + category_id = #{categoryID}, + + + name = #{name}, + + + parent_id = #{parentID}, + + + description = #{description}, + + + icon = #{icon}, + + + order_num = #{orderNum}, + + + updater = #{updater}, + + + update_time = #{updateTime}, + + + delete_time = #{deleteTime}, + + + deleted = #{deleted}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_resource_category + WHERE id = #{id} + + + + + INSERT INTO tb_resource_category ( + id, category_id, name, parent_id, description, icon, order_num, + creator, updater, create_time, update_time, delete_time, deleted + ) VALUES + + ( + #{item.id}, #{item.categoryID}, #{item.name}, #{item.parentID}, #{item.description}, + #{item.icon}, #{item.orderNum}, #{item.creator}, #{item.updater}, + #{item.createTime}, #{item.updateTime}, #{item.deleteTime}, #{item.deleted} + ) + + + + + + DELETE FROM tb_resource_category + WHERE id IN + + #{id} + + + + + + + + + diff --git a/schoolNewsServ/news/src/main/resources/mapper/ResourceMapper.xml b/schoolNewsServ/news/src/main/resources/mapper/ResourceMapper.xml index c2afd1a..d7191f5 100644 --- a/schoolNewsServ/news/src/main/resources/mapper/ResourceMapper.xml +++ b/schoolNewsServ/news/src/main/resources/mapper/ResourceMapper.xml @@ -70,4 +70,216 @@ ORDER BY publish_time DESC, create_time DESC + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_resource ( + id, title, content, summary, cover_image, category_id, author, source, + source_url, view_count, like_count, collect_count, status, is_recommend, + is_banner, publish_time, creator, updater, create_time, update_time, + delete_time, deleted + ) VALUES ( + #{id}, #{title}, #{content}, #{summary}, #{coverImage}, #{categoryID}, #{author}, #{source}, + #{sourceUrl}, #{viewCount}, #{likeCount}, #{collectCount}, #{status}, #{isRecommend}, + #{isBanner}, #{publishTime}, #{creator}, #{updater}, #{createTime}, #{updateTime}, + #{deleteTime}, #{deleted} + ) + + + + + UPDATE tb_resource + + + title = #{title}, + + + content = #{content}, + + + summary = #{summary}, + + + cover_image = #{coverImage}, + + + category_id = #{categoryID}, + + + author = #{author}, + + + source = #{source}, + + + source_url = #{sourceUrl}, + + + view_count = #{viewCount}, + + + like_count = #{likeCount}, + + + collect_count = #{collectCount}, + + + status = #{status}, + + + is_recommend = #{isRecommend}, + + + is_banner = #{isBanner}, + + + publish_time = #{publishTime}, + + + updater = #{updater}, + + + update_time = #{updateTime}, + + + delete_time = #{deleteTime}, + + + deleted = #{deleted}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_resource + WHERE id = #{id} + + + + + INSERT INTO tb_resource ( + id, title, content, summary, cover_image, category_id, author, source, + source_url, view_count, like_count, collect_count, status, is_recommend, + is_banner, publish_time, creator, updater, create_time, update_time, + delete_time, deleted + ) VALUES + + ( + #{item.id}, #{item.title}, #{item.content}, #{item.summary}, #{item.coverImage}, + #{item.categoryID}, #{item.author}, #{item.source}, #{item.sourceUrl}, + #{item.viewCount}, #{item.likeCount}, #{item.collectCount}, #{item.status}, + #{item.isRecommend}, #{item.isBanner}, #{item.publishTime}, #{item.creator}, + #{item.updater}, #{item.createTime}, #{item.updateTime}, #{item.deleteTime}, #{item.deleted} + ) + + + + + + DELETE FROM tb_resource + WHERE id IN + + #{id} + + + + + + + + + diff --git a/schoolNewsServ/news/src/main/resources/mapper/ResourceRecommendMapper.xml b/schoolNewsServ/news/src/main/resources/mapper/ResourceRecommendMapper.xml index eb437cb..e7047da 100644 --- a/schoolNewsServ/news/src/main/resources/mapper/ResourceRecommendMapper.xml +++ b/schoolNewsServ/news/src/main/resources/mapper/ResourceRecommendMapper.xml @@ -44,4 +44,149 @@ ORDER BY order_num ASC, create_time DESC + + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_resource_recommend ( + id, resource_id, order_num, reason, creator, updater, create_time, + update_time, delete_time, deleted + ) VALUES ( + #{id}, #{resourceID}, #{orderNum}, #{reason}, #{creator}, #{updater}, #{createTime}, + #{updateTime}, #{deleteTime}, #{deleted} + ) + + + + + UPDATE tb_resource_recommend + + + resource_id = #{resourceID}, + + + order_num = #{orderNum}, + + + reason = #{reason}, + + + updater = #{updater}, + + + update_time = #{updateTime}, + + + delete_time = #{deleteTime}, + + + deleted = #{deleted}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_resource_recommend + WHERE id = #{id} + + + + + INSERT INTO tb_resource_recommend ( + id, resource_id, order_num, reason, creator, updater, create_time, + update_time, delete_time, deleted + ) VALUES + + ( + #{item.id}, #{item.resourceID}, #{item.orderNum}, #{item.reason}, #{item.creator}, + #{item.updater}, #{item.createTime}, #{item.updateTime}, #{item.deleteTime}, #{item.deleted} + ) + + + + + + DELETE FROM tb_resource_recommend + WHERE id IN + + #{id} + + + + + + + + + diff --git a/schoolNewsServ/news/src/main/resources/mapper/ResourceTagMapper.xml b/schoolNewsServ/news/src/main/resources/mapper/ResourceTagMapper.xml index c57ef87..f5c550f 100644 --- a/schoolNewsServ/news/src/main/resources/mapper/ResourceTagMapper.xml +++ b/schoolNewsServ/news/src/main/resources/mapper/ResourceTagMapper.xml @@ -37,4 +37,133 @@ ORDER BY create_time DESC + + + + + + + + + + + + + + + + + + INSERT INTO tb_resource_tag ( + id, resource_id, tag_id, creator, create_time + ) VALUES ( + #{id}, #{resourceID}, #{tagID}, #{creator}, #{createTime} + ) + + + + + UPDATE tb_resource_tag + + + resource_id = #{resourceID}, + + + tag_id = #{tagID}, + + + creator = #{creator}, + + + create_time = #{createTime}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_resource_tag + WHERE id = #{id} + + + + + INSERT INTO tb_resource_tag ( + id, resource_id, tag_id, creator, create_time + ) VALUES + + ( + #{item.id}, #{item.resourceID}, #{item.tagID}, #{item.creator}, #{item.createTime} + ) + + + + + + DELETE FROM tb_resource_tag + WHERE id IN + + #{id} + + + + + + DELETE FROM tb_resource_tag + WHERE resource_id = #{resourceId} + + + + + DELETE FROM tb_resource_tag + WHERE tag_id = #{tagId} + + + + + + + + diff --git a/schoolNewsServ/news/src/main/resources/mapper/TagMapper.xml b/schoolNewsServ/news/src/main/resources/mapper/TagMapper.xml index a475bda..a2605c2 100644 --- a/schoolNewsServ/news/src/main/resources/mapper/TagMapper.xml +++ b/schoolNewsServ/news/src/main/resources/mapper/TagMapper.xml @@ -48,4 +48,150 @@ ORDER BY create_time DESC + + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_tag ( + id, tag_id, name, color, description, creator, updater, create_time, + update_time, delete_time, deleted + ) VALUES ( + #{id}, #{tagID}, #{name}, #{color}, #{description}, #{creator}, #{updater}, #{createTime}, + #{updateTime}, #{deleteTime}, #{deleted} + ) + + + + + UPDATE tb_tag + + + tag_id = #{tagID}, + + + name = #{name}, + + + color = #{color}, + + + description = #{description}, + + + updater = #{updater}, + + + update_time = #{updateTime}, + + + delete_time = #{deleteTime}, + + + deleted = #{deleted}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_tag + WHERE id = #{id} + + + + + INSERT INTO tb_tag ( + id, tag_id, name, color, description, creator, updater, create_time, + update_time, delete_time, deleted + ) VALUES + + ( + #{item.id}, #{item.tagID}, #{item.name}, #{item.color}, #{item.description}, + #{item.creator}, #{item.updater}, #{item.createTime}, #{item.updateTime}, + #{item.deleteTime}, #{item.deleted} + ) + + + + + + DELETE FROM tb_tag + WHERE id IN + + #{id} + + + + + + + + + diff --git a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/CourseChapterMapper.java b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/CourseChapterMapper.java index 17e8e27..7483074 100644 --- a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/CourseChapterMapper.java +++ b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/CourseChapterMapper.java @@ -2,12 +2,14 @@ package org.xyzh.study.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.study.TbCourseChapter; import java.util.List; /** - * @description 课程章节数据访问层 + * @description CourseChapterMapper.java文件描述 课程章节数据访问层 * @filename CourseChapterMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,132 @@ public interface CourseChapterMapper extends BaseMapper { * @since 2025-10-15 */ List selectCourseChapters(TbCourseChapter filter); + + /** + * @description 根据章节ID查询章节信息 + * @param chapterId 章节ID + * @return TbCourseChapter 章节信息 + * @author yslg + * @since 2025-10-15 + */ + TbCourseChapter selectByChapterId(@Param("chapterId") String chapterId); + + /** + * @description 根据课程ID查询章节列表 + * @param courseId 课程ID + * @return List 章节列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByCourseId(@Param("courseId") String courseId); + + /** + * @description 根据章节名称查询章节 + * @param name 章节名称 + * @return TbCourseChapter 章节信息 + * @author yslg + * @since 2025-10-15 + */ + TbCourseChapter selectByName(@Param("name") String name); + + /** + * @description 根据状态查询章节列表 + * @param status 状态 + * @return List 章节列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByStatus(@Param("status") Integer status); + + /** + * @description 根据课程ID和排序查询章节列表 + * @param courseId 课程ID + * @return List 章节列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByCourseIdOrderBySort(@Param("courseId") String courseId); + + /** + * @description 检查章节名称是否存在 + * @param name 章节名称 + * @param excludeId 排除的章节ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByName(@Param("name") String name, @Param("excludeId") String excludeId); + + /** + * @description 插入课程章节 + * @param courseChapter 课程章节 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertCourseChapter(TbCourseChapter courseChapter); + + /** + * @description 更新课程章节 + * @param courseChapter 课程章节 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateCourseChapter(TbCourseChapter courseChapter); + + /** + * @description 删除课程章节 + * @param courseChapter 课程章节 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteCourseChapter(TbCourseChapter courseChapter); + + /** + * @description 批量插入课程章节 + * @param courseChapterList 课程章节列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertCourseChapters(@Param("courseChapterList") List courseChapterList); + + /** + * @description 批量删除课程章节 + * @param ids 章节ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteCourseChapters(@Param("ids") List ids); + + /** + * @description 根据课程ID批量删除章节 + * @param courseId 课程ID + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteByCourseId(@Param("courseId") String courseId); + + /** + * @description 分页查询课程章节 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 课程章节列表 + * @author yslg + * @since 2025-10-15 + */ + List selectCourseChaptersPage(@Param("filter") TbCourseChapter filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计课程章节总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countCourseChapters(@Param("filter") TbCourseChapter filter); } diff --git a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/CourseMapper.java b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/CourseMapper.java index 59f51e3..4eff49a 100644 --- a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/CourseMapper.java +++ b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/CourseMapper.java @@ -2,12 +2,14 @@ package org.xyzh.study.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.study.TbCourse; import java.util.List; /** - * @description 课程数据访问层 + * @description CourseMapper.java文件描述 课程数据访问层 * @filename CourseMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,150 @@ public interface CourseMapper extends BaseMapper { * @since 2025-10-15 */ List selectCourses(TbCourse filter); + + /** + * @description 根据课程ID查询课程信息 + * @param courseId 课程ID + * @return TbCourse 课程信息 + * @author yslg + * @since 2025-10-15 + */ + TbCourse selectByCourseId(@Param("courseId") String courseId); + + /** + * @description 根据课程名称查询课程 + * @param name 课程名称 + * @return TbCourse 课程信息 + * @author yslg + * @since 2025-10-15 + */ + TbCourse selectByName(@Param("name") String name); + + /** + * @description 根据状态查询课程列表 + * @param status 状态 + * @return List 课程列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByStatus(@Param("status") Integer status); + + /** + * @description 根据类型查询课程列表 + * @param type 类型 + * @return List 课程列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByType(@Param("type") Integer type); + + /** + * @description 根据难度查询课程列表 + * @param difficulty 难度 + * @return List 课程列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByDifficulty(@Param("difficulty") Integer difficulty); + + /** + * @description 查询热门课程列表 + * @param limit 限制数量 + * @return List 课程列表 + * @author yslg + * @since 2025-10-15 + */ + List selectHotCourses(@Param("limit") Integer limit); + + /** + * @description 查询最新课程列表 + * @param limit 限制数量 + * @return List 课程列表 + * @author yslg + * @since 2025-10-15 + */ + List selectLatestCourses(@Param("limit") Integer limit); + + /** + * @description 根据关键词搜索课程 + * @param keyword 关键词 + * @return List 课程列表 + * @author yslg + * @since 2025-10-15 + */ + List searchByKeyword(@Param("keyword") String keyword); + + /** + * @description 检查课程名称是否存在 + * @param name 课程名称 + * @param excludeId 排除的课程ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByName(@Param("name") String name, @Param("excludeId") String excludeId); + + /** + * @description 插入课程 + * @param course 课程 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertCourse(TbCourse course); + + /** + * @description 更新课程 + * @param course 课程 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateCourse(TbCourse course); + + /** + * @description 删除课程 + * @param course 课程 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteCourse(TbCourse course); + + /** + * @description 批量插入课程 + * @param courseList 课程列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertCourses(@Param("courseList") List courseList); + + /** + * @description 批量删除课程 + * @param ids 课程ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteCourses(@Param("ids") List ids); + + /** + * @description 分页查询课程 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 课程列表 + * @author yslg + * @since 2025-10-15 + */ + List selectCoursesPage(@Param("filter") TbCourse filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计课程总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countCourses(@Param("filter") TbCourse filter); } diff --git a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/CourseTagMapper.java b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/CourseTagMapper.java index 7245409..f7365bb 100644 --- a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/CourseTagMapper.java +++ b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/CourseTagMapper.java @@ -2,12 +2,14 @@ package org.xyzh.study.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.study.TbCourseTag; import java.util.List; /** - * @description 课程标签关联数据访问层 + * @description CourseTagMapper.java文件描述 课程标签关联数据访问层 * @filename CourseTagMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,134 @@ public interface CourseTagMapper extends BaseMapper { * @since 2025-10-15 */ List selectCourseTags(TbCourseTag filter); + + /** + * @description 根据关联ID查询关联信息 + * @param relationId 关联ID + * @return TbCourseTag 关联信息 + * @author yslg + * @since 2025-10-15 + */ + TbCourseTag selectByRelationId(@Param("relationId") String relationId); + + /** + * @description 根据课程ID查询标签关联列表 + * @param courseId 课程ID + * @return List 标签关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByCourseId(@Param("courseId") String courseId); + + /** + * @description 根据标签ID查询课程关联列表 + * @param tagId 标签ID + * @return List 课程关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByTagId(@Param("tagId") String tagId); + + /** + * @description 根据课程ID和标签ID查询关联信息 + * @param courseId 课程ID + * @param tagId 标签ID + * @return TbCourseTag 关联信息 + * @author yslg + * @since 2025-10-15 + */ + TbCourseTag selectByCourseIdAndTagId(@Param("courseId") String courseId, @Param("tagId") String tagId); + + /** + * @description 检查课程标签关联是否存在 + * @param courseId 课程ID + * @param tagId 标签ID + * @param excludeId 排除的关联ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByCourseIdAndTagId(@Param("courseId") String courseId, @Param("tagId") String tagId, @Param("excludeId") String excludeId); + + /** + * @description 插入课程标签关联 + * @param courseTag 课程标签关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertCourseTag(TbCourseTag courseTag); + + /** + * @description 更新课程标签关联 + * @param courseTag 课程标签关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateCourseTag(TbCourseTag courseTag); + + /** + * @description 删除课程标签关联 + * @param courseTag 课程标签关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteCourseTag(TbCourseTag courseTag); + + /** + * @description 批量插入课程标签关联 + * @param courseTagList 课程标签关联列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertCourseTags(@Param("courseTagList") List courseTagList); + + /** + * @description 批量删除课程标签关联 + * @param ids 关联ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteCourseTags(@Param("ids") List ids); + + /** + * @description 根据课程ID批量删除标签关联 + * @param courseId 课程ID + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteByCourseId(@Param("courseId") String courseId); + + /** + * @description 根据标签ID批量删除课程关联 + * @param tagId 标签ID + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteByTagId(@Param("tagId") String tagId); + + /** + * @description 分页查询课程标签关联 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 课程标签关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectCourseTagsPage(@Param("filter") TbCourseTag filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计课程标签关联总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countCourseTags(@Param("filter") TbCourseTag filter); } diff --git a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/LearningRecordMapper.java b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/LearningRecordMapper.java index a5e14ea..9034d17 100644 --- a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/LearningRecordMapper.java +++ b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/LearningRecordMapper.java @@ -2,12 +2,14 @@ package org.xyzh.study.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.study.TbLearningRecord; import java.util.List; /** - * @description 学习记录数据访问层 + * @description LearningRecordMapper.java文件描述 学习记录数据访问层 * @filename LearningRecordMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,123 @@ public interface LearningRecordMapper extends BaseMapper { * @since 2025-10-15 */ List selectLearningRecords(TbLearningRecord filter); + + /** + * @description 根据记录ID查询记录信息 + * @param recordId 记录ID + * @return TbLearningRecord 记录信息 + * @author yslg + * @since 2025-10-15 + */ + TbLearningRecord selectByRecordId(@Param("recordId") String recordId); + + /** + * @description 根据用户ID查询学习记录列表 + * @param userId 用户ID + * @return List 学习记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByUserId(@Param("userId") String userId); + + /** + * @description 根据课程ID查询学习记录列表 + * @param courseId 课程ID + * @return List 学习记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByCourseId(@Param("courseId") String courseId); + + /** + * @description 根据用户ID和课程ID查询学习记录 + * @param userId 用户ID + * @param courseId 课程ID + * @return TbLearningRecord 学习记录 + * @author yslg + * @since 2025-10-15 + */ + TbLearningRecord selectByUserIdAndCourseId(@Param("userId") String userId, @Param("courseId") String courseId); + + /** + * @description 根据状态查询学习记录列表 + * @param status 状态 + * @return List 学习记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByStatus(@Param("status") Integer status); + + /** + * @description 查询用户学习统计信息 + * @param userId 用户ID + * @return TbLearningRecord 统计信息 + * @author yslg + * @since 2025-10-15 + */ + TbLearningRecord selectLearningStatistics(@Param("userId") String userId); + + /** + * @description 插入学习记录 + * @param learningRecord 学习记录 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertLearningRecord(TbLearningRecord learningRecord); + + /** + * @description 更新学习记录 + * @param learningRecord 学习记录 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateLearningRecord(TbLearningRecord learningRecord); + + /** + * @description 删除学习记录 + * @param learningRecord 学习记录 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteLearningRecord(TbLearningRecord learningRecord); + + /** + * @description 批量插入学习记录 + * @param learningRecordList 学习记录列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertLearningRecords(@Param("learningRecordList") List learningRecordList); + + /** + * @description 批量删除学习记录 + * @param ids 记录ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteLearningRecords(@Param("ids") List ids); + + /** + * @description 分页查询学习记录 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 学习记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectLearningRecordsPage(@Param("filter") TbLearningRecord filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计学习记录总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countLearningRecords(@Param("filter") TbLearningRecord filter); } diff --git a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/LearningStatisticsMapper.java b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/LearningStatisticsMapper.java index 68c44fb..ad617cb 100644 --- a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/LearningStatisticsMapper.java +++ b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/LearningStatisticsMapper.java @@ -2,12 +2,14 @@ package org.xyzh.study.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.study.TbLearningStatistics; import java.util.List; /** - * @description 学习统计数据访问层 + * @description LearningStatisticsMapper.java文件描述 学习统计数据访问层 * @filename LearningStatisticsMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,123 @@ public interface LearningStatisticsMapper extends BaseMapper selectLearningStatistics(TbLearningStatistics filter); + + /** + * @description 根据统计ID查询统计信息 + * @param statisticsId 统计ID + * @return TbLearningStatistics 统计信息 + * @author yslg + * @since 2025-10-15 + */ + TbLearningStatistics selectByStatisticsId(@Param("statisticsId") String statisticsId); + + /** + * @description 根据用户ID查询学习统计 + * @param userId 用户ID + * @return TbLearningStatistics 学习统计 + * @author yslg + * @since 2025-10-15 + */ + TbLearningStatistics selectByUserId(@Param("userId") String userId); + + /** + * @description 根据课程ID查询学习统计列表 + * @param courseId 课程ID + * @return List 学习统计列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByCourseId(@Param("courseId") String courseId); + + /** + * @description 根据用户ID和课程ID查询学习统计 + * @param userId 用户ID + * @param courseId 课程ID + * @return TbLearningStatistics 学习统计 + * @author yslg + * @since 2025-10-15 + */ + TbLearningStatistics selectByUserIdAndCourseId(@Param("userId") String userId, @Param("courseId") String courseId); + + /** + * @description 根据统计类型查询学习统计列表 + * @param type 统计类型 + * @return List 学习统计列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByType(@Param("type") Integer type); + + /** + * @description 查询用户学习排行榜 + * @param limit 限制数量 + * @return List 学习统计列表 + * @author yslg + * @since 2025-10-15 + */ + List selectLearningRanking(@Param("limit") Integer limit); + + /** + * @description 插入学习统计 + * @param learningStatistics 学习统计 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertLearningStatistics(TbLearningStatistics learningStatistics); + + /** + * @description 更新学习统计 + * @param learningStatistics 学习统计 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateLearningStatistics(TbLearningStatistics learningStatistics); + + /** + * @description 删除学习统计 + * @param learningStatistics 学习统计 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteLearningStatistics(TbLearningStatistics learningStatistics); + + /** + * @description 批量插入学习统计 + * @param learningStatisticsList 学习统计列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertLearningStatistics(@Param("learningStatisticsList") List learningStatisticsList); + + /** + * @description 批量删除学习统计 + * @param ids 统计ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteLearningStatistics(@Param("ids") List ids); + + /** + * @description 分页查询学习统计 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 学习统计列表 + * @author yslg + * @since 2025-10-15 + */ + List selectLearningStatisticsPage(@Param("filter") TbLearningStatistics filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计学习统计总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countLearningStatistics(@Param("filter") TbLearningStatistics filter); } diff --git a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/LearningTaskMapper.java b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/LearningTaskMapper.java index 7de98c0..dd179ae 100644 --- a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/LearningTaskMapper.java +++ b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/LearningTaskMapper.java @@ -2,12 +2,14 @@ package org.xyzh.study.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.study.TbLearningTask; import java.util.List; /** - * @description 学习任务数据访问层 + * @description LearningTaskMapper.java文件描述 学习任务数据访问层 * @filename LearningTaskMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,141 @@ public interface LearningTaskMapper extends BaseMapper { * @since 2025-10-15 */ List selectLearningTasks(TbLearningTask filter); + + /** + * @description 根据任务ID查询任务信息 + * @param taskId 任务ID + * @return TbLearningTask 任务信息 + * @author yslg + * @since 2025-10-15 + */ + TbLearningTask selectByTaskId(@Param("taskId") String taskId); + + /** + * @description 根据用户ID查询学习任务列表 + * @param userId 用户ID + * @return List 学习任务列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByUserId(@Param("userId") String userId); + + /** + * @description 根据任务名称查询任务 + * @param name 任务名称 + * @return TbLearningTask 任务信息 + * @author yslg + * @since 2025-10-15 + */ + TbLearningTask selectByName(@Param("name") String name); + + /** + * @description 根据状态查询学习任务列表 + * @param status 状态 + * @return List 学习任务列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByStatus(@Param("status") Integer status); + + /** + * @description 根据优先级查询学习任务列表 + * @param priority 优先级 + * @return List 学习任务列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByPriority(@Param("priority") Integer priority); + + /** + * @description 查询用户待完成任务列表 + * @param userId 用户ID + * @return List 学习任务列表 + * @author yslg + * @since 2025-10-15 + */ + List selectPendingTasksByUserId(@Param("userId") String userId); + + /** + * @description 查询用户已完成任务列表 + * @param userId 用户ID + * @return List 学习任务列表 + * @author yslg + * @since 2025-10-15 + */ + List selectCompletedTasksByUserId(@Param("userId") String userId); + + /** + * @description 检查任务名称是否存在 + * @param name 任务名称 + * @param excludeId 排除的任务ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByName(@Param("name") String name, @Param("excludeId") String excludeId); + + /** + * @description 插入学习任务 + * @param learningTask 学习任务 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertLearningTask(TbLearningTask learningTask); + + /** + * @description 更新学习任务 + * @param learningTask 学习任务 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateLearningTask(TbLearningTask learningTask); + + /** + * @description 删除学习任务 + * @param learningTask 学习任务 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteLearningTask(TbLearningTask learningTask); + + /** + * @description 批量插入学习任务 + * @param learningTaskList 学习任务列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertLearningTasks(@Param("learningTaskList") List learningTaskList); + + /** + * @description 批量删除学习任务 + * @param ids 任务ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteLearningTasks(@Param("ids") List ids); + + /** + * @description 分页查询学习任务 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 学习任务列表 + * @author yslg + * @since 2025-10-15 + */ + List selectLearningTasksPage(@Param("filter") TbLearningTask filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计学习任务总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countLearningTasks(@Param("filter") TbLearningTask filter); } diff --git a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/TaskCourseMapper.java b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/TaskCourseMapper.java index 517e63e..b8c9960 100644 --- a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/TaskCourseMapper.java +++ b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/TaskCourseMapper.java @@ -2,12 +2,14 @@ package org.xyzh.study.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.study.TbTaskCourse; import java.util.List; /** - * @description 任务课程关联数据访问层 + * @description TaskCourseMapper.java文件描述 任务课程关联数据访问层 * @filename TaskCourseMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,134 @@ public interface TaskCourseMapper extends BaseMapper { * @since 2025-10-15 */ List selectTaskCourses(TbTaskCourse filter); + + /** + * @description 根据关联ID查询关联信息 + * @param relationId 关联ID + * @return TbTaskCourse 关联信息 + * @author yslg + * @since 2025-10-15 + */ + TbTaskCourse selectByRelationId(@Param("relationId") String relationId); + + /** + * @description 根据任务ID查询课程关联列表 + * @param taskId 任务ID + * @return List 课程关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByTaskId(@Param("taskId") String taskId); + + /** + * @description 根据课程ID查询任务关联列表 + * @param courseId 课程ID + * @return List 任务关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByCourseId(@Param("courseId") String courseId); + + /** + * @description 根据任务ID和课程ID查询关联信息 + * @param taskId 任务ID + * @param courseId 课程ID + * @return TbTaskCourse 关联信息 + * @author yslg + * @since 2025-10-15 + */ + TbTaskCourse selectByTaskIdAndCourseId(@Param("taskId") String taskId, @Param("courseId") String courseId); + + /** + * @description 检查任务课程关联是否存在 + * @param taskId 任务ID + * @param courseId 课程ID + * @param excludeId 排除的关联ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByTaskIdAndCourseId(@Param("taskId") String taskId, @Param("courseId") String courseId, @Param("excludeId") String excludeId); + + /** + * @description 插入任务课程关联 + * @param taskCourse 任务课程关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertTaskCourse(TbTaskCourse taskCourse); + + /** + * @description 更新任务课程关联 + * @param taskCourse 任务课程关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateTaskCourse(TbTaskCourse taskCourse); + + /** + * @description 删除任务课程关联 + * @param taskCourse 任务课程关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteTaskCourse(TbTaskCourse taskCourse); + + /** + * @description 批量插入任务课程关联 + * @param taskCourseList 任务课程关联列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertTaskCourses(@Param("taskCourseList") List taskCourseList); + + /** + * @description 批量删除任务课程关联 + * @param ids 关联ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteTaskCourses(@Param("ids") List ids); + + /** + * @description 根据任务ID批量删除课程关联 + * @param taskId 任务ID + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteByTaskId(@Param("taskId") String taskId); + + /** + * @description 根据课程ID批量删除任务关联 + * @param courseId 课程ID + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteByCourseId(@Param("courseId") String courseId); + + /** + * @description 分页查询任务课程关联 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 任务课程关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectTaskCoursesPage(@Param("filter") TbTaskCourse filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计任务课程关联总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countTaskCourses(@Param("filter") TbTaskCourse filter); } diff --git a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/TaskResourceMapper.java b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/TaskResourceMapper.java index b82d1e6..70b9a79 100644 --- a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/TaskResourceMapper.java +++ b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/TaskResourceMapper.java @@ -2,12 +2,14 @@ package org.xyzh.study.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.study.TbTaskResource; import java.util.List; /** - * @description 任务资源关联数据访问层 + * @description TaskResourceMapper.java文件描述 任务资源关联数据访问层 * @filename TaskResourceMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,134 @@ public interface TaskResourceMapper extends BaseMapper { * @since 2025-10-15 */ List selectTaskResources(TbTaskResource filter); + + /** + * @description 根据关联ID查询关联信息 + * @param relationId 关联ID + * @return TbTaskResource 关联信息 + * @author yslg + * @since 2025-10-15 + */ + TbTaskResource selectByRelationId(@Param("relationId") String relationId); + + /** + * @description 根据任务ID查询资源关联列表 + * @param taskId 任务ID + * @return List 资源关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByTaskId(@Param("taskId") String taskId); + + /** + * @description 根据资源ID查询任务关联列表 + * @param resourceId 资源ID + * @return List 任务关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByResourceId(@Param("resourceId") String resourceId); + + /** + * @description 根据任务ID和资源ID查询关联信息 + * @param taskId 任务ID + * @param resourceId 资源ID + * @return TbTaskResource 关联信息 + * @author yslg + * @since 2025-10-15 + */ + TbTaskResource selectByTaskIdAndResourceId(@Param("taskId") String taskId, @Param("resourceId") String resourceId); + + /** + * @description 检查任务资源关联是否存在 + * @param taskId 任务ID + * @param resourceId 资源ID + * @param excludeId 排除的关联ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByTaskIdAndResourceId(@Param("taskId") String taskId, @Param("resourceId") String resourceId, @Param("excludeId") String excludeId); + + /** + * @description 插入任务资源关联 + * @param taskResource 任务资源关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertTaskResource(TbTaskResource taskResource); + + /** + * @description 更新任务资源关联 + * @param taskResource 任务资源关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateTaskResource(TbTaskResource taskResource); + + /** + * @description 删除任务资源关联 + * @param taskResource 任务资源关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteTaskResource(TbTaskResource taskResource); + + /** + * @description 批量插入任务资源关联 + * @param taskResourceList 任务资源关联列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertTaskResources(@Param("taskResourceList") List taskResourceList); + + /** + * @description 批量删除任务资源关联 + * @param ids 关联ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteTaskResources(@Param("ids") List ids); + + /** + * @description 根据任务ID批量删除资源关联 + * @param taskId 任务ID + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteByTaskId(@Param("taskId") String taskId); + + /** + * @description 根据资源ID批量删除任务关联 + * @param resourceId 资源ID + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteByResourceId(@Param("resourceId") String resourceId); + + /** + * @description 分页查询任务资源关联 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 任务资源关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectTaskResourcesPage(@Param("filter") TbTaskResource filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计任务资源关联总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countTaskResources(@Param("filter") TbTaskResource filter); } diff --git a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/TaskUserMapper.java b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/TaskUserMapper.java index 7dd370b..337c973 100644 --- a/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/TaskUserMapper.java +++ b/schoolNewsServ/study/src/main/java/org/xyzh/study/mapper/TaskUserMapper.java @@ -2,12 +2,14 @@ package org.xyzh.study.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.study.TbTaskUser; import java.util.List; /** - * @description 任务用户数据访问层 + * @description TaskUserMapper.java文件描述 任务用户数据访问层 * @filename TaskUserMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,153 @@ public interface TaskUserMapper extends BaseMapper { * @since 2025-10-15 */ List selectTaskUsers(TbTaskUser filter); + + /** + * @description 根据关联ID查询关联信息 + * @param relationId 关联ID + * @return TbTaskUser 关联信息 + * @author yslg + * @since 2025-10-15 + */ + TbTaskUser selectByRelationId(@Param("relationId") String relationId); + + /** + * @description 根据任务ID查询用户关联列表 + * @param taskId 任务ID + * @return List 用户关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByTaskId(@Param("taskId") String taskId); + + /** + * @description 根据用户ID查询任务关联列表 + * @param userId 用户ID + * @return List 任务关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByUserId(@Param("userId") String userId); + + /** + * @description 根据任务ID和用户ID查询关联信息 + * @param taskId 任务ID + * @param userId 用户ID + * @return TbTaskUser 关联信息 + * @author yslg + * @since 2025-10-15 + */ + TbTaskUser selectByTaskIdAndUserId(@Param("taskId") String taskId, @Param("userId") String userId); + + /** + * @description 根据状态查询任务用户关联列表 + * @param status 状态 + * @return List 任务用户关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByStatus(@Param("status") Integer status); + + /** + * @description 根据用户ID和状态查询任务关联列表 + * @param userId 用户ID + * @param status 状态 + * @return List 任务关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByUserIdAndStatus(@Param("userId") String userId, @Param("status") Integer status); + + /** + * @description 检查任务用户关联是否存在 + * @param taskId 任务ID + * @param userId 用户ID + * @param excludeId 排除的关联ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByTaskIdAndUserId(@Param("taskId") String taskId, @Param("userId") String userId, @Param("excludeId") String excludeId); + + /** + * @description 插入任务用户关联 + * @param taskUser 任务用户关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertTaskUser(TbTaskUser taskUser); + + /** + * @description 更新任务用户关联 + * @param taskUser 任务用户关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateTaskUser(TbTaskUser taskUser); + + /** + * @description 删除任务用户关联 + * @param taskUser 任务用户关联 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteTaskUser(TbTaskUser taskUser); + + /** + * @description 批量插入任务用户关联 + * @param taskUserList 任务用户关联列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertTaskUsers(@Param("taskUserList") List taskUserList); + + /** + * @description 批量删除任务用户关联 + * @param ids 关联ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteTaskUsers(@Param("ids") List ids); + + /** + * @description 根据任务ID批量删除用户关联 + * @param taskId 任务ID + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteByTaskId(@Param("taskId") String taskId); + + /** + * @description 根据用户ID批量删除任务关联 + * @param userId 用户ID + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteByUserId(@Param("userId") String userId); + + /** + * @description 分页查询任务用户关联 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 任务用户关联列表 + * @author yslg + * @since 2025-10-15 + */ + List selectTaskUsersPage(@Param("filter") TbTaskUser filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计任务用户关联总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countTaskUsers(@Param("filter") TbTaskUser filter); } diff --git a/schoolNewsServ/study/src/main/resources/mapper/CourseChapterMapper.xml b/schoolNewsServ/study/src/main/resources/mapper/CourseChapterMapper.xml index a7f4ab7..08dd136 100644 --- a/schoolNewsServ/study/src/main/resources/mapper/CourseChapterMapper.xml +++ b/schoolNewsServ/study/src/main/resources/mapper/CourseChapterMapper.xml @@ -47,4 +47,159 @@ ORDER BY order_num ASC, create_time ASC + + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_course_chapter ( + id, course_id, name, content, video_url, duration, order_num, + creator, updater, create_time, update_time, delete_time, deleted + ) VALUES ( + #{id}, #{courseID}, #{name}, #{content}, #{videoUrl}, #{duration}, #{orderNum}, + #{creator}, #{updater}, #{createTime}, #{updateTime}, #{deleteTime}, #{deleted} + ) + + + + + UPDATE tb_course_chapter + + + course_id = #{courseID}, + + + name = #{name}, + + + content = #{content}, + + + video_url = #{videoUrl}, + + + duration = #{duration}, + + + order_num = #{orderNum}, + + + updater = #{updater}, + + + update_time = #{updateTime}, + + + delete_time = #{deleteTime}, + + + deleted = #{deleted}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_course_chapter + WHERE id = #{id} + + + + + INSERT INTO tb_course_chapter ( + id, course_id, name, content, video_url, duration, order_num, + creator, updater, create_time, update_time, delete_time, deleted + ) VALUES + + ( + #{item.id}, #{item.courseID}, #{item.name}, #{item.content}, #{item.videoUrl}, + #{item.duration}, #{item.orderNum}, #{item.creator}, #{item.updater}, + #{item.createTime}, #{item.updateTime}, #{item.deleteTime}, #{item.deleted} + ) + + + + + + DELETE FROM tb_course_chapter + WHERE id IN + + #{id} + + + + + + DELETE FROM tb_course_chapter + WHERE course_id = #{courseId} + + + + + + + + diff --git a/schoolNewsServ/study/src/main/resources/mapper/CourseMapper.xml b/schoolNewsServ/study/src/main/resources/mapper/CourseMapper.xml index deed2e1..b45155f 100644 --- a/schoolNewsServ/study/src/main/resources/mapper/CourseMapper.xml +++ b/schoolNewsServ/study/src/main/resources/mapper/CourseMapper.xml @@ -59,4 +59,209 @@ ORDER BY order_num ASC, create_time DESC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_course ( + id, course_id, name, cover_image, description, content, duration, + teacher, status, view_count, learn_count, order_num, creator, updater, + create_time, update_time, delete_time, deleted + ) VALUES ( + #{id}, #{courseID}, #{name}, #{coverImage}, #{description}, #{content}, #{duration}, + #{teacher}, #{status}, #{viewCount}, #{learnCount}, #{orderNum}, #{creator}, #{updater}, + #{createTime}, #{updateTime}, #{deleteTime}, #{deleted} + ) + + + + + UPDATE tb_course + + + course_id = #{courseID}, + + + name = #{name}, + + + cover_image = #{coverImage}, + + + description = #{description}, + + + content = #{content}, + + + duration = #{duration}, + + + teacher = #{teacher}, + + + status = #{status}, + + + view_count = #{viewCount}, + + + learn_count = #{learnCount}, + + + order_num = #{orderNum}, + + + updater = #{updater}, + + + update_time = #{updateTime}, + + + delete_time = #{deleteTime}, + + + deleted = #{deleted}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_course + WHERE id = #{id} + + + + + INSERT INTO tb_course ( + id, course_id, name, cover_image, description, content, duration, + teacher, status, view_count, learn_count, order_num, creator, updater, + create_time, update_time, delete_time, deleted + ) VALUES + + ( + #{item.id}, #{item.courseID}, #{item.name}, #{item.coverImage}, #{item.description}, + #{item.content}, #{item.duration}, #{item.teacher}, #{item.status}, #{item.viewCount}, + #{item.learnCount}, #{item.orderNum}, #{item.creator}, #{item.updater}, + #{item.createTime}, #{item.updateTime}, #{item.deleteTime}, #{item.deleted} + ) + + + + + + DELETE FROM tb_course + WHERE id IN + + #{id} + + + + + + + + + diff --git a/schoolNewsServ/study/src/main/resources/mapper/CourseTagMapper.xml b/schoolNewsServ/study/src/main/resources/mapper/CourseTagMapper.xml index 8eaf4a5..36ea40a 100644 --- a/schoolNewsServ/study/src/main/resources/mapper/CourseTagMapper.xml +++ b/schoolNewsServ/study/src/main/resources/mapper/CourseTagMapper.xml @@ -37,4 +37,133 @@ ORDER BY create_time DESC + + + + + + + + + + + + + + + + + + INSERT INTO tb_course_tag ( + id, course_id, tag_id, creator, create_time + ) VALUES ( + #{id}, #{courseID}, #{tagID}, #{creator}, #{createTime} + ) + + + + + UPDATE tb_course_tag + + + course_id = #{courseID}, + + + tag_id = #{tagID}, + + + creator = #{creator}, + + + create_time = #{createTime}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_course_tag + WHERE id = #{id} + + + + + INSERT INTO tb_course_tag ( + id, course_id, tag_id, creator, create_time + ) VALUES + + ( + #{item.id}, #{item.courseID}, #{item.tagID}, #{item.creator}, #{item.createTime} + ) + + + + + + DELETE FROM tb_course_tag + WHERE id IN + + #{id} + + + + + + DELETE FROM tb_course_tag + WHERE course_id = #{courseId} + + + + + DELETE FROM tb_course_tag + WHERE tag_id = #{tagId} + + + + + + + + diff --git a/schoolNewsServ/study/src/main/resources/mapper/LearningRecordMapper.xml b/schoolNewsServ/study/src/main/resources/mapper/LearningRecordMapper.xml index 36346eb..a0e2737 100644 --- a/schoolNewsServ/study/src/main/resources/mapper/LearningRecordMapper.xml +++ b/schoolNewsServ/study/src/main/resources/mapper/LearningRecordMapper.xml @@ -54,4 +54,156 @@ ORDER BY last_learn_time DESC, create_time DESC + + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_learning_record ( + id, user_id, resource_type, resource_id, task_id, duration, progress, + is_complete, complete_time, last_learn_time, create_time, update_time + ) VALUES ( + #{id}, #{userID}, #{resourceType}, #{resourceID}, #{taskID}, #{duration}, #{progress}, + #{isComplete}, #{completeTime}, #{lastLearnTime}, #{createTime}, #{updateTime} + ) + + + + + UPDATE tb_learning_record + + + user_id = #{userID}, + + + resource_type = #{resourceType}, + + + resource_id = #{resourceID}, + + + task_id = #{taskID}, + + + duration = #{duration}, + + + progress = #{progress}, + + + is_complete = #{isComplete}, + + + complete_time = #{completeTime}, + + + last_learn_time = #{lastLearnTime}, + + + update_time = #{updateTime}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_learning_record + WHERE id = #{id} + + + + + INSERT INTO tb_learning_record ( + id, user_id, resource_type, resource_id, task_id, duration, progress, + is_complete, complete_time, last_learn_time, create_time, update_time + ) VALUES + + ( + #{item.id}, #{item.userID}, #{item.resourceType}, #{item.resourceID}, #{item.taskID}, + #{item.duration}, #{item.progress}, #{item.isComplete}, #{item.completeTime}, + #{item.lastLearnTime}, #{item.createTime}, #{item.updateTime} + ) + + + + + + DELETE FROM tb_learning_record + WHERE id IN + + #{id} + + + + + + + + + diff --git a/schoolNewsServ/study/src/main/resources/mapper/LearningStatisticsMapper.xml b/schoolNewsServ/study/src/main/resources/mapper/LearningStatisticsMapper.xml index a727274..1ddeb79 100644 --- a/schoolNewsServ/study/src/main/resources/mapper/LearningStatisticsMapper.xml +++ b/schoolNewsServ/study/src/main/resources/mapper/LearningStatisticsMapper.xml @@ -42,4 +42,144 @@ ORDER BY stat_date DESC + + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_learning_statistics ( + id, user_id, stat_date, total_duration, resource_count, course_count, + complete_count, create_time, update_time + ) VALUES ( + #{id}, #{userID}, #{statDate}, #{totalDuration}, #{resourceCount}, #{courseCount}, + #{completeCount}, #{createTime}, #{updateTime} + ) + + + + + UPDATE tb_learning_statistics + + + user_id = #{userID}, + + + stat_date = #{statDate}, + + + total_duration = #{totalDuration}, + + + resource_count = #{resourceCount}, + + + course_count = #{courseCount}, + + + complete_count = #{completeCount}, + + + update_time = #{updateTime}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_learning_statistics + WHERE id = #{id} + + + + + INSERT INTO tb_learning_statistics ( + id, user_id, stat_date, total_duration, resource_count, course_count, + complete_count, create_time, update_time + ) VALUES + + ( + #{item.id}, #{item.userID}, #{item.statDate}, #{item.totalDuration}, + #{item.resourceCount}, #{item.courseCount}, #{item.completeCount}, + #{item.createTime}, #{item.updateTime} + ) + + + + + + DELETE FROM tb_learning_statistics + WHERE id IN + + #{id} + + + + + + + + + diff --git a/schoolNewsServ/study/src/main/resources/mapper/LearningTaskMapper.xml b/schoolNewsServ/study/src/main/resources/mapper/LearningTaskMapper.xml index 0230197..75f16ed 100644 --- a/schoolNewsServ/study/src/main/resources/mapper/LearningTaskMapper.xml +++ b/schoolNewsServ/study/src/main/resources/mapper/LearningTaskMapper.xml @@ -50,4 +50,171 @@ ORDER BY create_time DESC + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_learning_task ( + id, task_id, name, description, start_time, end_time, status, + creator, updater, create_time, update_time, delete_time, deleted + ) VALUES ( + #{id}, #{taskID}, #{name}, #{description}, #{startTime}, #{endTime}, #{status}, + #{creator}, #{updater}, #{createTime}, #{updateTime}, #{deleteTime}, #{deleted} + ) + + + + + UPDATE tb_learning_task + + + task_id = #{taskID}, + + + name = #{name}, + + + description = #{description}, + + + start_time = #{startTime}, + + + end_time = #{endTime}, + + + status = #{status}, + + + updater = #{updater}, + + + update_time = #{updateTime}, + + + delete_time = #{deleteTime}, + + + deleted = #{deleted}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_learning_task + WHERE id = #{id} + + + + + INSERT INTO tb_learning_task ( + id, task_id, name, description, start_time, end_time, status, + creator, updater, create_time, update_time, delete_time, deleted + ) VALUES + + ( + #{item.id}, #{item.taskID}, #{item.name}, #{item.description}, #{item.startTime}, + #{item.endTime}, #{item.status}, #{item.creator}, #{item.updater}, + #{item.createTime}, #{item.updateTime}, #{item.deleteTime}, #{item.deleted} + ) + + + + + + DELETE FROM tb_learning_task + WHERE id IN + + #{id} + + + + + + + + + diff --git a/schoolNewsServ/study/src/main/resources/mapper/TaskCourseMapper.xml b/schoolNewsServ/study/src/main/resources/mapper/TaskCourseMapper.xml index c53e42b..88d8111 100644 --- a/schoolNewsServ/study/src/main/resources/mapper/TaskCourseMapper.xml +++ b/schoolNewsServ/study/src/main/resources/mapper/TaskCourseMapper.xml @@ -42,4 +42,140 @@ ORDER BY order_num ASC, create_time ASC + + + + + + + + + + + + + + + + + + INSERT INTO tb_task_course ( + id, task_id, course_id, required, order_num, creator, create_time + ) VALUES ( + #{id}, #{taskID}, #{courseID}, #{required}, #{orderNum}, #{creator}, #{createTime} + ) + + + + + UPDATE tb_task_course + + + task_id = #{taskID}, + + + course_id = #{courseID}, + + + required = #{required}, + + + order_num = #{orderNum}, + + + creator = #{creator}, + + + create_time = #{createTime}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_task_course + WHERE id = #{id} + + + + + INSERT INTO tb_task_course ( + id, task_id, course_id, required, order_num, creator, create_time + ) VALUES + + ( + #{item.id}, #{item.taskID}, #{item.courseID}, #{item.required}, + #{item.orderNum}, #{item.creator}, #{item.createTime} + ) + + + + + + DELETE FROM tb_task_course + WHERE id IN + + #{id} + + + + + + DELETE FROM tb_task_course + WHERE task_id = #{taskId} + + + + + DELETE FROM tb_task_course + WHERE course_id = #{courseId} + + + + + + + + diff --git a/schoolNewsServ/study/src/main/resources/mapper/TaskResourceMapper.xml b/schoolNewsServ/study/src/main/resources/mapper/TaskResourceMapper.xml index ce0acba..32b71e7 100644 --- a/schoolNewsServ/study/src/main/resources/mapper/TaskResourceMapper.xml +++ b/schoolNewsServ/study/src/main/resources/mapper/TaskResourceMapper.xml @@ -42,4 +42,140 @@ ORDER BY order_num ASC, create_time ASC + + + + + + + + + + + + + + + + + + INSERT INTO tb_task_resource ( + id, task_id, resource_id, required, order_num, creator, create_time + ) VALUES ( + #{id}, #{taskID}, #{resourceID}, #{required}, #{orderNum}, #{creator}, #{createTime} + ) + + + + + UPDATE tb_task_resource + + + task_id = #{taskID}, + + + resource_id = #{resourceID}, + + + required = #{required}, + + + order_num = #{orderNum}, + + + creator = #{creator}, + + + create_time = #{createTime}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_task_resource + WHERE id = #{id} + + + + + INSERT INTO tb_task_resource ( + id, task_id, resource_id, required, order_num, creator, create_time + ) VALUES + + ( + #{item.id}, #{item.taskID}, #{item.resourceID}, #{item.required}, + #{item.orderNum}, #{item.creator}, #{item.createTime} + ) + + + + + + DELETE FROM tb_task_resource + WHERE id IN + + #{id} + + + + + + DELETE FROM tb_task_resource + WHERE task_id = #{taskId} + + + + + DELETE FROM tb_task_resource + WHERE resource_id = #{resourceId} + + + + + + + + diff --git a/schoolNewsServ/study/src/main/resources/mapper/TaskUserMapper.xml b/schoolNewsServ/study/src/main/resources/mapper/TaskUserMapper.xml index 2dda990..e10d048 100644 --- a/schoolNewsServ/study/src/main/resources/mapper/TaskUserMapper.xml +++ b/schoolNewsServ/study/src/main/resources/mapper/TaskUserMapper.xml @@ -49,4 +49,170 @@ ORDER BY create_time DESC + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_task_user ( + id, task_id, user_id, dept_id, status, progress, complete_time, + creator, create_time, update_time + ) VALUES ( + #{id}, #{taskID}, #{userID}, #{deptID}, #{status}, #{progress}, #{completeTime}, + #{creator}, #{createTime}, #{updateTime} + ) + + + + + UPDATE tb_task_user + + + task_id = #{taskID}, + + + user_id = #{userID}, + + + dept_id = #{deptID}, + + + status = #{status}, + + + progress = #{progress}, + + + complete_time = #{completeTime}, + + + creator = #{creator}, + + + create_time = #{createTime}, + + + update_time = #{updateTime}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_task_user + WHERE id = #{id} + + + + + INSERT INTO tb_task_user ( + id, task_id, user_id, dept_id, status, progress, complete_time, + creator, create_time, update_time + ) VALUES + + ( + #{item.id}, #{item.taskID}, #{item.userID}, #{item.deptID}, #{item.status}, + #{item.progress}, #{item.completeTime}, #{item.creator}, #{item.createTime}, #{item.updateTime} + ) + + + + + + DELETE FROM tb_task_user + WHERE id IN + + #{id} + + + + + + DELETE FROM tb_task_user + WHERE task_id = #{taskId} + + + + + DELETE FROM tb_task_user + WHERE user_id = #{userId} + + + + + + + + diff --git a/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/AchievementMapper.java b/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/AchievementMapper.java index 7cd7850..cbc5606 100644 --- a/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/AchievementMapper.java +++ b/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/AchievementMapper.java @@ -2,12 +2,14 @@ package org.xyzh.usercenter.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.usercenter.TbAchievement; import java.util.List; /** - * @description 成就数据访问层 + * @description AchievementMapper.java文件描述 成就数据访问层 * @filename AchievementMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,115 @@ public interface AchievementMapper extends BaseMapper { * @since 2025-10-15 */ List selectAchievements(TbAchievement filter); + + /** + * @description 根据成就ID查询成就信息 + * @param achievementId 成就ID + * @return TbAchievement 成就信息 + * @author yslg + * @since 2025-10-15 + */ + TbAchievement selectByAchievementId(@Param("achievementId") String achievementId); + + /** + * @description 根据类型查询成就列表 + * @param type 成就类型 + * @return List 成就列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByType(@Param("type") Integer type); + + /** + * @description 根据类型和等级查询成就列表 + * @param type 成就类型 + * @param level 成就等级 + * @return List 成就列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByTypeAndLevel(@Param("type") Integer type, @Param("level") Integer level); + + /** + * @description 查询成就排行榜 + * @param limit 限制数量 + * @return List 成就排行榜 + * @author yslg + * @since 2025-10-15 + */ + List selectAchievementRanking(@Param("limit") Integer limit); + + /** + * @description 检查成就名称是否存在 + * @param name 成就名称 + * @param excludeId 排除的成就ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByName(@Param("name") String name, @Param("excludeId") String excludeId); + + /** + * @description 插入成就 + * @param achievement 成就 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertAchievement(TbAchievement achievement); + + /** + * @description 更新成就 + * @param achievement 成就 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateAchievement(TbAchievement achievement); + + /** + * @description 删除成就 + * @param achievement 成就 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteAchievement(TbAchievement achievement); + + /** + * @description 批量插入成就 + * @param achievementList 成就列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertAchievements(@Param("achievementList") List achievementList); + + /** + * @description 批量删除成就 + * @param ids 成就ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteAchievements(@Param("ids") List ids); + + /** + * @description 分页查询成就 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 成就列表 + * @author yslg + * @since 2025-10-15 + */ + List selectAchievementsPage(@Param("filter") TbAchievement filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计成就总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countAchievements(@Param("filter") TbAchievement filter); } diff --git a/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/PointsRecordMapper.java b/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/PointsRecordMapper.java index e87d4f2..3629e58 100644 --- a/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/PointsRecordMapper.java +++ b/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/PointsRecordMapper.java @@ -2,12 +2,14 @@ package org.xyzh.usercenter.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.usercenter.TbPointsRecord; import java.util.List; /** - * @description 积分记录数据访问层 + * @description PointsRecordMapper.java文件描述 积分记录数据访问层 * @filename PointsRecordMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,105 @@ public interface PointsRecordMapper extends BaseMapper { * @since 2025-10-15 */ List selectPointsRecords(TbPointsRecord filter); + + /** + * @description 根据用户ID查询积分记录 + * @param userId 用户ID + * @return List 积分记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByUserId(@Param("userId") String userId); + + /** + * @description 根据用户ID和类型查询积分记录 + * @param userId 用户ID + * @param type 积分类型 + * @return List 积分记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByUserIdAndType(@Param("userId") String userId, @Param("type") Integer type); + + /** + * @description 根据用户ID查询积分记录(包含用户基本信息) + * @param userId 用户ID + * @return List 积分记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectPointsRecordsWithUser(@Param("userId") String userId); + + /** + * @description 查询用户积分统计 + * @param userId 用户ID + * @return TbPointsRecord 积分统计信息 + * @author yslg + * @since 2025-10-15 + */ + TbPointsRecord selectPointsStatistics(@Param("userId") String userId); + + /** + * @description 插入积分记录 + * @param pointsRecord 积分记录 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertPointsRecord(TbPointsRecord pointsRecord); + + /** + * @description 更新积分记录 + * @param pointsRecord 积分记录 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updatePointsRecord(TbPointsRecord pointsRecord); + + /** + * @description 删除积分记录 + * @param pointsRecord 积分记录 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deletePointsRecord(TbPointsRecord pointsRecord); + + /** + * @description 批量插入积分记录 + * @param pointsRecordList 积分记录列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertPointsRecords(@Param("pointsRecordList") List pointsRecordList); + + /** + * @description 批量删除积分记录 + * @param ids 记录ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeletePointsRecords(@Param("ids") List ids); + + /** + * @description 分页查询积分记录 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 积分记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectPointsRecordsPage(@Param("filter") TbPointsRecord filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计积分记录总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countPointsRecords(@Param("filter") TbPointsRecord filter); } diff --git a/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserAchievementMapper.java b/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserAchievementMapper.java index ecd1f2d..1b6bc20 100644 --- a/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserAchievementMapper.java +++ b/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserAchievementMapper.java @@ -2,12 +2,14 @@ package org.xyzh.usercenter.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.usercenter.TbUserAchievement; import java.util.List; /** - * @description 用户成就数据访问层 + * @description UserAchievementMapper.java文件描述 用户成就数据访问层 * @filename UserAchievementMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,105 @@ public interface UserAchievementMapper extends BaseMapper { * @since 2025-10-15 */ List selectUserAchievements(TbUserAchievement filter); + + /** + * @description 根据用户ID查询成就记录 + * @param userId 用户ID + * @return List 成就记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByUserId(@Param("userId") String userId); + + /** + * @description 根据用户ID和成就ID查询成就记录 + * @param userId 用户ID + * @param achievementId 成就ID + * @return List 成就记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByUserIdAndAchievementId(@Param("userId") String userId, @Param("achievementId") String achievementId); + + /** + * @description 根据用户ID查询成就记录(包含用户基本信息) + * @param userId 用户ID + * @return List 成就记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectUserAchievementsWithUser(@Param("userId") String userId); + + /** + * @description 查询用户成就统计 + * @param userId 用户ID + * @return TbUserAchievement 成就统计信息 + * @author yslg + * @since 2025-10-15 + */ + TbUserAchievement selectAchievementStatistics(@Param("userId") String userId); + + /** + * @description 插入用户成就 + * @param userAchievement 用户成就 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertUserAchievement(TbUserAchievement userAchievement); + + /** + * @description 更新用户成就 + * @param userAchievement 用户成就 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateUserAchievement(TbUserAchievement userAchievement); + + /** + * @description 删除用户成就 + * @param userAchievement 用户成就 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteUserAchievement(TbUserAchievement userAchievement); + + /** + * @description 批量插入用户成就 + * @param userAchievementList 用户成就列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertUserAchievements(@Param("userAchievementList") List userAchievementList); + + /** + * @description 批量删除用户成就 + * @param ids 成就ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteUserAchievements(@Param("ids") List ids); + + /** + * @description 分页查询用户成就 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 用户成就列表 + * @author yslg + * @since 2025-10-15 + */ + List selectUserAchievementsPage(@Param("filter") TbUserAchievement filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计用户成就总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countUserAchievements(@Param("filter") TbUserAchievement filter); } diff --git a/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserBrowseRecordMapper.java b/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserBrowseRecordMapper.java index d874845..75f1b9a 100644 --- a/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserBrowseRecordMapper.java +++ b/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserBrowseRecordMapper.java @@ -2,12 +2,14 @@ package org.xyzh.usercenter.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.usercenter.TbUserBrowseRecord; import java.util.List; /** - * @description 用户浏览记录数据访问层 + * @description UserBrowseRecordMapper.java文件描述 用户浏览记录数据访问层 * @filename UserBrowseRecordMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,105 @@ public interface UserBrowseRecordMapper extends BaseMapper { * @since 2025-10-15 */ List selectUserBrowseRecords(TbUserBrowseRecord filter); + + /** + * @description 根据用户ID查询浏览记录 + * @param userId 用户ID + * @return List 浏览记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByUserId(@Param("userId") String userId); + + /** + * @description 根据用户ID和类型查询浏览记录 + * @param userId 用户ID + * @param browseType 浏览类型 + * @return List 浏览记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByUserIdAndType(@Param("userId") String userId, @Param("browseType") Integer browseType); + + /** + * @description 根据用户ID查询浏览记录(包含用户基本信息) + * @param userId 用户ID + * @return List 浏览记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectUserBrowseRecordsWithUser(@Param("userId") String userId); + + /** + * @description 查询用户浏览统计 + * @param userId 用户ID + * @return TbUserBrowseRecord 浏览统计信息 + * @author yslg + * @since 2025-10-15 + */ + TbUserBrowseRecord selectBrowseStatistics(@Param("userId") String userId); + + /** + * @description 插入用户浏览记录 + * @param userBrowseRecord 用户浏览记录 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertUserBrowseRecord(TbUserBrowseRecord userBrowseRecord); + + /** + * @description 更新用户浏览记录 + * @param userBrowseRecord 用户浏览记录 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateUserBrowseRecord(TbUserBrowseRecord userBrowseRecord); + + /** + * @description 删除用户浏览记录 + * @param userBrowseRecord 用户浏览记录 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteUserBrowseRecord(TbUserBrowseRecord userBrowseRecord); + + /** + * @description 批量插入用户浏览记录 + * @param userBrowseRecordList 用户浏览记录列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertUserBrowseRecords(@Param("userBrowseRecordList") List userBrowseRecordList); + + /** + * @description 批量删除用户浏览记录 + * @param ids 记录ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteUserBrowseRecords(@Param("ids") List ids); + + /** + * @description 分页查询用户浏览记录 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 用户浏览记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectUserBrowseRecordsPage(@Param("filter") TbUserBrowseRecord filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计用户浏览记录总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countUserBrowseRecords(@Param("filter") TbUserBrowseRecord filter); } diff --git a/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserCollectionMapper.java b/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserCollectionMapper.java index 3ea93be..ac69307 100644 --- a/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserCollectionMapper.java +++ b/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserCollectionMapper.java @@ -2,12 +2,14 @@ package org.xyzh.usercenter.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.usercenter.TbUserCollection; import java.util.List; /** - * @description 用户收藏数据访问层 + * @description UserCollectionMapper.java文件描述 用户收藏数据访问层 * @filename UserCollectionMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,105 @@ public interface UserCollectionMapper extends BaseMapper { * @since 2025-10-15 */ List selectUserCollections(TbUserCollection filter); + + /** + * @description 根据用户ID查询收藏记录 + * @param userId 用户ID + * @return List 收藏记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByUserId(@Param("userId") String userId); + + /** + * @description 根据用户ID和类型查询收藏记录 + * @param userId 用户ID + * @param collectionType 收藏类型 + * @return List 收藏记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectByUserIdAndType(@Param("userId") String userId, @Param("collectionType") Integer collectionType); + + /** + * @description 根据用户ID查询收藏记录(包含用户基本信息) + * @param userId 用户ID + * @return List 收藏记录列表 + * @author yslg + * @since 2025-10-15 + */ + List selectUserCollectionsWithUser(@Param("userId") String userId); + + /** + * @description 查询用户收藏统计 + * @param userId 用户ID + * @return TbUserCollection 收藏统计信息 + * @author yslg + * @since 2025-10-15 + */ + TbUserCollection selectCollectionStatistics(@Param("userId") String userId); + + /** + * @description 插入用户收藏 + * @param userCollection 用户收藏 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertUserCollection(TbUserCollection userCollection); + + /** + * @description 更新用户收藏 + * @param userCollection 用户收藏 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateUserCollection(TbUserCollection userCollection); + + /** + * @description 删除用户收藏 + * @param userCollection 用户收藏 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteUserCollection(TbUserCollection userCollection); + + /** + * @description 批量插入用户收藏 + * @param userCollectionList 用户收藏列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertUserCollections(@Param("userCollectionList") List userCollectionList); + + /** + * @description 批量删除用户收藏 + * @param ids 收藏ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteUserCollections(@Param("ids") List ids); + + /** + * @description 分页查询用户收藏 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 用户收藏列表 + * @author yslg + * @since 2025-10-15 + */ + List selectUserCollectionsPage(@Param("filter") TbUserCollection filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计用户收藏总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countUserCollections(@Param("filter") TbUserCollection filter); } diff --git a/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserPointsMapper.java b/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserPointsMapper.java index 3577c6c..299728f 100644 --- a/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserPointsMapper.java +++ b/schoolNewsServ/usercenter/src/main/java/org/xyzh/usercenter/mapper/UserPointsMapper.java @@ -2,12 +2,14 @@ package org.xyzh.usercenter.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.xyzh.common.core.page.PageParam; import org.xyzh.common.dto.usercenter.TbUserPoints; import java.util.List; /** - * @description 用户积分数据访问层 + * @description UserPointsMapper.java文件描述 用户积分数据访问层 * @filename UserPointsMapper.java * @author yslg * @copyright xyzh @@ -24,4 +26,105 @@ public interface UserPointsMapper extends BaseMapper { * @since 2025-10-15 */ List selectUserPoints(TbUserPoints filter); -} + + /** + * @description 根据用户ID查询积分信息 + * @param userId 用户ID + * @return TbUserPoints 用户积分信息 + * @author yslg + * @since 2025-10-15 + */ + TbUserPoints selectByUserId(@Param("userId") String userId); + + /** + * @description 检查用户积分是否存在 + * @param userId 用户ID + * @param excludeId 排除的积分ID(用于更新时排除自身) + * @return int 存在的数量 + * @author yslg + * @since 2025-10-15 + */ + int countByUserId(@Param("userId") String userId, @Param("excludeId") String excludeId); + + /** + * @description 根据用户ID查询积分信息(包含用户基本信息) + * @param userId 用户ID + * @return TbUserPoints 用户积分信息 + * @author yslg + * @since 2025-10-15 + */ + TbUserPoints selectUserPointsWithUser(@Param("userId") String userId); + + /** + * @description 查询积分排行榜 + * @param limit 限制数量 + * @return List 积分排行榜 + * @author yslg + * @since 2025-10-15 + */ + List selectPointsRanking(@Param("limit") Integer limit); + + /** + * @description 插入用户积分 + * @param userPoints 用户积分 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int insertUserPoints(TbUserPoints userPoints); + + /** + * @description 更新用户积分 + * @param userPoints 用户积分 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int updateUserPoints(TbUserPoints userPoints); + + /** + * @description 删除用户积分 + * @param userPoints 用户积分 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int deleteUserPoints(TbUserPoints userPoints); + + /** + * @description 批量插入用户积分 + * @param userPointsList 用户积分列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchInsertUserPoints(@Param("userPointsList") List userPointsList); + + /** + * @description 批量删除用户积分 + * @param ids 积分ID列表 + * @return int 影响行数 + * @author yslg + * @since 2025-10-15 + */ + int batchDeleteUserPoints(@Param("ids") List ids); + + /** + * @description 分页查询用户积分 + * @param filter 过滤条件 + * @param pageParam 分页参数 + * @return List 用户积分列表 + * @author yslg + * @since 2025-10-15 + */ + List selectUserPointsPage(@Param("filter") TbUserPoints filter, @Param("pageParam") PageParam pageParam); + + /** + * @description 统计用户积分总数 + * @param filter 过滤条件 + * @return long 总数 + * @author yslg + * @since 2025-10-15 + */ + long countUserPoints(@Param("filter") TbUserPoints filter); +} \ No newline at end of file diff --git a/schoolNewsServ/usercenter/src/main/resources/mapper/AchievementMapper.xml b/schoolNewsServ/usercenter/src/main/resources/mapper/AchievementMapper.xml index 453a905..1a3198f 100644 --- a/schoolNewsServ/usercenter/src/main/resources/mapper/AchievementMapper.xml +++ b/schoolNewsServ/usercenter/src/main/resources/mapper/AchievementMapper.xml @@ -2,63 +2,462 @@ - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + id, achievement_id, name, description, icon, type, level, condition_type, - condition_value, points, order_num, creator, updater, create_time, - update_time, delete_time, deleted + condition_value, points, order_num, creator, updater, create_time, update_time, + delete_time, deleted - - + + - deleted = 0 - - AND achievement_id = #{achievementID} - - - AND name LIKE CONCAT('%', #{name}, '%') - - - AND type = #{type} - - - AND level = #{level} - - - AND condition_type = #{conditionType} + + + AND id = #{filter.id} + + + AND achievement_id = #{filter.achievementId} + + + AND name LIKE CONCAT('%', #{filter.name}, '%') + + + AND type = #{filter.type} + + + AND level = #{filter.level} + + + AND condition_type = #{filter.conditionType} + + + AND points = #{filter.points} + + + AND creator = #{filter.creator} + + + AND deleted = #{filter.deleted} + + + AND create_time = #{filter.createTime} + + + AND update_time = #{filter.updateTime} + - - + SELECT + FROM tb_achievement - - ORDER BY order_num ASC, create_time ASC + WHERE id = #{id} - + + + + + + + + + + + + + + + + + + INSERT INTO tb_achievement ( + id, achievement_id, name, description, icon, type, level, condition_type, + condition_value, points, order_num, creator, updater, create_time, update_time, + delete_time, deleted + ) VALUES ( + #{entity.id}, #{entity.achievementId}, #{entity.name}, #{entity.description}, #{entity.icon}, + #{entity.type}, #{entity.level}, #{entity.conditionType}, #{entity.conditionValue}, + #{entity.points}, #{entity.orderNum}, #{entity.creator}, #{entity.updater}, + #{entity.createTime}, #{entity.updateTime}, #{entity.deleteTime}, #{entity.deleted} + ) + + + + + INSERT INTO tb_achievement ( + id, achievement_id, name, description, icon, type, level, condition_type, + condition_value, points, order_num, creator, updater, create_time, update_time, + delete_time, deleted + ) VALUES + + ( + #{entity.id}, #{entity.achievementId}, #{entity.name}, #{entity.description}, #{entity.icon}, + #{entity.type}, #{entity.level}, #{entity.conditionType}, #{entity.conditionValue}, + #{entity.points}, #{entity.orderNum}, #{entity.creator}, #{entity.updater}, + #{entity.createTime}, #{entity.updateTime}, #{entity.deleteTime}, #{entity.deleted} + ) + + + + + + UPDATE tb_achievement + + + achievement_id = #{entity.achievementId}, + + + name = #{entity.name}, + + + description = #{entity.description}, + + + icon = #{entity.icon}, + + + type = #{entity.type}, + + + level = #{entity.level}, + + + condition_type = #{entity.conditionType}, + + + condition_value = #{entity.conditionValue}, + + + points = #{entity.points}, + + + order_num = #{entity.orderNum}, + + + creator = #{entity.creator}, + + + updater = #{entity.updater}, + + + update_time = #{entity.updateTime}, + + + delete_time = #{entity.deleteTime}, + + + deleted = #{entity.deleted}, + + + WHERE id = #{entity.id} + + + + + UPDATE tb_achievement + + + achievement_id = #{entity.achievementId}, + + + name = #{entity.name}, + + + description = #{entity.description}, + + + icon = #{entity.icon}, + + + type = #{entity.type}, + + + level = #{entity.level}, + + + condition_type = #{entity.conditionType}, + + + condition_value = #{entity.conditionValue}, + + + points = #{entity.points}, + + + order_num = #{entity.orderNum}, + + + creator = #{entity.creator}, + + + updater = #{entity.updater}, + + + update_time = #{entity.updateTime}, + + + delete_time = #{entity.deleteTime}, + + + deleted = #{entity.deleted}, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_achievement ( + id, achievement_id, name, description, icon, type, level, condition_type, + condition_value, points, order_num, creator, updater, create_time, update_time, + delete_time, deleted + ) VALUES ( + #{id}, #{achievementId}, #{name}, #{description}, #{icon}, #{type}, #{level}, + #{conditionType}, #{conditionValue}, #{points}, #{orderNum}, #{creator}, #{updater}, + #{createTime}, #{updateTime}, #{deleteTime}, #{deleted} + ) + + + + + UPDATE tb_achievement + + + achievement_id = #{achievementId}, + + + name = #{name}, + + + description = #{description}, + + + icon = #{icon}, + + + type = #{type}, + + + level = #{level}, + + + condition_type = #{conditionType}, + + + condition_value = #{conditionValue}, + + + points = #{points}, + + + order_num = #{orderNum}, + + + creator = #{creator}, + + + updater = #{updater}, + + + update_time = #{updateTime}, + + + delete_time = #{deleteTime}, + + + deleted = #{deleted}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_achievement + WHERE id = #{id} + + + + + INSERT INTO tb_achievement ( + id, achievement_id, name, description, icon, type, level, condition_type, + condition_value, points, order_num, creator, updater, create_time, update_time, + delete_time, deleted + ) VALUES + + ( + #{item.id}, #{item.achievementId}, #{item.name}, #{item.description}, #{item.icon}, + #{item.type}, #{item.level}, #{item.conditionType}, #{item.conditionValue}, + #{item.points}, #{item.orderNum}, #{item.creator}, #{item.updater}, + #{item.createTime}, #{item.updateTime}, #{item.deleteTime}, #{item.deleted} + ) + + + + + + DELETE FROM tb_achievement + WHERE id IN + + #{id} + + + + + + + + + + \ No newline at end of file diff --git a/schoolNewsServ/usercenter/src/main/resources/mapper/PointsRecordMapper.xml b/schoolNewsServ/usercenter/src/main/resources/mapper/PointsRecordMapper.xml index 48eb67d..8b8d823 100644 --- a/schoolNewsServ/usercenter/src/main/resources/mapper/PointsRecordMapper.xml +++ b/schoolNewsServ/usercenter/src/main/resources/mapper/PointsRecordMapper.xml @@ -2,48 +2,339 @@ - + - - - - - - - - + + + + + + + + - + id, user_id, points, type, source_type, source_id, description, create_time - - + + - - AND user_id = #{userID} - - - AND type = #{type} - - - AND source_type = #{sourceType} - - - AND source_id = #{sourceID} + + + AND id = #{filter.id} + + + AND user_id = #{filter.userId} + + + AND points = #{filter.points} + + + AND type = #{filter.type} + + + AND source_type = #{filter.sourceType} + + + AND source_id = #{filter.sourceId} + + + AND description LIKE CONCAT('%', #{filter.description}, '%') + + + AND create_time = #{filter.createTime} + - - + SELECT + FROM tb_points_record - + WHERE id = #{id} + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_points_record ( + id, user_id, points, type, source_type, source_id, description, create_time + ) VALUES ( + #{entity.id}, #{entity.userId}, #{entity.points}, #{entity.type}, + #{entity.sourceType}, #{entity.sourceId}, #{entity.description}, #{entity.createTime} + ) + + + + + INSERT INTO tb_points_record ( + id, user_id, points, type, source_type, source_id, description, create_time + ) VALUES + + ( + #{entity.id}, #{entity.userId}, #{entity.points}, #{entity.type}, + #{entity.sourceType}, #{entity.sourceId}, #{entity.description}, #{entity.createTime} + ) + + + + + + UPDATE tb_points_record + + + user_id = #{entity.userId}, + + + points = #{entity.points}, + + + type = #{entity.type}, + + + source_type = #{entity.sourceType}, + + + source_id = #{entity.sourceId}, + + + description = #{entity.description}, + + + WHERE id = #{entity.id} + + + + + UPDATE tb_points_record + + + user_id = #{entity.userId}, + + + points = #{entity.points}, + + + type = #{entity.type}, + + + source_type = #{entity.sourceType}, + + + source_id = #{entity.sourceId}, + + + description = #{entity.description}, + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + INSERT INTO tb_points_record ( + id, user_id, points, type, source_type, source_id, description, create_time + ) VALUES ( + #{id}, #{userId}, #{points}, #{type}, #{sourceType}, #{sourceId}, + #{description}, #{createTime} + ) + + + + + UPDATE tb_points_record + + + user_id = #{userId}, + + + points = #{points}, + + + type = #{type}, + + + source_type = #{sourceType}, + + + source_id = #{sourceId}, + + + description = #{description}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_points_record + WHERE id = #{id} + + + + + INSERT INTO tb_points_record ( + id, user_id, points, type, source_type, source_id, description, create_time + ) VALUES + + ( + #{item.id}, #{item.userId}, #{item.points}, #{item.type}, + #{item.sourceType}, #{item.sourceId}, #{item.description}, #{item.createTime} + ) + + + + + + DELETE FROM tb_points_record + WHERE id IN + + #{id} + + + + + + + + + + \ No newline at end of file diff --git a/schoolNewsServ/usercenter/src/main/resources/mapper/UserAchievementMapper.xml b/schoolNewsServ/usercenter/src/main/resources/mapper/UserAchievementMapper.xml index 3852da1..3a10153 100644 --- a/schoolNewsServ/usercenter/src/main/resources/mapper/UserAchievementMapper.xml +++ b/schoolNewsServ/usercenter/src/main/resources/mapper/UserAchievementMapper.xml @@ -2,38 +2,290 @@ - + - - - - + + + + - + id, user_id, achievement_id, obtain_time - - + + - - AND user_id = #{userID} - - - AND achievement_id = #{achievementID} + + + AND id = #{filter.id} + + + AND user_id = #{filter.userId} + + + AND achievement_id = #{filter.achievementId} + + + AND obtain_time = #{filter.obtainTime} + - - + SELECT + FROM tb_user_achievement - + WHERE id = #{id} + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_user_achievement ( + id, user_id, achievement_id, obtain_time + ) VALUES ( + #{entity.id}, #{entity.userId}, #{entity.achievementId}, #{entity.obtainTime} + ) + + + + + INSERT INTO tb_user_achievement ( + id, user_id, achievement_id, obtain_time + ) VALUES + + ( + #{entity.id}, #{entity.userId}, #{entity.achievementId}, #{entity.obtainTime} + ) + + + + + + UPDATE tb_user_achievement + + + user_id = #{entity.userId}, + + + achievement_id = #{entity.achievementId}, + + + obtain_time = #{entity.obtainTime}, + + + WHERE id = #{entity.id} + + + + + UPDATE tb_user_achievement + + + user_id = #{entity.userId}, + + + achievement_id = #{entity.achievementId}, + + + obtain_time = #{entity.obtainTime}, + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + INSERT INTO tb_user_achievement ( + id, user_id, achievement_id, obtain_time + ) VALUES ( + #{id}, #{userId}, #{achievementId}, #{obtainTime} + ) + + + + + UPDATE tb_user_achievement + + + user_id = #{userId}, + + + achievement_id = #{achievementId}, + + + obtain_time = #{obtainTime}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_user_achievement + WHERE id = #{id} + + + + + INSERT INTO tb_user_achievement ( + id, user_id, achievement_id, obtain_time + ) VALUES + + ( + #{item.id}, #{item.userId}, #{item.achievementId}, #{item.obtainTime} + ) + + + + + + DELETE FROM tb_user_achievement + WHERE id IN + + #{id} + + + + + + + + + + \ No newline at end of file diff --git a/schoolNewsServ/usercenter/src/main/resources/mapper/UserBrowseRecordMapper.xml b/schoolNewsServ/usercenter/src/main/resources/mapper/UserBrowseRecordMapper.xml index c3a8a69..4546037 100644 --- a/schoolNewsServ/usercenter/src/main/resources/mapper/UserBrowseRecordMapper.xml +++ b/schoolNewsServ/usercenter/src/main/resources/mapper/UserBrowseRecordMapper.xml @@ -2,46 +2,319 @@ - + - - - - - - + + + + + + - + id, user_id, browse_type, browse_id, browse_time, ip_address - - + + - - AND user_id = #{userID} - - - AND browse_type = #{browseType} - - - AND browse_id = #{browseID} - - - AND ip_address = #{ipAddress} + + + AND id = #{filter.id} + + + AND user_id = #{filter.userId} + + + AND browse_type = #{filter.browseType} + + + AND browse_id = #{filter.browseId} + + + AND ip_address = #{filter.ipAddress} + + + AND browse_time = #{filter.browseTime} + - - + SELECT + FROM tb_user_browse_record - + WHERE id = #{id} + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_user_browse_record ( + id, user_id, browse_type, browse_id, browse_time, ip_address + ) VALUES ( + #{entity.id}, #{entity.userId}, #{entity.browseType}, #{entity.browseId}, + #{entity.browseTime}, #{entity.ipAddress} + ) + + + + + INSERT INTO tb_user_browse_record ( + id, user_id, browse_type, browse_id, browse_time, ip_address + ) VALUES + + ( + #{entity.id}, #{entity.userId}, #{entity.browseType}, #{entity.browseId}, + #{entity.browseTime}, #{entity.ipAddress} + ) + + + + + + UPDATE tb_user_browse_record + + + user_id = #{entity.userId}, + + + browse_type = #{entity.browseType}, + + + browse_id = #{entity.browseId}, + + + browse_time = #{entity.browseTime}, + + + ip_address = #{entity.ipAddress}, + + + WHERE id = #{entity.id} + + + + + UPDATE tb_user_browse_record + + + user_id = #{entity.userId}, + + + browse_type = #{entity.browseType}, + + + browse_id = #{entity.browseId}, + + + browse_time = #{entity.browseTime}, + + + ip_address = #{entity.ipAddress}, + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + INSERT INTO tb_user_browse_record ( + id, user_id, browse_type, browse_id, browse_time, ip_address + ) VALUES ( + #{id}, #{userId}, #{browseType}, #{browseId}, #{browseTime}, #{ipAddress} + ) + + + + + UPDATE tb_user_browse_record + + + user_id = #{userId}, + + + browse_type = #{browseType}, + + + browse_id = #{browseId}, + + + browse_time = #{browseTime}, + + + ip_address = #{ipAddress}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_user_browse_record + WHERE id = #{id} + + + + + INSERT INTO tb_user_browse_record ( + id, user_id, browse_type, browse_id, browse_time, ip_address + ) VALUES + + ( + #{item.id}, #{item.userId}, #{item.browseType}, #{item.browseId}, + #{item.browseTime}, #{item.ipAddress} + ) + + + + + + DELETE FROM tb_user_browse_record + WHERE id IN + + #{id} + + + + + + + + + + \ No newline at end of file diff --git a/schoolNewsServ/usercenter/src/main/resources/mapper/UserCollectionMapper.xml b/schoolNewsServ/usercenter/src/main/resources/mapper/UserCollectionMapper.xml index fbf0100..e644c54 100644 --- a/schoolNewsServ/usercenter/src/main/resources/mapper/UserCollectionMapper.xml +++ b/schoolNewsServ/usercenter/src/main/resources/mapper/UserCollectionMapper.xml @@ -2,42 +2,294 @@ - + - - - - - + + + + + - + id, user_id, collection_type, collection_id, create_time - - + + - - AND user_id = #{userID} - - - AND collection_type = #{collectionType} - - - AND collection_id = #{collectionID} + + + AND id = #{filter.id} + + + AND user_id = #{filter.userId} + + + AND collection_type = #{filter.collectionType} + + + AND collection_id = #{filter.collectionId} + + + AND create_time = #{filter.createTime} + - - + SELECT + FROM tb_user_collection - + WHERE id = #{id} + + + + + + + + + + + + + + + + + + + + INSERT INTO tb_user_collection ( + id, user_id, collection_type, collection_id, create_time + ) VALUES ( + #{entity.id}, #{entity.userId}, #{entity.collectionType}, #{entity.collectionId}, #{entity.createTime} + ) + + + + + INSERT INTO tb_user_collection ( + id, user_id, collection_type, collection_id, create_time + ) VALUES + + ( + #{entity.id}, #{entity.userId}, #{entity.collectionType}, #{entity.collectionId}, #{entity.createTime} + ) + + + + + + UPDATE tb_user_collection + + + user_id = #{entity.userId}, + + + collection_type = #{entity.collectionType}, + + + collection_id = #{entity.collectionId}, + + + WHERE id = #{entity.id} + + + + + UPDATE tb_user_collection + + + user_id = #{entity.userId}, + + + collection_type = #{entity.collectionType}, + + + collection_id = #{entity.collectionId}, + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + INSERT INTO tb_user_collection ( + id, user_id, collection_type, collection_id, create_time + ) VALUES ( + #{id}, #{userId}, #{collectionType}, #{collectionId}, #{createTime} + ) + + + + + UPDATE tb_user_collection + + + user_id = #{userId}, + + + collection_type = #{collectionType}, + + + collection_id = #{collectionId}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_user_collection + WHERE id = #{id} + + + + + INSERT INTO tb_user_collection ( + id, user_id, collection_type, collection_id, create_time + ) VALUES + + ( + #{item.id}, #{item.userId}, #{item.collectionType}, #{item.collectionId}, #{item.createTime} + ) + + + + + + DELETE FROM tb_user_collection + WHERE id IN + + #{id} + + + + + + + + + + \ No newline at end of file diff --git a/schoolNewsServ/usercenter/src/main/resources/mapper/UserPointsMapper.xml b/schoolNewsServ/usercenter/src/main/resources/mapper/UserPointsMapper.xml index a305bfe..903db5b 100644 --- a/schoolNewsServ/usercenter/src/main/resources/mapper/UserPointsMapper.xml +++ b/schoolNewsServ/usercenter/src/main/resources/mapper/UserPointsMapper.xml @@ -2,41 +2,168 @@ - + - - - - - - - + + + + + + + - + id, user_id, total_points, current_points, level, create_time, update_time - - + + - - AND user_id = #{userID} - - - AND level = #{level} + + + AND id = #{filter.id} + + + AND user_id = #{filter.userId} + + + AND total_points = #{filter.totalPoints} + + + AND current_points = #{filter.currentPoints} + + + AND level = #{filter.level} + - + - + + + + + + + + + + + + + + + INSERT INTO tb_user_points ( + id, user_id, total_points, current_points, level, create_time, update_time + ) VALUES ( + #{id}, #{userId}, #{totalPoints}, #{currentPoints}, + #{level}, #{createTime}, #{updateTime} + ) + + + + + UPDATE tb_user_points + + + user_id = #{userId}, + + + total_points = #{totalPoints}, + + + current_points = #{currentPoints}, + + + level = #{level}, + + + update_time = #{updateTime}, + + + WHERE id = #{id} + + + + + DELETE FROM tb_user_points + WHERE id = #{id} + + + + + INSERT INTO tb_user_points ( + id, user_id, total_points, current_points, level, create_time, update_time + ) VALUES + + ( + #{item.id}, #{item.userId}, #{item.totalPoints}, #{item.currentPoints}, + #{item.level}, #{item.createTime}, #{item.updateTime} + ) + + + + + + DELETE FROM tb_user_points + WHERE id IN + + #{id} + + + + + + + + + + \ No newline at end of file