chore(sync): 同步当前工作区全部变更(学员学号可编辑并留空自动生成等)

This commit is contained in:
buliping committed 2026-11-10 13:34:14 +08:00
1 parent 01e949093a
commit ee629f2f3e
534 files changed
+72978 -2720

No files matched your search

+51
View File
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.9.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-device</artifactId>
<description>
设备模块
</description>
<dependencies>
<!-- MyBatis持久层 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<!-- 单元测试 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.21</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>26.0.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,72 @@
package com.ruoyi.device.domain;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonInclude;
/**
* 设备模块本地基础实体。
* 原 RuoYi 约定继承 com.ruoyi.common.core.domain.BaseEntity,
* 但 device 作为后接入模块在 IDE 中常出现 ruoyi-common 依赖无法解析的问题,
* 故在此提供等价本地基类,使本模块可脱离 ruoyi-common 独立编译。
* createTime/updateTime/remark/params 与 BaseEntity 保持一致,Mapper 映射、数据权限、时间范围查询均不受影响。
*
* @author ruoyi
*/
public class BaseDomain
{
private Date createTime;
private Date updateTime;
private String remark;
/** 请求参数 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private Map<String, Object> params;
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 String getRemark()
{
return remark;
}
public void setRemark(String remark)
{
this.remark = remark;
}
public Map<String, Object> getParams()
{
if (params == null)
{
params = new HashMap<>();
}
return params;
}
public void setParams(Map<String, Object> params)
{
this.params = params;
}
}
@@ -0,0 +1,179 @@
package com.ruoyi.device.domain;
import java.util.Date;
import com.ruoyi.device.domain.BaseDomain;
import com.ruoyi.device.util.ToStringBuilder;
import com.ruoyi.device.util.ToStringStyle;
/**
* 图书快照对象 train_book_snapshot
*
* @author ruoyi
* @date 2026-10-20
*/
public class TrainBookSnapshot extends BaseDomain
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 图书永久ID,永不复用 */
private String bookId;
/** 书名 */
private String bookTitle;
/** SAFETY专业/REGULATION规章等 */
private String bookCategory;
/** 简介 */
private String bookSummary;
/** 版本BV‑xx,递增 */
private String bookVersion;
/** 文件字节大小 */
private Long fileSize;
/** 文件MD5校验 */
private String fileMd5;
/** 原始文件地址 */
private String downloadUrl;
/** 1上架;0下架禁止新下载,可上报阅读 */
private Integer isOnShelf;
/** 版本发布时间 */
private Date publishTime;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setBookId(String bookId)
{
this.bookId = bookId;
}
public String getBookId()
{
return bookId;
}
public void setBookTitle(String bookTitle)
{
this.bookTitle = bookTitle;
}
public String getBookTitle()
{
return bookTitle;
}
public void setBookCategory(String bookCategory)
{
this.bookCategory = bookCategory;
}
public String getBookCategory()
{
return bookCategory;
}
public void setBookSummary(String bookSummary)
{
this.bookSummary = bookSummary;
}
public String getBookSummary()
{
return bookSummary;
}
public void setBookVersion(String bookVersion)
{
this.bookVersion = bookVersion;
}
public String getBookVersion()
{
return bookVersion;
}
public void setFileSize(Long fileSize)
{
this.fileSize = fileSize;
}
public Long getFileSize()
{
return fileSize;
}
public void setFileMd5(String fileMd5)
{
this.fileMd5 = fileMd5;
}
public String getFileMd5()
{
return fileMd5;
}
public void setDownloadUrl(String downloadUrl)
{
this.downloadUrl = downloadUrl;
}
public String getDownloadUrl()
{
return downloadUrl;
}
public void setIsOnShelf(Integer isOnShelf)
{
this.isOnShelf = isOnShelf;
}
public Integer getIsOnShelf()
{
return isOnShelf;
}
public void setPublishTime(Date publishTime)
{
this.publishTime = publishTime;
}
public Date getPublishTime()
{
return publishTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("bookId", getBookId())
.append("bookTitle", getBookTitle())
.append("bookCategory", getBookCategory())
.append("bookSummary", getBookSummary())
.append("bookVersion", getBookVersion())
.append("fileSize", getFileSize())
.append("fileMd5", getFileMd5())
.append("downloadUrl", getDownloadUrl())
.append("isOnShelf", getIsOnShelf())
.append("publishTime", getPublishTime())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}
@@ -0,0 +1,179 @@
package com.ruoyi.device.domain;
import java.util.Date;
import com.ruoyi.device.domain.BaseDomain;
import com.ruoyi.device.util.ToStringBuilder;
import com.ruoyi.device.util.ToStringStyle;
/**
* 读书机设备档案对象 train_iot_device
*
* @author ruoyi
* @date 2026-10-20
*/
public class TrainIotDevice extends BaseDomain
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 读书机设备唯一编码deviceId */
private String deviceId;
/** deviceSecret SHA256摘要,不存明文 */
private String deviceSecretDigest;
/** 1正常 2禁用 3恢复出厂 */
private Integer deviceStatus;
/** 固件版本 */
private String firmwareVersion;
/** APP版本 */
private String appVersion;
/** 绑定机构 */
private String bindOrgId;
/** 绑定班级,多班级逗号分隔 */
private String bindClassId;
/** 心跳周期秒 */
private Integer heartbeatInterval;
/** 最后登录时间 */
private Date lastLoginTime;
/** 最后心跳时间 */
private Date lastHeartbeatTime;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setDeviceId(String deviceId)
{
this.deviceId = deviceId;
}
public String getDeviceId()
{
return deviceId;
}
public void setDeviceSecretDigest(String deviceSecretDigest)
{
this.deviceSecretDigest = deviceSecretDigest;
}
public String getDeviceSecretDigest()
{
return deviceSecretDigest;
}
public void setDeviceStatus(Integer deviceStatus)
{
this.deviceStatus = deviceStatus;
}
public Integer getDeviceStatus()
{
return deviceStatus;
}
public void setFirmwareVersion(String firmwareVersion)
{
this.firmwareVersion = firmwareVersion;
}
public String getFirmwareVersion()
{
return firmwareVersion;
}
public void setAppVersion(String appVersion)
{
this.appVersion = appVersion;
}
public String getAppVersion()
{
return appVersion;
}
public void setBindOrgId(String bindOrgId)
{
this.bindOrgId = bindOrgId;
}
public String getBindOrgId()
{
return bindOrgId;
}
public void setBindClassId(String bindClassId)
{
this.bindClassId = bindClassId;
}
public String getBindClassId()
{
return bindClassId;
}
public void setHeartbeatInterval(Integer heartbeatInterval)
{
this.heartbeatInterval = heartbeatInterval;
}
public Integer getHeartbeatInterval()
{
return heartbeatInterval;
}
public void setLastLoginTime(Date lastLoginTime)
{
this.lastLoginTime = lastLoginTime;
}
public Date getLastLoginTime()
{
return lastLoginTime;
}
public void setLastHeartbeatTime(Date lastHeartbeatTime)
{
this.lastHeartbeatTime = lastHeartbeatTime;
}
public Date getLastHeartbeatTime()
{
return lastHeartbeatTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("deviceId", getDeviceId())
.append("deviceSecretDigest", getDeviceSecretDigest())
.append("deviceStatus", getDeviceStatus())
.append("firmwareVersion", getFirmwareVersion())
.append("appVersion", getAppVersion())
.append("bindOrgId", getBindOrgId())
.append("bindClassId", getBindClassId())
.append("heartbeatInterval", getHeartbeatInterval())
.append("lastLoginTime", getLastLoginTime())
.append("lastHeartbeatTime", getLastHeartbeatTime())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}
@@ -0,0 +1,164 @@
package com.ruoyi.device.domain;
import java.math.BigDecimal;
import com.ruoyi.device.domain.BaseDomain;
import com.ruoyi.device.util.ToStringBuilder;
import com.ruoyi.device.util.ToStringStyle;
/**
* 备选冲突续读进度对象 train_reading_alternate_progress
*
* @author ruoyi
* @date 2026-10-20
*/
public class TrainReadingAlternateProgress extends BaseDomain
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 学员sys_user.userId */
private Long userId;
/** 图书永久ID */
private String bookId;
/** read / audio */
private String mode;
/** 进度绑定版本 */
private String bookVersion;
/** 当前页 */
private Integer pageNo;
/** TTS句子索引 */
private Integer sentenceIndex;
/** 0‑1进度 */
private BigDecimal progress;
/** 来源上报recordId */
private String sourceRecordId;
/** 来源sessionId */
private String sourceSessionId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setBookId(String bookId)
{
this.bookId = bookId;
}
public String getBookId()
{
return bookId;
}
public void setMode(String mode)
{
this.mode = mode;
}
public String getMode()
{
return mode;
}
public void setBookVersion(String bookVersion)
{
this.bookVersion = bookVersion;
}
public String getBookVersion()
{
return bookVersion;
}
public void setPageNo(Integer pageNo)
{
this.pageNo = pageNo;
}
public Integer getPageNo()
{
return pageNo;
}
public void setSentenceIndex(Integer sentenceIndex)
{
this.sentenceIndex = sentenceIndex;
}
public Integer getSentenceIndex()
{
return sentenceIndex;
}
public void setProgress(BigDecimal progress)
{
this.progress = progress;
}
public BigDecimal getProgress()
{
return progress;
}
public void setSourceRecordId(String sourceRecordId)
{
this.sourceRecordId = sourceRecordId;
}
public String getSourceRecordId()
{
return sourceRecordId;
}
public void setSourceSessionId(String sourceSessionId)
{
this.sourceSessionId = sourceSessionId;
}
public String getSourceSessionId()
{
return sourceSessionId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userId", getUserId())
.append("bookId", getBookId())
.append("mode", getMode())
.append("bookVersion", getBookVersion())
.append("pageNo", getPageNo())
.append("sentenceIndex", getSentenceIndex())
.append("progress", getProgress())
.append("sourceRecordId", getSourceRecordId())
.append("sourceSessionId", getSourceSessionId())
.append("createTime", getCreateTime())
.toString();
}
}
@@ -0,0 +1,164 @@
package com.ruoyi.device.domain;
import java.math.BigDecimal;
import com.ruoyi.device.domain.BaseDomain;
import com.ruoyi.device.util.ToStringBuilder;
import com.ruoyi.device.util.ToStringStyle;
/**
* 学员主续读进度对象 train_reading_current_progress
*
* @author ruoyi
* @date 2026-10-20
*/
public class TrainReadingCurrentProgress extends BaseDomain
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 学员sys_user.userId */
private Long userId;
/** 图书永久ID */
private String bookId;
/** read / audio */
private String mode;
/** 进度绑定版本 */
private String bookVersion;
/** 当前页 */
private Integer pageNo;
/** TTS句子索引 */
private Integer sentenceIndex;
/** 0‑1进度 */
private BigDecimal progress;
/** 来源上报recordId */
private String sourceRecordId;
/** 来源sessionId */
private String sourceSessionId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setBookId(String bookId)
{
this.bookId = bookId;
}
public String getBookId()
{
return bookId;
}
public void setMode(String mode)
{
this.mode = mode;
}
public String getMode()
{
return mode;
}
public void setBookVersion(String bookVersion)
{
this.bookVersion = bookVersion;
}
public String getBookVersion()
{
return bookVersion;
}
public void setPageNo(Integer pageNo)
{
this.pageNo = pageNo;
}
public Integer getPageNo()
{
return pageNo;
}
public void setSentenceIndex(Integer sentenceIndex)
{
this.sentenceIndex = sentenceIndex;
}
public Integer getSentenceIndex()
{
return sentenceIndex;
}
public void setProgress(BigDecimal progress)
{
this.progress = progress;
}
public BigDecimal getProgress()
{
return progress;
}
public void setSourceRecordId(String sourceRecordId)
{
this.sourceRecordId = sourceRecordId;
}
public String getSourceRecordId()
{
return sourceRecordId;
}
public void setSourceSessionId(String sourceSessionId)
{
this.sourceSessionId = sourceSessionId;
}
public String getSourceSessionId()
{
return sourceSessionId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userId", getUserId())
.append("bookId", getBookId())
.append("mode", getMode())
.append("bookVersion", getBookVersion())
.append("pageNo", getPageNo())
.append("sentenceIndex", getSentenceIndex())
.append("progress", getProgress())
.append("sourceRecordId", getSourceRecordId())
.append("sourceSessionId", getSourceSessionId())
.append("updateTime", getUpdateTime())
.toString();
}
}
@@ -0,0 +1,263 @@
package com.ruoyi.device.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.ruoyi.device.domain.BaseDomain;
import com.ruoyi.device.util.ToStringBuilder;
import com.ruoyi.device.util.ToStringStyle;
/**
* 阅读上报幂等日志对象 train_reading_duration_log
*
* @author ruoyi
* @date 2026-10-20
*/
public class TrainReadingDurationLog extends BaseDomain
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 上报设备deviceId */
private String deviceId;
/** 学员sys_user.userId */
private Long userId;
/** 归属业务sessionId */
private String sessionId;
/** 设备幂等recordId */
private String recordId;
/** 图书永久ID */
private String bookId;
/** 阅读绑定图书版本 */
private String bookVersion;
/** read / audio */
private String mode;
/** PROGRESS / END */
private String recordType;
/** 有效时长秒 */
private Integer durationSec;
/** 起始页 */
private Integer pageFrom;
/** 结束页 */
private Integer pageTo;
/** 0‑1进度 */
private BigDecimal progress;
/** 阅读开始 */
private Date startTime;
/** 阅读结束 */
private Date endTime;
/** 接收时间 */
private Date receiveTime;
/** ACCEPTED / DUPLICATE / CONFLICT_SAVED / REJECTED */
private String resultCode;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setDeviceId(String deviceId)
{
this.deviceId = deviceId;
}
public String getDeviceId()
{
return deviceId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setSessionId(String sessionId)
{
this.sessionId = sessionId;
}
public String getSessionId()
{
return sessionId;
}
public void setRecordId(String recordId)
{
this.recordId = recordId;
}
public String getRecordId()
{
return recordId;
}
public void setBookId(String bookId)
{
this.bookId = bookId;
}
public String getBookId()
{
return bookId;
}
public void setBookVersion(String bookVersion)
{
this.bookVersion = bookVersion;
}
public String getBookVersion()
{
return bookVersion;
}
public void setMode(String mode)
{
this.mode = mode;
}
public String getMode()
{
return mode;
}
public void setRecordType(String recordType)
{
this.recordType = recordType;
}
public String getRecordType()
{
return recordType;
}
public void setDurationSec(Integer durationSec)
{
this.durationSec = durationSec;
}
public Integer getDurationSec()
{
return durationSec;
}
public void setPageFrom(Integer pageFrom)
{
this.pageFrom = pageFrom;
}
public Integer getPageFrom()
{
return pageFrom;
}
public void setPageTo(Integer pageTo)
{
this.pageTo = pageTo;
}
public Integer getPageTo()
{
return pageTo;
}
public void setProgress(BigDecimal progress)
{
this.progress = progress;
}
public BigDecimal getProgress()
{
return progress;
}
public void setStartTime(Date startTime)
{
this.startTime = startTime;
}
public Date getStartTime()
{
return startTime;
}
public void setEndTime(Date endTime)
{
this.endTime = endTime;
}
public Date getEndTime()
{
return endTime;
}
public void setReceiveTime(Date receiveTime)
{
this.receiveTime = receiveTime;
}
public Date getReceiveTime()
{
return receiveTime;
}
public void setResultCode(String resultCode)
{
this.resultCode = resultCode;
}
public String getResultCode()
{
return resultCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("deviceId", getDeviceId())
.append("userId", getUserId())
.append("sessionId", getSessionId())
.append("recordId", getRecordId())
.append("bookId", getBookId())
.append("bookVersion", getBookVersion())
.append("mode", getMode())
.append("recordType", getRecordType())
.append("durationSec", getDurationSec())
.append("pageFrom", getPageFrom())
.append("pageTo", getPageTo())
.append("progress", getProgress())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("receiveTime", getReceiveTime())
.append("resultCode", getResultCode())
.append("remark", getRemark())
.toString();
}
}
@@ -0,0 +1,149 @@
package com.ruoyi.device.domain;
import java.util.Date;
import com.ruoyi.device.domain.BaseDomain;
import com.ruoyi.device.util.ToStringBuilder;
import com.ruoyi.device.util.ToStringStyle;
/**
* 学员业务会话对象 train_user_session
*
* @author ruoyi
* @date 2026-10-20
*/
public class TrainUserSession extends BaseDomain
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** sys_user学员主键userId */
private Long userId;
/** 业务会话ID,业务幂等标识 */
private String sessionId;
/** 关联读书机deviceId */
private String deviceId;
/** 1 ACTIVE正常在线;2 REPLACED被替换仅允许补交记录;3 LOGOUT已主动退出 */
private Integer sessionStatus;
/** 登录时间 */
private Date loginTime;
/** 被顶替时间 */
private Date replaceTime;
/** 退出时间 */
private Date logoutTime;
/** 对应RuoYi Redis loginUser key,用于踢下线 */
private String ruoyiTokenKey;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setSessionId(String sessionId)
{
this.sessionId = sessionId;
}
public String getSessionId()
{
return sessionId;
}
public void setDeviceId(String deviceId)
{
this.deviceId = deviceId;
}
public String getDeviceId()
{
return deviceId;
}
public void setSessionStatus(Integer sessionStatus)
{
this.sessionStatus = sessionStatus;
}
public Integer getSessionStatus()
{
return sessionStatus;
}
public void setLoginTime(Date loginTime)
{
this.loginTime = loginTime;
}
public Date getLoginTime()
{
return loginTime;
}
public void setReplaceTime(Date replaceTime)
{
this.replaceTime = replaceTime;
}
public Date getReplaceTime()
{
return replaceTime;
}
public void setLogoutTime(Date logoutTime)
{
this.logoutTime = logoutTime;
}
public Date getLogoutTime()
{
return logoutTime;
}
public void setRuoyiTokenKey(String ruoyiTokenKey)
{
this.ruoyiTokenKey = ruoyiTokenKey;
}
public String getRuoyiTokenKey()
{
return ruoyiTokenKey;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userId", getUserId())
.append("sessionId", getSessionId())
.append("deviceId", getDeviceId())
.append("sessionStatus", getSessionStatus())
.append("loginTime", getLoginTime())
.append("replaceTime", getReplaceTime())
.append("logoutTime", getLogoutTime())
.append("ruoyiTokenKey", getRuoyiTokenKey())
.toString();
}
}
@@ -0,0 +1,25 @@
package com.ruoyi.device.mapper;
import java.util.List;
import com.ruoyi.device.domain.TrainBookSnapshot;
/**
* 图书快照Mapper接口
*
* @author ruoyi
* @date 2026-10-20
*/
public interface TrainBookSnapshotMapper
{
public TrainBookSnapshot selectTrainBookSnapshotById(Long id);
public List<TrainBookSnapshot> selectTrainBookSnapshotList(TrainBookSnapshot trainBookSnapshot);
public int insertTrainBookSnapshot(TrainBookSnapshot trainBookSnapshot);
public int updateTrainBookSnapshot(TrainBookSnapshot trainBookSnapshot);
public int deleteTrainBookSnapshotById(Long id);
public int deleteTrainBookSnapshotByIds(Long[] ids);
}
@@ -0,0 +1,25 @@
package com.ruoyi.device.mapper;
import java.util.List;
import com.ruoyi.device.domain.TrainIotDevice;
/**
* 读书机设备档案Mapper接口
*
* @author ruoyi
* @date 2026-10-20
*/
public interface TrainIotDeviceMapper
{
public TrainIotDevice selectTrainIotDeviceById(Long id);
public List<TrainIotDevice> selectTrainIotDeviceList(TrainIotDevice trainIotDevice);
public int insertTrainIotDevice(TrainIotDevice trainIotDevice);
public int updateTrainIotDevice(TrainIotDevice trainIotDevice);
public int deleteTrainIotDeviceById(Long id);
public int deleteTrainIotDeviceByIds(Long[] ids);
}
@@ -0,0 +1,25 @@
package com.ruoyi.device.mapper;
import java.util.List;
import com.ruoyi.device.domain.TrainReadingAlternateProgress;
/**
* 备选冲突续读进度Mapper接口
*
* @author ruoyi
* @date 2026-10-20
*/
public interface TrainReadingAlternateProgressMapper
{
public TrainReadingAlternateProgress selectTrainReadingAlternateProgressById(Long id);
public List<TrainReadingAlternateProgress> selectTrainReadingAlternateProgressList(TrainReadingAlternateProgress trainReadingAlternateProgress);
public int insertTrainReadingAlternateProgress(TrainReadingAlternateProgress trainReadingAlternateProgress);
public int updateTrainReadingAlternateProgress(TrainReadingAlternateProgress trainReadingAlternateProgress);
public int deleteTrainReadingAlternateProgressById(Long id);
public int deleteTrainReadingAlternateProgressByIds(Long[] ids);
}
@@ -0,0 +1,25 @@
package com.ruoyi.device.mapper;
import java.util.List;
import com.ruoyi.device.domain.TrainReadingCurrentProgress;
/**
* 学员主续读进度Mapper接口
*
* @author ruoyi
* @date 2026-10-20
*/
public interface TrainReadingCurrentProgressMapper
{
public TrainReadingCurrentProgress selectTrainReadingCurrentProgressById(Long id);
public List<TrainReadingCurrentProgress> selectTrainReadingCurrentProgressList(TrainReadingCurrentProgress trainReadingCurrentProgress);
public int insertTrainReadingCurrentProgress(TrainReadingCurrentProgress trainReadingCurrentProgress);
public int updateTrainReadingCurrentProgress(TrainReadingCurrentProgress trainReadingCurrentProgress);
public int deleteTrainReadingCurrentProgressById(Long id);
public int deleteTrainReadingCurrentProgressByIds(Long[] ids);
}
@@ -0,0 +1,25 @@
package com.ruoyi.device.mapper;
import java.util.List;
import com.ruoyi.device.domain.TrainReadingDurationLog;
/**
* 阅读上报幂等日志Mapper接口
*
* @author ruoyi
* @date 2026-10-20
*/
public interface TrainReadingDurationLogMapper
{
public TrainReadingDurationLog selectTrainReadingDurationLogById(Long id);
public List<TrainReadingDurationLog> selectTrainReadingDurationLogList(TrainReadingDurationLog trainReadingDurationLog);
public int insertTrainReadingDurationLog(TrainReadingDurationLog trainReadingDurationLog);
public int updateTrainReadingDurationLog(TrainReadingDurationLog trainReadingDurationLog);
public int deleteTrainReadingDurationLogById(Long id);
public int deleteTrainReadingDurationLogByIds(Long[] ids);
}
@@ -0,0 +1,25 @@
package com.ruoyi.device.mapper;
import java.util.List;
import com.ruoyi.device.domain.TrainUserSession;
/**
* 学员业务会话Mapper接口
*
* @author ruoyi
* @date 2026-10-20
*/
public interface TrainUserSessionMapper
{
public TrainUserSession selectTrainUserSessionById(Long id);
public List<TrainUserSession> selectTrainUserSessionList(TrainUserSession trainUserSession);
public int insertTrainUserSession(TrainUserSession trainUserSession);
public int updateTrainUserSession(TrainUserSession trainUserSession);
public int deleteTrainUserSessionById(Long id);
public int deleteTrainUserSessionByIds(Long[] ids);
}
@@ -0,0 +1,25 @@
package com.ruoyi.device.service;
import java.util.List;
import com.ruoyi.device.domain.TrainBookSnapshot;
/**
* 图书快照Service接口
*
* @author ruoyi
* @date 2026-10-20
*/
public interface ITrainBookSnapshotService
{
public TrainBookSnapshot selectTrainBookSnapshotById(Long id);
public List<TrainBookSnapshot> selectTrainBookSnapshotList(TrainBookSnapshot trainBookSnapshot);
public int insertTrainBookSnapshot(TrainBookSnapshot trainBookSnapshot);
public int updateTrainBookSnapshot(TrainBookSnapshot trainBookSnapshot);
public int deleteTrainBookSnapshotByIds(Long[] ids);
public int deleteTrainBookSnapshotById(Long id);
}
@@ -0,0 +1,25 @@
package com.ruoyi.device.service;
import java.util.List;
import com.ruoyi.device.domain.TrainIotDevice;
/**
* 读书机设备档案Service接口
*
* @author ruoyi
* @date 2026-10-20
*/
public interface ITrainIotDeviceService
{
public TrainIotDevice selectTrainIotDeviceById(Long id);
public List<TrainIotDevice> selectTrainIotDeviceList(TrainIotDevice trainIotDevice);
public int insertTrainIotDevice(TrainIotDevice trainIotDevice);
public int updateTrainIotDevice(TrainIotDevice trainIotDevice);
public int deleteTrainIotDeviceByIds(Long[] ids);
public int deleteTrainIotDeviceById(Long id);
}
@@ -0,0 +1,25 @@
package com.ruoyi.device.service;
import java.util.List;
import com.ruoyi.device.domain.TrainReadingAlternateProgress;
/**
* 备选冲突续读进度Service接口
*
* @author ruoyi
* @date 2026-10-20
*/
public interface ITrainReadingAlternateProgressService
{
public TrainReadingAlternateProgress selectTrainReadingAlternateProgressById(Long id);
public List<TrainReadingAlternateProgress> selectTrainReadingAlternateProgressList(TrainReadingAlternateProgress trainReadingAlternateProgress);
public int insertTrainReadingAlternateProgress(TrainReadingAlternateProgress trainReadingAlternateProgress);
public int updateTrainReadingAlternateProgress(TrainReadingAlternateProgress trainReadingAlternateProgress);
public int deleteTrainReadingAlternateProgressByIds(Long[] ids);
public int deleteTrainReadingAlternateProgressById(Long id);
}
@@ -0,0 +1,25 @@
package com.ruoyi.device.service;
import java.util.List;
import com.ruoyi.device.domain.TrainReadingCurrentProgress;
/**
* 学员主续读进度Service接口
*
* @author ruoyi
* @date 2026-10-20
*/
public interface ITrainReadingCurrentProgressService
{
public TrainReadingCurrentProgress selectTrainReadingCurrentProgressById(Long id);
public List<TrainReadingCurrentProgress> selectTrainReadingCurrentProgressList(TrainReadingCurrentProgress trainReadingCurrentProgress);
public int insertTrainReadingCurrentProgress(TrainReadingCurrentProgress trainReadingCurrentProgress);
public int updateTrainReadingCurrentProgress(TrainReadingCurrentProgress trainReadingCurrentProgress);
public int deleteTrainReadingCurrentProgressByIds(Long[] ids);
public int deleteTrainReadingCurrentProgressById(Long id);
}
@@ -0,0 +1,25 @@
package com.ruoyi.device.service;
import java.util.List;
import com.ruoyi.device.domain.TrainReadingDurationLog;
/**
* 阅读上报幂等日志Service接口
*
* @author ruoyi
* @date 2026-10-20
*/
public interface ITrainReadingDurationLogService
{
public TrainReadingDurationLog selectTrainReadingDurationLogById(Long id);
public List<TrainReadingDurationLog> selectTrainReadingDurationLogList(TrainReadingDurationLog trainReadingDurationLog);
public int insertTrainReadingDurationLog(TrainReadingDurationLog trainReadingDurationLog);
public int updateTrainReadingDurationLog(TrainReadingDurationLog trainReadingDurationLog);
public int deleteTrainReadingDurationLogByIds(Long[] ids);
public int deleteTrainReadingDurationLogById(Long id);
}
@@ -0,0 +1,25 @@
package com.ruoyi.device.service;
import java.util.List;
import com.ruoyi.device.domain.TrainUserSession;
/**
* 学员业务会话Service接口
*
* @author ruoyi
* @date 2026-10-20
*/
public interface ITrainUserSessionService
{
public TrainUserSession selectTrainUserSessionById(Long id);
public List<TrainUserSession> selectTrainUserSessionList(TrainUserSession trainUserSession);
public int insertTrainUserSession(TrainUserSession trainUserSession);
public int updateTrainUserSession(TrainUserSession trainUserSession);
public int deleteTrainUserSessionByIds(Long[] ids);
public int deleteTrainUserSessionById(Long id);
}
@@ -0,0 +1,57 @@
package com.ruoyi.device.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.device.domain.TrainBookSnapshot;
import com.ruoyi.device.mapper.TrainBookSnapshotMapper;
import com.ruoyi.device.service.ITrainBookSnapshotService;
/**
* 图书快照Service业务层处理
*
* @author ruoyi
* @date 2026-10-20
*/
@Service
public class TrainBookSnapshotServiceImpl implements ITrainBookSnapshotService
{
@Autowired
private TrainBookSnapshotMapper trainBookSnapshotMapper;
@Override
public TrainBookSnapshot selectTrainBookSnapshotById(Long id)
{
return trainBookSnapshotMapper.selectTrainBookSnapshotById(id);
}
@Override
public List<TrainBookSnapshot> selectTrainBookSnapshotList(TrainBookSnapshot trainBookSnapshot)
{
return trainBookSnapshotMapper.selectTrainBookSnapshotList(trainBookSnapshot);
}
@Override
public int insertTrainBookSnapshot(TrainBookSnapshot trainBookSnapshot)
{
return trainBookSnapshotMapper.insertTrainBookSnapshot(trainBookSnapshot);
}
@Override
public int updateTrainBookSnapshot(TrainBookSnapshot trainBookSnapshot)
{
return trainBookSnapshotMapper.updateTrainBookSnapshot(trainBookSnapshot);
}
@Override
public int deleteTrainBookSnapshotByIds(Long[] ids)
{
return trainBookSnapshotMapper.deleteTrainBookSnapshotByIds(ids);
}
@Override
public int deleteTrainBookSnapshotById(Long id)
{
return trainBookSnapshotMapper.deleteTrainBookSnapshotById(id);
}
}
@@ -0,0 +1,57 @@
package com.ruoyi.device.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.device.domain.TrainIotDevice;
import com.ruoyi.device.mapper.TrainIotDeviceMapper;
import com.ruoyi.device.service.ITrainIotDeviceService;
/**
* 读书机设备档案Service业务层处理
*
* @author ruoyi
* @date 2026-10-20
*/
@Service
public class TrainIotDeviceServiceImpl implements ITrainIotDeviceService
{
@Autowired
private TrainIotDeviceMapper trainIotDeviceMapper;
@Override
public TrainIotDevice selectTrainIotDeviceById(Long id)
{
return trainIotDeviceMapper.selectTrainIotDeviceById(id);
}
@Override
public List<TrainIotDevice> selectTrainIotDeviceList(TrainIotDevice trainIotDevice)
{
return trainIotDeviceMapper.selectTrainIotDeviceList(trainIotDevice);
}
@Override
public int insertTrainIotDevice(TrainIotDevice trainIotDevice)
{
return trainIotDeviceMapper.insertTrainIotDevice(trainIotDevice);
}
@Override
public int updateTrainIotDevice(TrainIotDevice trainIotDevice)
{
return trainIotDeviceMapper.updateTrainIotDevice(trainIotDevice);
}
@Override
public int deleteTrainIotDeviceByIds(Long[] ids)
{
return trainIotDeviceMapper.deleteTrainIotDeviceByIds(ids);
}
@Override
public int deleteTrainIotDeviceById(Long id)
{
return trainIotDeviceMapper.deleteTrainIotDeviceById(id);
}
}
@@ -0,0 +1,57 @@
package com.ruoyi.device.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.device.domain.TrainReadingAlternateProgress;
import com.ruoyi.device.mapper.TrainReadingAlternateProgressMapper;
import com.ruoyi.device.service.ITrainReadingAlternateProgressService;
/**
* 备选冲突续读进度Service业务层处理
*
* @author ruoyi
* @date 2026-10-20
*/
@Service
public class TrainReadingAlternateProgressServiceImpl implements ITrainReadingAlternateProgressService
{
@Autowired
private TrainReadingAlternateProgressMapper trainReadingAlternateProgressMapper;
@Override
public TrainReadingAlternateProgress selectTrainReadingAlternateProgressById(Long id)
{
return trainReadingAlternateProgressMapper.selectTrainReadingAlternateProgressById(id);
}
@Override
public List<TrainReadingAlternateProgress> selectTrainReadingAlternateProgressList(TrainReadingAlternateProgress trainReadingAlternateProgress)
{
return trainReadingAlternateProgressMapper.selectTrainReadingAlternateProgressList(trainReadingAlternateProgress);
}
@Override
public int insertTrainReadingAlternateProgress(TrainReadingAlternateProgress trainReadingAlternateProgress)
{
return trainReadingAlternateProgressMapper.insertTrainReadingAlternateProgress(trainReadingAlternateProgress);
}
@Override
public int updateTrainReadingAlternateProgress(TrainReadingAlternateProgress trainReadingAlternateProgress)
{
return trainReadingAlternateProgressMapper.updateTrainReadingAlternateProgress(trainReadingAlternateProgress);
}
@Override
public int deleteTrainReadingAlternateProgressByIds(Long[] ids)
{
return trainReadingAlternateProgressMapper.deleteTrainReadingAlternateProgressByIds(ids);
}
@Override
public int deleteTrainReadingAlternateProgressById(Long id)
{
return trainReadingAlternateProgressMapper.deleteTrainReadingAlternateProgressById(id);
}
}
@@ -0,0 +1,57 @@
package com.ruoyi.device.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.device.domain.TrainReadingCurrentProgress;
import com.ruoyi.device.mapper.TrainReadingCurrentProgressMapper;
import com.ruoyi.device.service.ITrainReadingCurrentProgressService;
/**
* 学员主续读进度Service业务层处理
*
* @author ruoyi
* @date 2026-10-20
*/
@Service
public class TrainReadingCurrentProgressServiceImpl implements ITrainReadingCurrentProgressService
{
@Autowired
private TrainReadingCurrentProgressMapper trainReadingCurrentProgressMapper;
@Override
public TrainReadingCurrentProgress selectTrainReadingCurrentProgressById(Long id)
{
return trainReadingCurrentProgressMapper.selectTrainReadingCurrentProgressById(id);
}
@Override
public List<TrainReadingCurrentProgress> selectTrainReadingCurrentProgressList(TrainReadingCurrentProgress trainReadingCurrentProgress)
{
return trainReadingCurrentProgressMapper.selectTrainReadingCurrentProgressList(trainReadingCurrentProgress);
}
@Override
public int insertTrainReadingCurrentProgress(TrainReadingCurrentProgress trainReadingCurrentProgress)
{
return trainReadingCurrentProgressMapper.insertTrainReadingCurrentProgress(trainReadingCurrentProgress);
}
@Override
public int updateTrainReadingCurrentProgress(TrainReadingCurrentProgress trainReadingCurrentProgress)
{
return trainReadingCurrentProgressMapper.updateTrainReadingCurrentProgress(trainReadingCurrentProgress);
}
@Override
public int deleteTrainReadingCurrentProgressByIds(Long[] ids)
{
return trainReadingCurrentProgressMapper.deleteTrainReadingCurrentProgressByIds(ids);
}
@Override
public int deleteTrainReadingCurrentProgressById(Long id)
{
return trainReadingCurrentProgressMapper.deleteTrainReadingCurrentProgressById(id);
}
}
@@ -0,0 +1,57 @@
package com.ruoyi.device.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.device.domain.TrainReadingDurationLog;
import com.ruoyi.device.mapper.TrainReadingDurationLogMapper;
import com.ruoyi.device.service.ITrainReadingDurationLogService;
/**
* 阅读上报幂等日志Service业务层处理
*
* @author ruoyi
* @date 2026-10-20
*/
@Service
public class TrainReadingDurationLogServiceImpl implements ITrainReadingDurationLogService
{
@Autowired
private TrainReadingDurationLogMapper trainReadingDurationLogMapper;
@Override
public TrainReadingDurationLog selectTrainReadingDurationLogById(Long id)
{
return trainReadingDurationLogMapper.selectTrainReadingDurationLogById(id);
}
@Override
public List<TrainReadingDurationLog> selectTrainReadingDurationLogList(TrainReadingDurationLog trainReadingDurationLog)
{
return trainReadingDurationLogMapper.selectTrainReadingDurationLogList(trainReadingDurationLog);
}
@Override
public int insertTrainReadingDurationLog(TrainReadingDurationLog trainReadingDurationLog)
{
return trainReadingDurationLogMapper.insertTrainReadingDurationLog(trainReadingDurationLog);
}
@Override
public int updateTrainReadingDurationLog(TrainReadingDurationLog trainReadingDurationLog)
{
return trainReadingDurationLogMapper.updateTrainReadingDurationLog(trainReadingDurationLog);
}
@Override
public int deleteTrainReadingDurationLogByIds(Long[] ids)
{
return trainReadingDurationLogMapper.deleteTrainReadingDurationLogByIds(ids);
}
@Override
public int deleteTrainReadingDurationLogById(Long id)
{
return trainReadingDurationLogMapper.deleteTrainReadingDurationLogById(id);
}
}
@@ -0,0 +1,57 @@
package com.ruoyi.device.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.device.domain.TrainUserSession;
import com.ruoyi.device.mapper.TrainUserSessionMapper;
import com.ruoyi.device.service.ITrainUserSessionService;
/**
* 学员业务会话Service业务层处理
*
* @author ruoyi
* @date 2026-10-20
*/
@Service
public class TrainUserSessionServiceImpl implements ITrainUserSessionService
{
@Autowired
private TrainUserSessionMapper trainUserSessionMapper;
@Override
public TrainUserSession selectTrainUserSessionById(Long id)
{
return trainUserSessionMapper.selectTrainUserSessionById(id);
}
@Override
public List<TrainUserSession> selectTrainUserSessionList(TrainUserSession trainUserSession)
{
return trainUserSessionMapper.selectTrainUserSessionList(trainUserSession);
}
@Override
public int insertTrainUserSession(TrainUserSession trainUserSession)
{
return trainUserSessionMapper.insertTrainUserSession(trainUserSession);
}
@Override
public int updateTrainUserSession(TrainUserSession trainUserSession)
{
return trainUserSessionMapper.updateTrainUserSession(trainUserSession);
}
@Override
public int deleteTrainUserSessionByIds(Long[] ids)
{
return trainUserSessionMapper.deleteTrainUserSessionByIds(ids);
}
@Override
public int deleteTrainUserSessionById(Long id)
{
return trainUserSessionMapper.deleteTrainUserSessionById(id);
}
}
@@ -0,0 +1,33 @@
package com.ruoyi.device.util;
/**
* 本地 ToStringBuilder,替代 org.apache.commons.lang3.builder.ToStringBuilder,
* 提供相同的流式 append(String, Object) 与 toString() API,使 device 模块不依赖 commons-lang3 即可编译。
*/
public class ToStringBuilder
{
private final StringBuilder sb = new StringBuilder();
private boolean first = true;
public ToStringBuilder(Object object, ToStringStyle style)
{
sb.append(object == null ? "Object" : object.getClass().getSimpleName()).append(" [");
}
public ToStringBuilder append(String name, Object value)
{
if (!first)
{
sb.append(", ");
}
first = false;
sb.append(name).append("=").append(value);
return this;
}
@Override
public String toString()
{
return sb.append("]").toString();
}
}
@@ -0,0 +1,13 @@
package com.ruoyi.device.util;
/**
* 本地 ToStringStyle,替代 org.apache.commons.lang3.builder.ToStringStyle,
* 用于使 device 模块不依赖 commons-lang3 即可编译。
*/
public class ToStringStyle
{
public static final ToStringStyle MULTI_LINE_STYLE = new ToStringStyle();
public static final ToStringStyle DEFAULT_STYLE = new ToStringStyle();
public static final ToStringStyle SHORT_PREFIX_STYLE = new ToStringStyle();
public static final ToStringStyle SIMPLE_STYLE = new ToStringStyle();
}
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.device.mapper.TrainBookSnapshotMapper">
<resultMap type="TrainBookSnapshot" id="TrainBookSnapshotResult">
<result property="id" column="id" />
<result property="bookId" column="book_id" />
<result property="bookTitle" column="book_title" />
<result property="bookCategory" column="book_category" />
<result property="bookSummary" column="book_summary" />
<result property="bookVersion" column="book_version" />
<result property="fileSize" column="file_size" />
<result property="fileMd5" column="file_md5" />
<result property="downloadUrl" column="download_url" />
<result property="isOnShelf" column="is_on_shelf" />
<result property="publishTime" column="publish_time" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectTrainBookSnapshotVo">
select id, book_id, book_title, book_category, book_summary, book_version, file_size, file_md5, download_url, is_on_shelf, publish_time, create_time, update_time from train_book_snapshot
</sql>
<select id="selectTrainBookSnapshotList" parameterType="TrainBookSnapshot" resultMap="TrainBookSnapshotResult">
<include refid="selectTrainBookSnapshotVo"/>
<where>
<if test="bookId != null and bookId != ''"> and book_id = #{bookId}</if>
<if test="bookTitle != null and bookTitle != ''"> and book_title like concat('%', #{bookTitle}, '%')</if>
<if test="bookCategory != null and bookCategory != ''"> and book_category = #{bookCategory}</if>
<if test="bookVersion != null and bookVersion != ''"> and book_version = #{bookVersion}</if>
<if test="fileMd5 != null and fileMd5 != ''"> and file_md5 = #{fileMd5}</if>
<if test="isOnShelf != null"> and is_on_shelf = #{isOnShelf}</if>
<if test="params.beginTime != null and params.beginTime != ''"> and create_time &gt;= #{params.beginTime}</if>
<if test="params.endTime != null and params.endTime != ''"> and create_time &lt;= #{params.endTime}</if>
</where>
order by create_time desc
</select>
<select id="selectTrainBookSnapshotById" parameterType="Long" resultMap="TrainBookSnapshotResult">
<include refid="selectTrainBookSnapshotVo"/>
where id = #{id}
</select>
<insert id="insertTrainBookSnapshot" parameterType="TrainBookSnapshot">
insert into train_book_snapshot
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="bookId != null and bookId != ''">book_id,</if>
<if test="bookTitle != null and bookTitle != ''">book_title,</if>
<if test="bookCategory != null and bookCategory != ''">book_category,</if>
<if test="bookSummary != null">book_summary,</if>
<if test="bookVersion != null and bookVersion != ''">book_version,</if>
<if test="fileSize != null">file_size,</if>
<if test="fileMd5 != null and fileMd5 != ''">file_md5,</if>
<if test="downloadUrl != null">download_url,</if>
<if test="isOnShelf != null">is_on_shelf,</if>
<if test="publishTime != null">publish_time,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="bookId != null and bookId != ''">#{bookId},</if>
<if test="bookTitle != null and bookTitle != ''">#{bookTitle},</if>
<if test="bookCategory != null and bookCategory != ''">#{bookCategory},</if>
<if test="bookSummary != null">#{bookSummary},</if>
<if test="bookVersion != null and bookVersion != ''">#{bookVersion},</if>
<if test="fileSize != null">#{fileSize},</if>
<if test="fileMd5 != null and fileMd5 != ''">#{fileMd5},</if>
<if test="downloadUrl != null">#{downloadUrl},</if>
<if test="isOnShelf != null">#{isOnShelf},</if>
<if test="publishTime != null">#{publishTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateTrainBookSnapshot" parameterType="TrainBookSnapshot">
update train_book_snapshot
<trim prefix="SET" suffixOverrides=",">
<if test="bookId != null and bookId != ''">book_id = #{bookId},</if>
<if test="bookTitle != null and bookTitle != ''">book_title = #{bookTitle},</if>
<if test="bookCategory != null and bookCategory != ''">book_category = #{bookCategory},</if>
<if test="bookSummary != null">book_summary = #{bookSummary},</if>
<if test="bookVersion != null and bookVersion != ''">book_version = #{bookVersion},</if>
<if test="fileSize != null">file_size = #{fileSize},</if>
<if test="fileMd5 != null and fileMd5 != ''">file_md5 = #{fileMd5},</if>
<if test="downloadUrl != null">download_url = #{downloadUrl},</if>
<if test="isOnShelf != null">is_on_shelf = #{isOnShelf},</if>
<if test="publishTime != null">publish_time = #{publishTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTrainBookSnapshotById" parameterType="Long">
delete from train_book_snapshot where id = #{id}
</delete>
<delete id="deleteTrainBookSnapshotByIds" parameterType="Long">
delete from train_book_snapshot where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.device.mapper.TrainIotDeviceMapper">
<resultMap type="TrainIotDevice" id="TrainIotDeviceResult">
<result property="id" column="id" />
<result property="deviceId" column="device_id" />
<result property="deviceSecretDigest" column="device_secret_digest" />
<result property="deviceStatus" column="device_status" />
<result property="firmwareVersion" column="firmware_version" />
<result property="appVersion" column="app_version" />
<result property="bindOrgId" column="bind_org_id" />
<result property="bindClassId" column="bind_class_id" />
<result property="heartbeatInterval" column="heartbeat_interval" />
<result property="lastLoginTime" column="last_login_time" />
<result property="lastHeartbeatTime" column="last_heartbeat_time" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectTrainIotDeviceVo">
select id, device_id, device_secret_digest, device_status, firmware_version, app_version, bind_org_id, bind_class_id, heartbeat_interval, last_login_time, last_heartbeat_time, create_time, update_time from train_iot_device
</sql>
<select id="selectTrainIotDeviceList" parameterType="TrainIotDevice" resultMap="TrainIotDeviceResult">
<include refid="selectTrainIotDeviceVo"/>
<where>
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
<if test="deviceSecretDigest != null and deviceSecretDigest != ''"> and device_secret_digest = #{deviceSecretDigest}</if>
<if test="deviceStatus != null"> and device_status = #{deviceStatus}</if>
<if test="firmwareVersion != null and firmwareVersion != ''"> and firmware_version = #{firmwareVersion}</if>
<if test="appVersion != null and appVersion != ''"> and app_version = #{appVersion}</if>
<if test="bindOrgId != null and bindOrgId != ''"> and bind_org_id = #{bindOrgId}</if>
<if test="bindClassId != null and bindClassId != ''"> and bind_class_id = #{bindClassId}</if>
<if test="heartbeatInterval != null"> and heartbeat_interval = #{heartbeatInterval}</if>
<if test="params.beginTime != null and params.beginTime != ''"> and create_time &gt;= #{params.beginTime}</if>
<if test="params.endTime != null and params.endTime != ''"> and create_time &lt;= #{params.endTime}</if>
</where>
order by create_time desc
</select>
<select id="selectTrainIotDeviceById" parameterType="Long" resultMap="TrainIotDeviceResult">
<include refid="selectTrainIotDeviceVo"/>
where id = #{id}
</select>
<insert id="insertTrainIotDevice" parameterType="TrainIotDevice">
insert into train_iot_device
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="deviceId != null and deviceId != ''">device_id,</if>
<if test="deviceSecretDigest != null and deviceSecretDigest != ''">device_secret_digest,</if>
<if test="deviceStatus != null">device_status,</if>
<if test="firmwareVersion != null and firmwareVersion != ''">firmware_version,</if>
<if test="appVersion != null and appVersion != ''">app_version,</if>
<if test="bindOrgId != null and bindOrgId != ''">bind_org_id,</if>
<if test="bindClassId != null and bindClassId != ''">bind_class_id,</if>
<if test="heartbeatInterval != null">heartbeat_interval,</if>
<if test="lastLoginTime != null">last_login_time,</if>
<if test="lastHeartbeatTime != null">last_heartbeat_time,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
<if test="deviceSecretDigest != null and deviceSecretDigest != ''">#{deviceSecretDigest},</if>
<if test="deviceStatus != null">#{deviceStatus},</if>
<if test="firmwareVersion != null and firmwareVersion != ''">#{firmwareVersion},</if>
<if test="appVersion != null and appVersion != ''">#{appVersion},</if>
<if test="bindOrgId != null and bindOrgId != ''">#{bindOrgId},</if>
<if test="bindClassId != null and bindClassId != ''">#{bindClassId},</if>
<if test="heartbeatInterval != null">#{heartbeatInterval},</if>
<if test="lastLoginTime != null">#{lastLoginTime},</if>
<if test="lastHeartbeatTime != null">#{lastHeartbeatTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateTrainIotDevice" parameterType="TrainIotDevice">
update train_iot_device
<trim prefix="SET" suffixOverrides=",">
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
<if test="deviceSecretDigest != null and deviceSecretDigest != ''">device_secret_digest = #{deviceSecretDigest},</if>
<if test="deviceStatus != null">device_status = #{deviceStatus},</if>
<if test="firmwareVersion != null and firmwareVersion != ''">firmware_version = #{firmwareVersion},</if>
<if test="appVersion != null and appVersion != ''">app_version = #{appVersion},</if>
<if test="bindOrgId != null and bindOrgId != ''">bind_org_id = #{bindOrgId},</if>
<if test="bindClassId != null and bindClassId != ''">bind_class_id = #{bindClassId},</if>
<if test="heartbeatInterval != null">heartbeat_interval = #{heartbeatInterval},</if>
<if test="lastLoginTime != null">last_login_time = #{lastLoginTime},</if>
<if test="lastHeartbeatTime != null">last_heartbeat_time = #{lastHeartbeatTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTrainIotDeviceById" parameterType="Long">
delete from train_iot_device where id = #{id}
</delete>
<delete id="deleteTrainIotDeviceByIds" parameterType="Long">
delete from train_iot_device where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.device.mapper.TrainReadingAlternateProgressMapper">
<resultMap type="TrainReadingAlternateProgress" id="TrainReadingAlternateProgressResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="bookId" column="book_id" />
<result property="mode" column="mode" />
<result property="bookVersion" column="book_version" />
<result property="pageNo" column="page_no" />
<result property="sentenceIndex" column="sentence_index" />
<result property="progress" column="progress" />
<result property="sourceRecordId" column="source_record_id" />
<result property="sourceSessionId" column="source_session_id" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectTrainReadingAlternateProgressVo">
select id, user_id, book_id, mode, book_version, page_no, sentence_index, progress, source_record_id, source_session_id, create_time from train_reading_alternate_progress
</sql>
<select id="selectTrainReadingAlternateProgressList" parameterType="TrainReadingAlternateProgress" resultMap="TrainReadingAlternateProgressResult">
<include refid="selectTrainReadingAlternateProgressVo"/>
<where>
<if test="userId != null"> and user_id = #{userId}</if>
<if test="bookId != null and bookId != ''"> and book_id = #{bookId}</if>
<if test="mode != null and mode != ''"> and mode = #{mode}</if>
<if test="bookVersion != null and bookVersion != ''"> and book_version = #{bookVersion}</if>
<if test="sourceRecordId != null and sourceRecordId != ''"> and source_record_id = #{sourceRecordId}</if>
<if test="sourceSessionId != null and sourceSessionId != ''"> and source_session_id = #{sourceSessionId}</if>
<if test="params.beginTime != null and params.beginTime != ''"> and create_time &gt;= #{params.beginTime}</if>
<if test="params.endTime != null and params.endTime != ''"> and create_time &lt;= #{params.endTime}</if>
</where>
order by create_time desc
</select>
<select id="selectTrainReadingAlternateProgressById" parameterType="Long" resultMap="TrainReadingAlternateProgressResult">
<include refid="selectTrainReadingAlternateProgressVo"/>
where id = #{id}
</select>
<insert id="insertTrainReadingAlternateProgress" parameterType="TrainReadingAlternateProgress">
insert into train_reading_alternate_progress
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="userId != null">user_id,</if>
<if test="bookId != null and bookId != ''">book_id,</if>
<if test="mode != null and mode != ''">mode,</if>
<if test="bookVersion != null and bookVersion != ''">book_version,</if>
<if test="pageNo != null">page_no,</if>
<if test="sentenceIndex != null">sentence_index,</if>
<if test="progress != null">progress,</if>
<if test="sourceRecordId != null and sourceRecordId != ''">source_record_id,</if>
<if test="sourceSessionId != null and sourceSessionId != ''">source_session_id,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="userId != null">#{userId},</if>
<if test="bookId != null and bookId != ''">#{bookId},</if>
<if test="mode != null and mode != ''">#{mode},</if>
<if test="bookVersion != null and bookVersion != ''">#{bookVersion},</if>
<if test="pageNo != null">#{pageNo},</if>
<if test="sentenceIndex != null">#{sentenceIndex},</if>
<if test="progress != null">#{progress},</if>
<if test="sourceRecordId != null and sourceRecordId != ''">#{sourceRecordId},</if>
<if test="sourceSessionId != null and sourceSessionId != ''">#{sourceSessionId},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateTrainReadingAlternateProgress" parameterType="TrainReadingAlternateProgress">
update train_reading_alternate_progress
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="bookId != null and bookId != ''">book_id = #{bookId},</if>
<if test="mode != null and mode != ''">mode = #{mode},</if>
<if test="bookVersion != null and bookVersion != ''">book_version = #{bookVersion},</if>
<if test="pageNo != null">page_no = #{pageNo},</if>
<if test="sentenceIndex != null">sentence_index = #{sentenceIndex},</if>
<if test="progress != null">progress = #{progress},</if>
<if test="sourceRecordId != null and sourceRecordId != ''">source_record_id = #{sourceRecordId},</if>
<if test="sourceSessionId != null and sourceSessionId != ''">source_session_id = #{sourceSessionId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTrainReadingAlternateProgressById" parameterType="Long">
delete from train_reading_alternate_progress where id = #{id}
</delete>
<delete id="deleteTrainReadingAlternateProgressByIds" parameterType="Long">
delete from train_reading_alternate_progress where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.device.mapper.TrainReadingCurrentProgressMapper">
<resultMap type="TrainReadingCurrentProgress" id="TrainReadingCurrentProgressResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="bookId" column="book_id" />
<result property="mode" column="mode" />
<result property="bookVersion" column="book_version" />
<result property="pageNo" column="page_no" />
<result property="sentenceIndex" column="sentence_index" />
<result property="progress" column="progress" />
<result property="sourceRecordId" column="source_record_id" />
<result property="sourceSessionId" column="source_session_id" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectTrainReadingCurrentProgressVo">
select id, user_id, book_id, mode, book_version, page_no, sentence_index, progress, source_record_id, source_session_id, update_time from train_reading_current_progress
</sql>
<select id="selectTrainReadingCurrentProgressList" parameterType="TrainReadingCurrentProgress" resultMap="TrainReadingCurrentProgressResult">
<include refid="selectTrainReadingCurrentProgressVo"/>
<where>
<if test="userId != null"> and user_id = #{userId}</if>
<if test="bookId != null and bookId != ''"> and book_id = #{bookId}</if>
<if test="mode != null and mode != ''"> and mode = #{mode}</if>
<if test="bookVersion != null and bookVersion != ''"> and book_version = #{bookVersion}</if>
<if test="sourceRecordId != null and sourceRecordId != ''"> and source_record_id = #{sourceRecordId}</if>
<if test="sourceSessionId != null and sourceSessionId != ''"> and source_session_id = #{sourceSessionId}</if>
<if test="params.beginTime != null and params.beginTime != ''"> and update_time &gt;= #{params.beginTime}</if>
<if test="params.endTime != null and params.endTime != ''"> and update_time &lt;= #{params.endTime}</if>
</where>
order by update_time desc
</select>
<select id="selectTrainReadingCurrentProgressById" parameterType="Long" resultMap="TrainReadingCurrentProgressResult">
<include refid="selectTrainReadingCurrentProgressVo"/>
where id = #{id}
</select>
<insert id="insertTrainReadingCurrentProgress" parameterType="TrainReadingCurrentProgress">
insert into train_reading_current_progress
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="userId != null">user_id,</if>
<if test="bookId != null and bookId != ''">book_id,</if>
<if test="mode != null and mode != ''">mode,</if>
<if test="bookVersion != null and bookVersion != ''">book_version,</if>
<if test="pageNo != null">page_no,</if>
<if test="sentenceIndex != null">sentence_index,</if>
<if test="progress != null">progress,</if>
<if test="sourceRecordId != null and sourceRecordId != ''">source_record_id,</if>
<if test="sourceSessionId != null and sourceSessionId != ''">source_session_id,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="userId != null">#{userId},</if>
<if test="bookId != null and bookId != ''">#{bookId},</if>
<if test="mode != null and mode != ''">#{mode},</if>
<if test="bookVersion != null and bookVersion != ''">#{bookVersion},</if>
<if test="pageNo != null">#{pageNo},</if>
<if test="sentenceIndex != null">#{sentenceIndex},</if>
<if test="progress != null">#{progress},</if>
<if test="sourceRecordId != null and sourceRecordId != ''">#{sourceRecordId},</if>
<if test="sourceSessionId != null and sourceSessionId != ''">#{sourceSessionId},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateTrainReadingCurrentProgress" parameterType="TrainReadingCurrentProgress">
update train_reading_current_progress
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="bookId != null and bookId != ''">book_id = #{bookId},</if>
<if test="mode != null and mode != ''">mode = #{mode},</if>
<if test="bookVersion != null and bookVersion != ''">book_version = #{bookVersion},</if>
<if test="pageNo != null">page_no = #{pageNo},</if>
<if test="sentenceIndex != null">sentence_index = #{sentenceIndex},</if>
<if test="progress != null">progress = #{progress},</if>
<if test="sourceRecordId != null and sourceRecordId != ''">source_record_id = #{sourceRecordId},</if>
<if test="sourceSessionId != null and sourceSessionId != ''">source_session_id = #{sourceSessionId},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTrainReadingCurrentProgressById" parameterType="Long">
delete from train_reading_current_progress where id = #{id}
</delete>
<delete id="deleteTrainReadingCurrentProgressByIds" parameterType="Long">
delete from train_reading_current_progress where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
@@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.device.mapper.TrainReadingDurationLogMapper">
<resultMap type="TrainReadingDurationLog" id="TrainReadingDurationLogResult">
<result property="id" column="id" />
<result property="deviceId" column="device_id" />
<result property="userId" column="user_id" />
<result property="sessionId" column="session_id" />
<result property="recordId" column="record_id" />
<result property="bookId" column="book_id" />
<result property="bookVersion" column="book_version" />
<result property="mode" column="mode" />
<result property="recordType" column="record_type" />
<result property="durationSec" column="duration_sec" />
<result property="pageFrom" column="page_from" />
<result property="pageTo" column="page_to" />
<result property="progress" column="progress" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="receiveTime" column="receive_time" />
<result property="resultCode" column="result_code" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectTrainReadingDurationLogVo">
select id, device_id, user_id, session_id, record_id, book_id, book_version, mode, record_type, duration_sec, page_from, page_to, progress, start_time, end_time, receive_time, result_code, remark from train_reading_duration_log
</sql>
<select id="selectTrainReadingDurationLogList" parameterType="TrainReadingDurationLog" resultMap="TrainReadingDurationLogResult">
<include refid="selectTrainReadingDurationLogVo"/>
<where>
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
<if test="userId != null"> and user_id = #{userId}</if>
<if test="sessionId != null and sessionId != ''"> and session_id = #{sessionId}</if>
<if test="recordId != null and recordId != ''"> and record_id = #{recordId}</if>
<if test="bookId != null and bookId != ''"> and book_id = #{bookId}</if>
<if test="bookVersion != null and bookVersion != ''"> and book_version = #{bookVersion}</if>
<if test="mode != null and mode != ''"> and mode = #{mode}</if>
<if test="recordType != null and recordType != ''"> and record_type = #{recordType}</if>
<if test="resultCode != null and resultCode != ''"> and result_code = #{resultCode}</if>
<if test="params.beginTime != null and params.beginTime != ''"> and receive_time &gt;= #{params.beginTime}</if>
<if test="params.endTime != null and params.endTime != ''"> and receive_time &lt;= #{params.endTime}</if>
</where>
order by receive_time desc
</select>
<select id="selectTrainReadingDurationLogById" parameterType="Long" resultMap="TrainReadingDurationLogResult">
<include refid="selectTrainReadingDurationLogVo"/>
where id = #{id}
</select>
<insert id="insertTrainReadingDurationLog" parameterType="TrainReadingDurationLog">
insert into train_reading_duration_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="deviceId != null and deviceId != ''">device_id,</if>
<if test="userId != null">user_id,</if>
<if test="sessionId != null and sessionId != ''">session_id,</if>
<if test="recordId != null and recordId != ''">record_id,</if>
<if test="bookId != null and bookId != ''">book_id,</if>
<if test="bookVersion != null and bookVersion != ''">book_version,</if>
<if test="mode != null and mode != ''">mode,</if>
<if test="recordType != null and recordType != ''">record_type,</if>
<if test="durationSec != null">duration_sec,</if>
<if test="pageFrom != null">page_from,</if>
<if test="pageTo != null">page_to,</if>
<if test="progress != null">progress,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="receiveTime != null">receive_time,</if>
<if test="resultCode != null and resultCode != ''">result_code,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
<if test="userId != null">#{userId},</if>
<if test="sessionId != null and sessionId != ''">#{sessionId},</if>
<if test="recordId != null and recordId != ''">#{recordId},</if>
<if test="bookId != null and bookId != ''">#{bookId},</if>
<if test="bookVersion != null and bookVersion != ''">#{bookVersion},</if>
<if test="mode != null and mode != ''">#{mode},</if>
<if test="recordType != null and recordType != ''">#{recordType},</if>
<if test="durationSec != null">#{durationSec},</if>
<if test="pageFrom != null">#{pageFrom},</if>
<if test="pageTo != null">#{pageTo},</if>
<if test="progress != null">#{progress},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="receiveTime != null">#{receiveTime},</if>
<if test="resultCode != null and resultCode != ''">#{resultCode},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTrainReadingDurationLog" parameterType="TrainReadingDurationLog">
update train_reading_duration_log
<trim prefix="SET" suffixOverrides=",">
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="sessionId != null and sessionId != ''">session_id = #{sessionId},</if>
<if test="recordId != null and recordId != ''">record_id = #{recordId},</if>
<if test="bookId != null and bookId != ''">book_id = #{bookId},</if>
<if test="bookVersion != null and bookVersion != ''">book_version = #{bookVersion},</if>
<if test="mode != null and mode != ''">mode = #{mode},</if>
<if test="recordType != null and recordType != ''">record_type = #{recordType},</if>
<if test="durationSec != null">duration_sec = #{durationSec},</if>
<if test="pageFrom != null">page_from = #{pageFrom},</if>
<if test="pageTo != null">page_to = #{pageTo},</if>
<if test="progress != null">progress = #{progress},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="receiveTime != null">receive_time = #{receiveTime},</if>
<if test="resultCode != null and resultCode != ''">result_code = #{resultCode},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTrainReadingDurationLogById" parameterType="Long">
delete from train_reading_duration_log where id = #{id}
</delete>
<delete id="deleteTrainReadingDurationLogByIds" parameterType="Long">
delete from train_reading_duration_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.device.mapper.TrainUserSessionMapper">
<resultMap type="TrainUserSession" id="TrainUserSessionResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="sessionId" column="session_id" />
<result property="deviceId" column="device_id" />
<result property="sessionStatus" column="session_status" />
<result property="loginTime" column="login_time" />
<result property="replaceTime" column="replace_time" />
<result property="logoutTime" column="logout_time" />
<result property="ruoyiTokenKey" column="ruoyi_token_key" />
</resultMap>
<sql id="selectTrainUserSessionVo">
select id, user_id, session_id, device_id, session_status, login_time, replace_time, logout_time, ruoyi_token_key from train_user_session
</sql>
<select id="selectTrainUserSessionList" parameterType="TrainUserSession" resultMap="TrainUserSessionResult">
<include refid="selectTrainUserSessionVo"/>
<where>
<if test="userId != null"> and user_id = #{userId}</if>
<if test="sessionId != null and sessionId != ''"> and session_id = #{sessionId}</if>
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
<if test="sessionStatus != null"> and session_status = #{sessionStatus}</if>
<if test="ruoyiTokenKey != null and ruoyiTokenKey != ''"> and ruoyi_token_key = #{ruoyiTokenKey}</if>
<if test="params.beginTime != null and params.beginTime != ''"> and login_time &gt;= #{params.beginTime}</if>
<if test="params.endTime != null and params.endTime != ''"> and login_time &lt;= #{params.endTime}</if>
</where>
order by login_time desc
</select>
<select id="selectTrainUserSessionById" parameterType="Long" resultMap="TrainUserSessionResult">
<include refid="selectTrainUserSessionVo"/>
where id = #{id}
</select>
<insert id="insertTrainUserSession" parameterType="TrainUserSession">
insert into train_user_session
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="userId != null">user_id,</if>
<if test="sessionId != null and sessionId != ''">session_id,</if>
<if test="deviceId != null and deviceId != ''">device_id,</if>
<if test="sessionStatus != null">session_status,</if>
<if test="loginTime != null">login_time,</if>
<if test="replaceTime != null">replace_time,</if>
<if test="logoutTime != null">logout_time,</if>
<if test="ruoyiTokenKey != null and ruoyiTokenKey != ''">ruoyi_token_key,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="userId != null">#{userId},</if>
<if test="sessionId != null and sessionId != ''">#{sessionId},</if>
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
<if test="sessionStatus != null">#{sessionStatus},</if>
<if test="loginTime != null">#{loginTime},</if>
<if test="replaceTime != null">#{replaceTime},</if>
<if test="logoutTime != null">#{logoutTime},</if>
<if test="ruoyiTokenKey != null and ruoyiTokenKey != ''">#{ruoyiTokenKey},</if>
</trim>
</insert>
<update id="updateTrainUserSession" parameterType="TrainUserSession">
update train_user_session
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="sessionId != null and sessionId != ''">session_id = #{sessionId},</if>
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
<if test="sessionStatus != null">session_status = #{sessionStatus},</if>
<if test="loginTime != null">login_time = #{loginTime},</if>
<if test="replaceTime != null">replace_time = #{replaceTime},</if>
<if test="logoutTime != null">logout_time = #{logoutTime},</if>
<if test="ruoyiTokenKey != null and ruoyiTokenKey != ''">ruoyi_token_key = #{ruoyiTokenKey},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTrainUserSessionById" parameterType="Long">
delete from train_user_session where id = #{id}
</delete>
<delete id="deleteTrainUserSessionByIds" parameterType="Long">
delete from train_user_session where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>