zhizhi wu 4 years ago
parent
commit
cfbfeff091
  1. 21
      bjyy-core/src/main/java/com/wmeimob/bjyy/util/CommonUtils.java
  2. 13
      bjyy-core/src/main/java/com/wmeimob/bjyy/util/DateUtil.java
  3. 293
      bjyy-core/src/main/java/com/wmeimob/bjyy/util/PdfUtil.java
  4. 2
      bjyy-core/src/main/java/com/wmeimob/bjyy/weixin/WeChatConfig.java
  5. 4
      bjyy-core/src/main/resources/test/wechat.properties
  6. 20
      bjyy-dal/pom.xml
  7. 11
      bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/MentalTestMapper.java
  8. 30
      bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainAidMapper.java
  9. 30
      bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainContentMapper.java
  10. 17
      bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainDao.java
  11. 30
      bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainImgMapper.java
  12. 30
      bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainRecordMapper.java
  13. 238
      bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/MentalTestMapper.xml
  14. 243
      bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainAidMapper.xml
  15. 258
      bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainContentMapper.xml
  16. 49
      bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainDao.xml
  17. 258
      bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainImgMapper.xml
  18. 243
      bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainRecordMapper.xml
  19. 45
      bjyy-dal/src/main/java/com/wmeimob/bjyy/model/MentalTest.java
  20. 96
      bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainAid.java
  21. 641
      bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainAidExample.java
  22. 107
      bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainContent.java
  23. 691
      bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainContentExample.java
  24. 107
      bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainImg.java
  25. 691
      bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainImgExample.java
  26. 96
      bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainRecord.java
  27. 631
      bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainRecordExample.java
  28. 39
      bjyy-dal/src/main/java/com/wmeimob/bjyy/vo/TrainVo.java
  29. 49
      bjyy-dal/src/main/resources/generatorConfig.xml
  30. 31
      bjyy-weixin/src/main/java/com/wmeimob/bjyy/controller/DebugController.java
  31. 14
      bjyy-weixin/src/main/java/com/wmeimob/bjyy/controller/MentalController.java
  32. 20
      bjyy-weixin/src/main/java/com/wmeimob/bjyy/service/TrainService.java
  33. 161
      bjyy-weixin/src/main/java/com/wmeimob/bjyy/service/impl/TrainServiceImpl.java
  34. BIN
      bjyy-weixin/src/main/webapp/static/images/logo.jpg
  35. 11
      generatorConfig.xml
  36. 29
      pom.xml

21
bjyy-core/src/main/java/com/wmeimob/bjyy/util/CommonUtils.java

@ -0,0 +1,21 @@
package com.wmeimob.bjyy.util;
import java.util.HashMap;
import java.util.Map;
/**
* @description:
* @author: whj
* @time: 2021/2/5 18:02
*/
public class CommonUtils {
public static Map<Integer, String> numMap = new HashMap<>();
static {
numMap.put(1,"一");
numMap.put(2,"二");
numMap.put(3,"三");
numMap.put(4,"四");
numMap.put(5,"五");
}
}

13
bjyy-core/src/main/java/com/wmeimob/bjyy/util/DateUtil.java

@ -14,9 +14,16 @@ import com.fasterxml.jackson.databind.util.Converter;
public class DateUtil {
private static final String dateFormat="yyyy-MM-dd HH:mm:ss";
private static final String shortDateFormat="yyyy-MM-dd";
public static final String dateFormat="yyyy-MM-dd HH:mm:ss";
public static final String shortDateFormat="yyyy-MM-dd";
public static final String yyyyMMddDot = "yyyy.MM.dd";
public static String format(Date date, String format) {
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(date);
}
/**
* 接收页面传来的时间参数 字符串或时间戳 转换成Date
* @return

293
bjyy-core/src/main/java/com/wmeimob/bjyy/util/PdfUtil.java

@ -0,0 +1,293 @@
package com.wmeimob.bjyy.util;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.itextpdf.text.*;
import com.itextpdf.text.pdf.*;
import lombok.Data;
import lombok.extern.log4j.Log4j;
import org.apache.commons.lang3.ArrayUtils;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/20 09:34
*/
@Log4j
public class PdfUtil {
/**
* 生成pdf
* @param parentPath
* @param title
* @param subhead 副标题
* @param intros
* @param content
* @return
*/
public static String credatePdf(ImageFile imageFile, String parentPath, String title, String subhead, List<Row> intros, List<Row> content, Margin margin) {
String fileName = "pdf/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".pdf";
log.info("pdf文件名:"+fileName );
File file = new File(parentPath, fileName);
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
//新建文件
Document document = new Document();
try {
document.setMargins(margin.left, margin.right, margin.top, margin.bottom);
PdfWriter.getInstance(document, new FileOutputStream(file));
document.open();
// 中文字体
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
// 标题字体
Font titleChinese = new Font(bfChinese, 24, Font.BOLD);
// 设置logo
Image image = Image.getInstance(imageFile.getUrl());
image.scalePercent(imageFile.getScalePercentage());
image.setAlignment(Element.ALIGN_CENTER);
image.setAbsolutePosition(imageFile.getX(), document.getPageSize().getTop() - imageFile.getY());
document.add(image);
//设置标题
Paragraph par = new Paragraph(title, titleChinese);
par.setAlignment(Element.ALIGN_CENTER);
document.add(par);
if (StrUtil.isNotBlank(subhead)) {
// 标题字体
Font subheadChinese = new Font(bfChinese, 22, Font.NORMAL);
//设置标题
Paragraph subheadPar = new Paragraph(subhead, subheadChinese);
subheadPar.setAlignment(Element.ALIGN_CENTER);
document.add(subheadPar);
}
// 每行加空白
fillBlankRow(document, titleChinese);
//设置介绍内容
if (CollectionUtil.isNotEmpty(intros)) {
fillRow(intros, document);
}
if (CollectionUtil.isNotEmpty(content)) {
fillRow(content, document);
}
} catch (DocumentException e) {
e.printStackTrace();
log.error("导出pdf异常", e);
return null;
} catch (FileNotFoundException e) {
e.printStackTrace();
log.error("导出pdf异常", e);
return null;
} catch (IOException e) {
e.printStackTrace();
log.error("导出pdf异常", e);
return null;
} finally {
document.close();
}
return fileName;
}
/**
*
* @param imageFiles
* @return
* @throws IOException
* @throws DocumentException
*/
public static void fillImage(String pdf, ImageFile... imageFiles) throws IOException, DocumentException {
if (ArrayUtils.isEmpty(imageFiles)) {
return ;
}
File pdfFile = new File(pdf);
// 创建文件
Document document = new Document();
// 建立一个书写器
PdfReader pdfReader = new PdfReader(pdf);
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(pdfFile));
writer.setStrictImageSequence(true);
PdfStamper pdfStamper = new PdfStamper(pdfReader,new FileOutputStream(pdfFile));
// // 打开文件
// document.open();
for (ImageFile imageFile : imageFiles) {
// 图片
Image image = Image.getInstance(imageFile.getUrl());
image.scalePercent(imageFile.getScalePercentage());
image.setAlignment(Element.ALIGN_CENTER);
image.setAbsolutePosition(imageFile.getX(), imageFile.getY());
// 将图片1添加到pdf文件中
// document.add(image);
PdfContentByte content = pdfStamper.getUnderContent(imageFile.getX());
content.addImage(image);
}
// 关闭文档
pdfStamper.close();
// document.close();
// // 关闭书写器
// writer.close();
}
/**
* 添加空白行
* @param document
* @param titleChinese
* @throws DocumentException
*/
private static void fillBlankRow(Document document, Font titleChinese) throws DocumentException {
Paragraph par;
par = new Paragraph(" ", titleChinese);
par.setAlignment(Element.ALIGN_LEFT);
document.add(par);
}
/**
* 添加内容
* @param rows
* @param document
*/
private static void fillRow(List<Row> rows, Document document) throws IOException, DocumentException {
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
int size = 0;
for (Cell cell :rows.get(0).getCells()) {
size += cell.getColSpan();
}
PdfPTable table = new PdfPTable(size);
table.setSpacingBefore(0);
table.setWidthPercentage(90);
for (int j = 0; j < rows.size(); j++) {
Row row = rows.get(j);
table.setHorizontalAlignment(row.align);
Font font = new Font(bfChinese, row.fontSize, row.fontStyle);
for (int i = 0; i < row.cells.size(); i++) {
Cell cell = row.cells.get(i);
PdfPCell pdfpCell = new PdfPCell();
if (cell.getType() == 0) {
pdfpCell.setPhrase(new Phrase(cell.content,font));
} else {
Image image = Image.getInstance(cell.content);
pdfpCell.setImage(image);
}
pdfpCell.setBorderWidthTop(cell.borderTop == null ? 0 : cell.borderTop);
pdfpCell.setBorderWidthLeft(cell.borderLeft == null ? 0 : cell.borderLeft);
pdfpCell.setBorderWidthRight(cell.borderRight == null ? 0 : cell.borderRight);
pdfpCell.setBorderWidthBottom(cell.borderBottom == null ? 0 : cell.borderBottom);
pdfpCell.setColspan(cell.colSpan);
pdfpCell.setRowspan(cell.rowSpan);
if (cell.isCenter) {
//水平居中
pdfpCell.setHorizontalAlignment(Element.ALIGN_CENTER);
}
//垂直居中
pdfpCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
pdfpCell.setMinimumHeight(cell.height);
table.addCell(pdfpCell);
}
}
try {
document.add(table);
} catch (DocumentException e) {
e.printStackTrace();
}
}
/**
* pdf每行的内容
*/
@Data
public static class Row{
//表格内容
private List<Cell> cells = new ArrayList<>();
//文字位置(居左)
private int align = Element.ALIGN_LEFT;
private int fontSize = 12;
private int fontStyle = Font.NORMAL;
private int height = 80;
public void addCell(Cell cell) {
cells.add(cell);
}
}
@Data
public static class Cell{
public final static int defaultHeight = 24;
//内容 若类型为图片,则为图片地址
private String content;
//边框宽度
private int border = 1;
// 上边框宽度
private Integer borderTop = null;
// 下边框宽度
private Integer borderBottom = 1;
// 左边框宽度
private Integer borderLeft = 1;
// 右边框宽度
private Integer borderRight = null;
//横向合并数
private int colSpan = 1;
//纵向合并数
private int rowSpan = 1;
//单元格高度
private int height = defaultHeight;
// 单元格是否居中
private boolean isCenter = true;
/**
* 类型 0文字 1图片
* */
private byte type = 0;
/**
* 缩放比例
*/
private int scalePercent;
}
/**
* pdf位置
*/
@Data
public static class Margin{
private float left = 72;
private float right = 0;
private float top = 32;
private float bottom = 32;
}
@Data
public static class ImageFile {
private String url;
private int x;
private int y;
private float scalePercentage;
public ImageFile(){}
public ImageFile(String url, int x, int y, float scalePercentage) {
this.url = url;
this.x = x;
this.y = y;
this.scalePercentage = scalePercentage;
}
}
}

2
bjyy-core/src/main/java/com/wmeimob/bjyy/weixin/WeChatConfig.java

@ -7,7 +7,7 @@ import org.apache.log4j.Logger;
/**
* 微信配置
*/
class WeChatConfig {
public class WeChatConfig {
private static Logger log = Logger.getLogger(WeChatConfig.class);
private static Properties props = new Properties();

4
bjyy-core/src/main/resources/test/wechat.properties

@ -7,3 +7,7 @@ wechat.CallbackDomain=https://www.tall.wiki
#wechat.AppID=wxbcda0257af55982a
#wechat.AppSecret=818724f3ef23895c1b46b4bae75a1a50
#wechat.CallbackDomain=https://lyb-yanyuan.f.wmeimob.com
filePath=D:/git/bjyy/bjyy-weixin/target/bjyy-weixin/
domain=http://localhost:8080/bjyy_weixin/
logoPath=D:/git/bjyy/bjyy-weixin/src/main/webapp/static/images/logo.jpg
projectPath=D:/git/bjyy/bjyy-weixin/target/bjyy-weixin/

20
bjyy-dal/pom.xml

@ -39,4 +39,24 @@
<artifactId>mybatis</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.7</version>
<configuration>
<configurationFile>${basedir}/src/main/resources/generatorConfig.xml</configurationFile>
<overwrite>true</overwrite>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>

11
bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/MentalTestMapper.java

@ -1,10 +1,9 @@
package com.wmeimob.bjyy.dao;
import java.util.List;
import com.wmeimob.bjyy.model.MentalTest;
import org.apache.ibatis.annotations.Param;
import com.wmeimob.bjyy.model.MentalTest;
import java.util.List;
public interface MentalTestMapper {
int deleteByPrimaryKey(String id);
@ -23,17 +22,17 @@ public interface MentalTestMapper {
* @param userId
* @return
*/
MentalTest selectRecentMental(@Param("userId")String userId);
MentalTest selectRecentMental(@Param("userId")String userId);
/**
* 查找用户最新脑力测评记录
* @param userId
* @return
*/
MentalTest selectMentalRecordNewest(@Param("userId")String userId);
MentalTest selectMentalRecordNewest(@Param("userId")String userId);
/***
* 查询最新的两条脑力记录
* @param userId
* @return
*/
List<MentalTest> selectMentalRecordTop(@Param("userId")String userId);
List<MentalTest> selectMentalRecordTop(@Param("userId")String userId);
}

30
bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainAidMapper.java

@ -0,0 +1,30 @@
package com.wmeimob.bjyy.dao;
import com.wmeimob.bjyy.model.TrainAid;
import com.wmeimob.bjyy.model.TrainAidExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TrainAidMapper {
long countByExample(TrainAidExample example);
int deleteByExample(TrainAidExample example);
int deleteByPrimaryKey(Integer id);
int insert(TrainAid record);
int insertSelective(TrainAid record);
List<TrainAid> selectByExample(TrainAidExample example);
TrainAid selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") TrainAid record, @Param("example") TrainAidExample example);
int updateByExample(@Param("record") TrainAid record, @Param("example") TrainAidExample example);
int updateByPrimaryKeySelective(TrainAid record);
int updateByPrimaryKey(TrainAid record);
}

30
bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainContentMapper.java

@ -0,0 +1,30 @@
package com.wmeimob.bjyy.dao;
import com.wmeimob.bjyy.model.TrainContent;
import com.wmeimob.bjyy.model.TrainContentExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TrainContentMapper {
long countByExample(TrainContentExample example);
int deleteByExample(TrainContentExample example);
int deleteByPrimaryKey(Integer id);
int insert(TrainContent record);
int insertSelective(TrainContent record);
List<TrainContent> selectByExample(TrainContentExample example);
TrainContent selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") TrainContent record, @Param("example") TrainContentExample example);
int updateByExample(@Param("record") TrainContent record, @Param("example") TrainContentExample example);
int updateByPrimaryKeySelective(TrainContent record);
int updateByPrimaryKey(TrainContent record);
}

17
bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainDao.java

@ -0,0 +1,17 @@
package com.wmeimob.bjyy.dao;
import com.wmeimob.bjyy.vo.TrainVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TrainDao {
/**
* 根据等级查询训练内容
* @param grade 等级
* @return 训练内容
*/
List<TrainVo.TrainContentVo> queryByLevel(@Param("level") byte grade);
}

30
bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainImgMapper.java

@ -0,0 +1,30 @@
package com.wmeimob.bjyy.dao;
import com.wmeimob.bjyy.model.TrainImg;
import com.wmeimob.bjyy.model.TrainImgExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TrainImgMapper {
long countByExample(TrainImgExample example);
int deleteByExample(TrainImgExample example);
int deleteByPrimaryKey(Integer id);
int insert(TrainImg record);
int insertSelective(TrainImg record);
List<TrainImg> selectByExample(TrainImgExample example);
TrainImg selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") TrainImg record, @Param("example") TrainImgExample example);
int updateByExample(@Param("record") TrainImg record, @Param("example") TrainImgExample example);
int updateByPrimaryKeySelective(TrainImg record);
int updateByPrimaryKey(TrainImg record);
}

30
bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainRecordMapper.java

@ -0,0 +1,30 @@
package com.wmeimob.bjyy.dao;
import com.wmeimob.bjyy.model.TrainRecord;
import com.wmeimob.bjyy.model.TrainRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TrainRecordMapper {
long countByExample(TrainRecordExample example);
int deleteByExample(TrainRecordExample example);
int deleteByPrimaryKey(Integer id);
int insert(TrainRecord record);
int insertSelective(TrainRecord record);
List<TrainRecord> selectByExample(TrainRecordExample example);
TrainRecord selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") TrainRecord record, @Param("example") TrainRecordExample example);
int updateByExample(@Param("record") TrainRecord record, @Param("example") TrainRecordExample example);
int updateByPrimaryKeySelective(TrainRecord record);
int updateByPrimaryKey(TrainRecord record);
}

238
bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/MentalTestMapper.xml

@ -1,210 +1,220 @@
<?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.wmeimob.bjyy.dao.MentalTestMapper" >
<resultMap id="BaseResultMap" type="com.wmeimob.bjyy.model.MentalTest" >
<id column="id" property="id" jdbcType="VARCHAR" />
<result column="user_id" property="userId" jdbcType="VARCHAR" />
<result column="from_type" property="fromType" jdbcType="TINYINT" />
<result column="memory_num" property="memoryNum" jdbcType="DECIMAL" />
<result column="express_num" property="expressNum" jdbcType="DECIMAL" />
<result column="view_num" property="viewNum" jdbcType="DECIMAL" />
<result column="attention_num" property="attentionNum" jdbcType="DECIMAL" />
<result column="direction_num" property="directionNum" jdbcType="DECIMAL" />
<result column="count_num" property="countNum" jdbcType="DECIMAL" />
<result column="logic_num" property="logicNum" jdbcType="DECIMAL" />
<result column="average_num" property="averageNum" jdbcType="DECIMAL" />
<result column="test_at" property="testAt" jdbcType="TIMESTAMP" />
<result column="grade_result" property="gradeResult" jdbcType="INTEGER" />
<result column="create_at" property="createAt" jdbcType="TIMESTAMP" />
<result column="update_at" property="updateAt" jdbcType="TIMESTAMP" />
<result column="status" property="status" jdbcType="BIT" />
<?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.wmeimob.bjyy.dao.MentalTestMapper">
<resultMap id="BaseResultMap" type="com.wmeimob.bjyy.model.MentalTest">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="memory_num" jdbcType="DECIMAL" property="memoryNum" />
<result column="express_num" jdbcType="DECIMAL" property="expressNum" />
<result column="view_num" jdbcType="DECIMAL" property="viewNum" />
<result column="attention_num" jdbcType="DECIMAL" property="attentionNum" />
<result column="direction_num" jdbcType="DECIMAL" property="directionNum" />
<result column="count_num" jdbcType="DECIMAL" property="countNum" />
<result column="logic_num" jdbcType="DECIMAL" property="logicNum" />
<result column="average_num" jdbcType="DECIMAL" property="averageNum" />
<result column="from_type" jdbcType="TINYINT" property="fromType" />
<result column="grade_result" jdbcType="INTEGER" property="gradeResult" />
<result column="test_at" jdbcType="TIMESTAMP" property="testAt" />
<result column="create_at" jdbcType="TIMESTAMP" property="createAt" />
<result column="update_at" jdbcType="TIMESTAMP" property="updateAt" />
<result column="status" jdbcType="BIT" property="status" />
<result column="pdf_url" jdbcType="VARCHAR" property="pdfUrl" />
</resultMap>
<sql id="Base_Column_List" >
id, user_id, from_type, memory_num, express_num, view_num, attention_num, direction_num,
count_num, logic_num, average_num, test_at, grade_result, create_at, update_at, status
<sql id="Base_Column_List">
id, user_id, memory_num, express_num, view_num, attention_num, direction_num, count_num,
logic_num, average_num, from_type, grade_result, test_at, create_at, update_at, status,
pdf_url
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from u_mental_test
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from u_mental_test
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.wmeimob.bjyy.model.MentalTest" >
insert into u_mental_test (id, user_id, from_type,
memory_num, express_num, view_num,
attention_num, direction_num, count_num,
logic_num, average_num, test_at,
grade_result, create_at, update_at,
status)
values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{fromType,jdbcType=TINYINT},
#{memoryNum,jdbcType=DECIMAL}, #{expressNum,jdbcType=DECIMAL}, #{viewNum,jdbcType=DECIMAL},
#{attentionNum,jdbcType=DECIMAL}, #{directionNum,jdbcType=DECIMAL}, #{countNum,jdbcType=DECIMAL},
#{logicNum,jdbcType=DECIMAL}, #{averageNum,jdbcType=DECIMAL}, #{testAt,jdbcType=TIMESTAMP},
#{gradeResult,jdbcType=INTEGER}, #{createAt,jdbcType=TIMESTAMP}, #{updateAt,jdbcType=TIMESTAMP},
#{status,jdbcType=BIT})
<insert id="insert" parameterType="com.wmeimob.bjyy.model.MentalTest">
insert into u_mental_test (id, user_id, memory_num,
express_num, view_num, attention_num,
direction_num, count_num, logic_num,
average_num, from_type, grade_result,
test_at, create_at, update_at,
status, pdf_url)
values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{memoryNum,jdbcType=DECIMAL},
#{expressNum,jdbcType=DECIMAL}, #{viewNum,jdbcType=DECIMAL}, #{attentionNum,jdbcType=DECIMAL},
#{directionNum,jdbcType=DECIMAL}, #{countNum,jdbcType=DECIMAL}, #{logicNum,jdbcType=DECIMAL},
#{averageNum,jdbcType=DECIMAL}, #{fromType,jdbcType=BIT}, #{gradeResult,jdbcType=INTEGER},
#{testAt,jdbcType=TIMESTAMP}, #{createAt,jdbcType=TIMESTAMP}, #{updateAt,jdbcType=TIMESTAMP},
#{status,jdbcType=BIT}, #{pdfUrl,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.wmeimob.bjyy.model.MentalTest" >
<insert id="insertSelective" parameterType="com.wmeimob.bjyy.model.MentalTest">
insert into u_mental_test
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null" >
<if test="userId != null">
user_id,
</if>
<if test="fromType != null" >
from_type,
</if>
<if test="memoryNum != null" >
<if test="memoryNum != null">
memory_num,
</if>
<if test="expressNum != null" >
<if test="expressNum != null">
express_num,
</if>
<if test="viewNum != null" >
<if test="viewNum != null">
view_num,
</if>
<if test="attentionNum != null" >
<if test="attentionNum != null">
attention_num,
</if>
<if test="directionNum != null" >
<if test="directionNum != null">
direction_num,
</if>
<if test="countNum != null" >
<if test="countNum != null">
count_num,
</if>
<if test="logicNum != null" >
<if test="logicNum != null">
logic_num,
</if>
<if test="averageNum != null" >
<if test="averageNum != null">
average_num,
</if>
<if test="testAt != null" >
test_at,
<if test="fromType != null">
from_type,
</if>
<if test="gradeResult != null" >
<if test="gradeResult != null">
grade_result,
</if>
<if test="createAt != null" >
<if test="testAt != null">
test_at,
</if>
<if test="createAt != null">
create_at,
</if>
<if test="updateAt != null" >
<if test="updateAt != null">
update_at,
</if>
<if test="status != null" >
<if test="status != null">
status,
</if>
<if test="pdfUrl != null">
pdf_url,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="userId != null" >
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="fromType != null" >
#{fromType,jdbcType=TINYINT},
</if>
<if test="memoryNum != null" >
<if test="memoryNum != null">
#{memoryNum,jdbcType=DECIMAL},
</if>
<if test="expressNum != null" >
<if test="expressNum != null">
#{expressNum,jdbcType=DECIMAL},
</if>
<if test="viewNum != null" >
<if test="viewNum != null">
#{viewNum,jdbcType=DECIMAL},
</if>
<if test="attentionNum != null" >
<if test="attentionNum != null">
#{attentionNum,jdbcType=DECIMAL},
</if>
<if test="directionNum != null" >
<if test="directionNum != null">
#{directionNum,jdbcType=DECIMAL},
</if>
<if test="countNum != null" >
<if test="countNum != null">
#{countNum,jdbcType=DECIMAL},
</if>
<if test="logicNum != null" >
<if test="logicNum != null">
#{logicNum,jdbcType=DECIMAL},
</if>
<if test="averageNum != null" >
<if test="averageNum != null">
#{averageNum,jdbcType=DECIMAL},
</if>
<if test="testAt != null" >
#{testAt,jdbcType=TIMESTAMP},
<if test="fromType != null">
#{fromType,jdbcType=BIT},
</if>
<if test="gradeResult != null" >
<if test="gradeResult != null">
#{gradeResult,jdbcType=INTEGER},
</if>
<if test="createAt != null" >
<if test="testAt != null">
#{testAt,jdbcType=TIMESTAMP},
</if>
<if test="createAt != null">
#{createAt,jdbcType=TIMESTAMP},
</if>
<if test="updateAt != null" >
<if test="updateAt != null">
#{updateAt,jdbcType=TIMESTAMP},
</if>
<if test="status != null" >
<if test="status != null">
#{status,jdbcType=BIT},
</if>
<if test="pdfUrl != null">
#{pdfUrl,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.wmeimob.bjyy.model.MentalTest" >
<update id="updateByPrimaryKeySelective" parameterType="com.wmeimob.bjyy.model.MentalTest">
update u_mental_test
<set >
<if test="userId != null" >
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="fromType != null" >
from_type = #{fromType,jdbcType=TINYINT},
</if>
<if test="memoryNum != null" >
<if test="memoryNum != null">
memory_num = #{memoryNum,jdbcType=DECIMAL},
</if>
<if test="expressNum != null" >
<if test="expressNum != null">
express_num = #{expressNum,jdbcType=DECIMAL},
</if>
<if test="viewNum != null" >
<if test="viewNum != null">
view_num = #{viewNum,jdbcType=DECIMAL},
</if>
<if test="attentionNum != null" >
<if test="attentionNum != null">
attention_num = #{attentionNum,jdbcType=DECIMAL},
</if>
<if test="directionNum != null" >
<if test="directionNum != null">
direction_num = #{directionNum,jdbcType=DECIMAL},
</if>
<if test="countNum != null" >
<if test="countNum != null">
count_num = #{countNum,jdbcType=DECIMAL},
</if>
<if test="logicNum != null" >
<if test="logicNum != null">
logic_num = #{logicNum,jdbcType=DECIMAL},
</if>
<if test="averageNum != null" >
<if test="averageNum != null">
average_num = #{averageNum,jdbcType=DECIMAL},
</if>
<if test="testAt != null" >
test_at = #{testAt,jdbcType=TIMESTAMP},
<if test="fromType != null">
from_type = #{fromType,jdbcType=BIT},
</if>
<if test="gradeResult != null" >
<if test="gradeResult != null">
grade_result = #{gradeResult,jdbcType=INTEGER},
</if>
<if test="createAt != null" >
<if test="testAt != null">
test_at = #{testAt,jdbcType=TIMESTAMP},
</if>
<if test="createAt != null">
create_at = #{createAt,jdbcType=TIMESTAMP},
</if>
<if test="updateAt != null" >
<if test="updateAt != null">
update_at = #{updateAt,jdbcType=TIMESTAMP},
</if>
<if test="status != null" >
<if test="status != null">
status = #{status,jdbcType=BIT},
</if>
<if test="pdfUrl != null">
pdf_url = #{pdfUrl,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.wmeimob.bjyy.model.MentalTest" >
<update id="updateByPrimaryKey" parameterType="com.wmeimob.bjyy.model.MentalTest">
update u_mental_test
set user_id = #{userId,jdbcType=VARCHAR},
from_type = #{fromType,jdbcType=TINYINT},
memory_num = #{memoryNum,jdbcType=DECIMAL},
express_num = #{expressNum,jdbcType=DECIMAL},
view_num = #{viewNum,jdbcType=DECIMAL},
@ -213,47 +223,49 @@
count_num = #{countNum,jdbcType=DECIMAL},
logic_num = #{logicNum,jdbcType=DECIMAL},
average_num = #{averageNum,jdbcType=DECIMAL},
test_at = #{testAt,jdbcType=TIMESTAMP},
from_type = #{fromType,jdbcType=BIT},
grade_result = #{gradeResult,jdbcType=INTEGER},
test_at = #{testAt,jdbcType=TIMESTAMP},
create_at = #{createAt,jdbcType=TIMESTAMP},
update_at = #{updateAt,jdbcType=TIMESTAMP},
status = #{status,jdbcType=BIT}
status = #{status,jdbcType=BIT},
pdf_url = #{pdfUrl,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<!-- <select id="selectRecentMental" resultMap="BaseResultMap"> -->
<!-- &lt;select id="selectRecentMental" resultMap="BaseResultMap"&gt; -->
<!-- select -->
<!-- <include refid="Base_Column_List" /> -->
<!-- &lt;include refid="Base_Column_List" /&gt; -->
<!-- from u_mental_test -->
<!-- where status=1 -->
<!-- <if test="userId != null and userId!='' " > -->
<!-- &lt;if test="userId != null and userId!='' " &gt; -->
<!-- and user_id = #{userId,jdbcType=VARCHAR} -->
<!-- </if> -->
<!-- and DATE(create_at) &gt; = (SELECT DATE_ADD(CURDATE(),INTERVAL -2 MONTH)) -->
<!-- &lt;/if&gt; -->
<!-- and DATE(create_at) &amp;gt; = (SELECT DATE_ADD(CURDATE(),INTERVAL -2 MONTH)) -->
<!-- limit 1 -->
<!-- </select> -->
<!-- &lt;/select&gt; -->
<select id="selectMentalRecordNewest" resultMap="BaseResultMap" parameterType="java.lang.String" >
<select id="selectMentalRecordNewest" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from u_mental_test
where status=1
<if test="userId != null" >
<if test="userId != null">
and user_id = #{userId,jdbcType=VARCHAR}
and create_at = (select ifnull(max(create_at),now()) from u_mental_test where status=1 and user_id = #{userId,jdbcType=VARCHAR})
</if>
</select>
<select id="selectMentalRecordTop" resultMap="BaseResultMap" parameterType="java.lang.String" >
<select id="selectMentalRecordTop" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from u_mental_test
where status=1
<if test="userId != null" >
<if test="userId != null">
and user_id = #{userId,jdbcType=VARCHAR}
</if>
GROUP BY user_id

243
bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainAidMapper.xml

@ -0,0 +1,243 @@
<?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.wmeimob.bjyy.dao.TrainAidMapper">
<resultMap id="BaseResultMap" type="com.wmeimob.bjyy.model.TrainAid">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="update_at" jdbcType="TIMESTAMP" property="updateAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, description, user_id, created_at, update_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.wmeimob.bjyy.model.TrainAidExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_train_aid
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_train_aid
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_train_aid
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wmeimob.bjyy.model.TrainAidExample">
delete from t_train_aid
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wmeimob.bjyy.model.TrainAid">
insert into t_train_aid (id, name, description,
user_id, created_at, update_at,
rec_status)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{userId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updateAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.wmeimob.bjyy.model.TrainAid">
insert into t_train_aid
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="description != null">
description,
</if>
<if test="userId != null">
user_id,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updateAt != null">
update_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updateAt != null">
#{updateAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wmeimob.bjyy.model.TrainAidExample" resultType="java.lang.Long">
select count(*) from t_train_aid
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_train_aid
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updateAt != null">
update_at = #{record.updateAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_train_aid
set id = #{record.id,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
update_at = #{record.updateAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wmeimob.bjyy.model.TrainAid">
update t_train_aid
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updateAt != null">
update_at = #{updateAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wmeimob.bjyy.model.TrainAid">
update t_train_aid
set name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
update_at = #{updateAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

258
bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainContentMapper.xml

@ -0,0 +1,258 @@
<?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.wmeimob.bjyy.dao.TrainContentMapper">
<resultMap id="BaseResultMap" type="com.wmeimob.bjyy.model.TrainContent">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="aid_id" jdbcType="INTEGER" property="aidId" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="level" jdbcType="TINYINT" property="level" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="update_at" jdbcType="TIMESTAMP" property="updateAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, aid_id, content, level, user_id, created_at, update_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.wmeimob.bjyy.model.TrainContentExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_train_content
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_train_content
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_train_content
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wmeimob.bjyy.model.TrainContentExample">
delete from t_train_content
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wmeimob.bjyy.model.TrainContent">
insert into t_train_content (id, aid_id, content,
level, user_id, created_at,
update_at, rec_status)
values (#{id,jdbcType=INTEGER}, #{aidId,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR},
#{level,jdbcType=TINYINT}, #{userId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updateAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.wmeimob.bjyy.model.TrainContent">
insert into t_train_content
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="aidId != null">
aid_id,
</if>
<if test="content != null">
content,
</if>
<if test="level != null">
level,
</if>
<if test="userId != null">
user_id,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updateAt != null">
update_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="aidId != null">
#{aidId,jdbcType=INTEGER},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="level != null">
#{level,jdbcType=TINYINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updateAt != null">
#{updateAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wmeimob.bjyy.model.TrainContentExample" resultType="java.lang.Long">
select count(*) from t_train_content
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_train_content
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.aidId != null">
aid_id = #{record.aidId,jdbcType=INTEGER},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
</if>
<if test="record.level != null">
level = #{record.level,jdbcType=TINYINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updateAt != null">
update_at = #{record.updateAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_train_content
set id = #{record.id,jdbcType=INTEGER},
aid_id = #{record.aidId,jdbcType=INTEGER},
content = #{record.content,jdbcType=VARCHAR},
level = #{record.level,jdbcType=TINYINT},
user_id = #{record.userId,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
update_at = #{record.updateAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wmeimob.bjyy.model.TrainContent">
update t_train_content
<set>
<if test="aidId != null">
aid_id = #{aidId,jdbcType=INTEGER},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="level != null">
level = #{level,jdbcType=TINYINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updateAt != null">
update_at = #{updateAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wmeimob.bjyy.model.TrainContent">
update t_train_content
set aid_id = #{aidId,jdbcType=INTEGER},
content = #{content,jdbcType=VARCHAR},
level = #{level,jdbcType=TINYINT},
user_id = #{userId,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
update_at = #{updateAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

49
bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainDao.xml

@ -0,0 +1,49 @@
<?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.wmeimob.bjyy.dao.TrainDao">
<resultMap id="contentMap" type="com.wmeimob.bjyy.vo.TrainVo$TrainContentVo">
<id column="aidId" property="id"/>
<result column="name" property="name"/>
<result column="description" property="description"/>
<collection property="contentVos" ofType="com.wmeimob.bjyy.vo.TrainVo$ContentVo">
<id column="id" property="id"/>
<result column="content" property="content"/>
<collection property="images" ofType="com.wmeimob.bjyy.vo.TrainVo$ContentImage">
<result column="url" property="url"/>
</collection>
</collection>
</resultMap>
<select id="queryByLevel" resultMap="contentMap">
SELECT
a.id AS aidId,
a.name,
a.description,
c.id,
c.content,
c.url
FROM
t_train_aid a,
(
SELECT
c.aid_id,
c.id,
c.content,
i.url
FROM
t_train_content c
LEFT JOIN t_train_img i ON c.id = i.content_id
AND i.rec_status = 0
WHERE
c.LEVEL = 1
and c.rec_status = 0
) c
WHERE
a.id = c.aid_id
and a.rec_status = 0
ORDER BY
a.id,
c.id
</select>
</mapper>

258
bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainImgMapper.xml

@ -0,0 +1,258 @@
<?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.wmeimob.bjyy.dao.TrainImgMapper">
<resultMap id="BaseResultMap" type="com.wmeimob.bjyy.model.TrainImg">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="content_id" jdbcType="INTEGER" property="contentId" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="sort" jdbcType="TINYINT" property="sort" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="update_at" jdbcType="TIMESTAMP" property="updateAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, content_id, url, sort, user_id, created_at, update_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.wmeimob.bjyy.model.TrainImgExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_train_img
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_train_img
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_train_img
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wmeimob.bjyy.model.TrainImgExample">
delete from t_train_img
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wmeimob.bjyy.model.TrainImg">
insert into t_train_img (id, content_id, url,
sort, user_id, created_at,
update_at, rec_status)
values (#{id,jdbcType=INTEGER}, #{contentId,jdbcType=INTEGER}, #{url,jdbcType=VARCHAR},
#{sort,jdbcType=TINYINT}, #{userId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updateAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.wmeimob.bjyy.model.TrainImg">
insert into t_train_img
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="contentId != null">
content_id,
</if>
<if test="url != null">
url,
</if>
<if test="sort != null">
sort,
</if>
<if test="userId != null">
user_id,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updateAt != null">
update_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="contentId != null">
#{contentId,jdbcType=INTEGER},
</if>
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=TINYINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updateAt != null">
#{updateAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wmeimob.bjyy.model.TrainImgExample" resultType="java.lang.Long">
select count(*) from t_train_img
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_train_img
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.contentId != null">
content_id = #{record.contentId,jdbcType=INTEGER},
</if>
<if test="record.url != null">
url = #{record.url,jdbcType=VARCHAR},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=TINYINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updateAt != null">
update_at = #{record.updateAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_train_img
set id = #{record.id,jdbcType=INTEGER},
content_id = #{record.contentId,jdbcType=INTEGER},
url = #{record.url,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=TINYINT},
user_id = #{record.userId,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
update_at = #{record.updateAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wmeimob.bjyy.model.TrainImg">
update t_train_img
<set>
<if test="contentId != null">
content_id = #{contentId,jdbcType=INTEGER},
</if>
<if test="url != null">
url = #{url,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=TINYINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updateAt != null">
update_at = #{updateAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wmeimob.bjyy.model.TrainImg">
update t_train_img
set content_id = #{contentId,jdbcType=INTEGER},
url = #{url,jdbcType=VARCHAR},
sort = #{sort,jdbcType=TINYINT},
user_id = #{userId,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
update_at = #{updateAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

243
bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainRecordMapper.xml

@ -0,0 +1,243 @@
<?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.wmeimob.bjyy.dao.TrainRecordMapper">
<resultMap id="BaseResultMap" type="com.wmeimob.bjyy.model.TrainRecord">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="test_id" jdbcType="VARCHAR" property="testId" />
<result column="question_id" jdbcType="INTEGER" property="questionId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="update_at" jdbcType="TIMESTAMP" property="updateAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, test_id, question_id, user_id, created_at, update_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.wmeimob.bjyy.model.TrainRecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_train_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_train_record
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_train_record
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wmeimob.bjyy.model.TrainRecordExample">
delete from t_train_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wmeimob.bjyy.model.TrainRecord">
insert into t_train_record (id, test_id, question_id,
user_id, created_at, update_at,
rec_status)
values (#{id,jdbcType=INTEGER}, #{testId,jdbcType=VARCHAR}, #{questionId,jdbcType=INTEGER},
#{userId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updateAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.wmeimob.bjyy.model.TrainRecord">
insert into t_train_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="testId != null">
test_id,
</if>
<if test="questionId != null">
question_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updateAt != null">
update_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="testId != null">
#{testId,jdbcType=VARCHAR},
</if>
<if test="questionId != null">
#{questionId,jdbcType=INTEGER},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updateAt != null">
#{updateAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wmeimob.bjyy.model.TrainRecordExample" resultType="java.lang.Long">
select count(*) from t_train_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_train_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.testId != null">
test_id = #{record.testId,jdbcType=VARCHAR},
</if>
<if test="record.questionId != null">
question_id = #{record.questionId,jdbcType=INTEGER},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updateAt != null">
update_at = #{record.updateAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_train_record
set id = #{record.id,jdbcType=INTEGER},
test_id = #{record.testId,jdbcType=VARCHAR},
question_id = #{record.questionId,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
update_at = #{record.updateAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wmeimob.bjyy.model.TrainRecord">
update t_train_record
<set>
<if test="testId != null">
test_id = #{testId,jdbcType=VARCHAR},
</if>
<if test="questionId != null">
question_id = #{questionId,jdbcType=INTEGER},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updateAt != null">
update_at = #{updateAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wmeimob.bjyy.model.TrainRecord">
update t_train_record
set test_id = #{testId,jdbcType=VARCHAR},
question_id = #{questionId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
update_at = #{updateAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

45
bjyy-dal/src/main/java/com/wmeimob/bjyy/model/MentalTest.java

@ -9,8 +9,6 @@ public class MentalTest implements Serializable {
private String userId;
private Byte fromType;
private BigDecimal memoryNum;
private BigDecimal expressNum;
@ -27,16 +25,20 @@ public class MentalTest implements Serializable {
private BigDecimal averageNum;
private Date testAt;
private byte fromType;
private Integer gradeResult;
private Date testAt;
private Date createAt;
private Date updateAt;
private Boolean status;
private String pdfUrl;
private static final long serialVersionUID = 1L;
public String getId() {
@ -55,14 +57,6 @@ public class MentalTest implements Serializable {
this.userId = userId == null ? null : userId.trim();
}
public Byte getFromType() {
return fromType;
}
public void setFromType(Byte fromType) {
this.fromType = fromType;
}
public BigDecimal getMemoryNum() {
return memoryNum;
}
@ -127,12 +121,12 @@ public class MentalTest implements Serializable {
this.averageNum = averageNum;
}
public Date getTestAt() {
return testAt;
public byte getFromType() {
return fromType;
}
public void setTestAt(Date testAt) {
this.testAt = testAt;
public void setFromType(byte fromType) {
this.fromType = fromType;
}
public Integer getGradeResult() {
@ -143,6 +137,14 @@ public class MentalTest implements Serializable {
this.gradeResult = gradeResult;
}
public Date getTestAt() {
return testAt;
}
public void setTestAt(Date testAt) {
this.testAt = testAt;
}
public Date getCreateAt() {
return createAt;
}
@ -167,6 +169,14 @@ public class MentalTest implements Serializable {
this.status = status;
}
public String getPdfUrl() {
return pdfUrl;
}
public void setPdfUrl(String pdfUrl) {
this.pdfUrl = pdfUrl == null ? null : pdfUrl.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -175,7 +185,6 @@ public class MentalTest implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", fromType=").append(fromType);
sb.append(", memoryNum=").append(memoryNum);
sb.append(", expressNum=").append(expressNum);
sb.append(", viewNum=").append(viewNum);
@ -184,11 +193,13 @@ public class MentalTest implements Serializable {
sb.append(", countNum=").append(countNum);
sb.append(", logicNum=").append(logicNum);
sb.append(", averageNum=").append(averageNum);
sb.append(", testAt=").append(testAt);
sb.append(", fromType=").append(fromType);
sb.append(", gradeResult=").append(gradeResult);
sb.append(", testAt=").append(testAt);
sb.append(", createAt=").append(createAt);
sb.append(", updateAt=").append(updateAt);
sb.append(", status=").append(status);
sb.append(", pdfUrl=").append(pdfUrl);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

96
bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainAid.java

@ -0,0 +1,96 @@
package com.wmeimob.bjyy.model;
import java.io.Serializable;
import java.util.Date;
public class TrainAid implements Serializable {
private Integer id;
private String name;
private String description;
private Long userId;
private Date createdAt;
private Date updateAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdateAt() {
return updateAt;
}
public void setUpdateAt(Date updateAt) {
this.updateAt = updateAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", description=").append(description);
sb.append(", userId=").append(userId);
sb.append(", createdAt=").append(createdAt);
sb.append(", updateAt=").append(updateAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

641
bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainAidExample.java

@ -0,0 +1,641 @@
package com.wmeimob.bjyy.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TrainAidExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TrainAidExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andDescriptionIsNull() {
addCriterion("description is null");
return (Criteria) this;
}
public Criteria andDescriptionIsNotNull() {
addCriterion("description is not null");
return (Criteria) this;
}
public Criteria andDescriptionEqualTo(String value) {
addCriterion("description =", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotEqualTo(String value) {
addCriterion("description <>", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionGreaterThan(String value) {
addCriterion("description >", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
addCriterion("description >=", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLessThan(String value) {
addCriterion("description <", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLessThanOrEqualTo(String value) {
addCriterion("description <=", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLike(String value) {
addCriterion("description like", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotLike(String value) {
addCriterion("description not like", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionIn(List<String> values) {
addCriterion("description in", values, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotIn(List<String> values) {
addCriterion("description not in", values, "description");
return (Criteria) this;
}
public Criteria andDescriptionBetween(String value1, String value2) {
addCriterion("description between", value1, value2, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotBetween(String value1, String value2) {
addCriterion("description not between", value1, value2, "description");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdateAtIsNull() {
addCriterion("update_at is null");
return (Criteria) this;
}
public Criteria andUpdateAtIsNotNull() {
addCriterion("update_at is not null");
return (Criteria) this;
}
public Criteria andUpdateAtEqualTo(Date value) {
addCriterion("update_at =", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtNotEqualTo(Date value) {
addCriterion("update_at <>", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtGreaterThan(Date value) {
addCriterion("update_at >", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtGreaterThanOrEqualTo(Date value) {
addCriterion("update_at >=", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtLessThan(Date value) {
addCriterion("update_at <", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtLessThanOrEqualTo(Date value) {
addCriterion("update_at <=", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtIn(List<Date> values) {
addCriterion("update_at in", values, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtNotIn(List<Date> values) {
addCriterion("update_at not in", values, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtBetween(Date value1, Date value2) {
addCriterion("update_at between", value1, value2, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtNotBetween(Date value1, Date value2) {
addCriterion("update_at not between", value1, value2, "updateAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

107
bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainContent.java

@ -0,0 +1,107 @@
package com.wmeimob.bjyy.model;
import java.io.Serializable;
import java.util.Date;
public class TrainContent implements Serializable {
private Integer id;
private Integer aidId;
private String content;
private Byte level;
private Long userId;
private Date createdAt;
private Date updateAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getAidId() {
return aidId;
}
public void setAidId(Integer aidId) {
this.aidId = aidId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
public Byte getLevel() {
return level;
}
public void setLevel(Byte level) {
this.level = level;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdateAt() {
return updateAt;
}
public void setUpdateAt(Date updateAt) {
this.updateAt = updateAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", aidId=").append(aidId);
sb.append(", content=").append(content);
sb.append(", level=").append(level);
sb.append(", userId=").append(userId);
sb.append(", createdAt=").append(createdAt);
sb.append(", updateAt=").append(updateAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

691
bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainContentExample.java

@ -0,0 +1,691 @@
package com.wmeimob.bjyy.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TrainContentExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TrainContentExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andAidIdIsNull() {
addCriterion("aid_id is null");
return (Criteria) this;
}
public Criteria andAidIdIsNotNull() {
addCriterion("aid_id is not null");
return (Criteria) this;
}
public Criteria andAidIdEqualTo(Integer value) {
addCriterion("aid_id =", value, "aidId");
return (Criteria) this;
}
public Criteria andAidIdNotEqualTo(Integer value) {
addCriterion("aid_id <>", value, "aidId");
return (Criteria) this;
}
public Criteria andAidIdGreaterThan(Integer value) {
addCriterion("aid_id >", value, "aidId");
return (Criteria) this;
}
public Criteria andAidIdGreaterThanOrEqualTo(Integer value) {
addCriterion("aid_id >=", value, "aidId");
return (Criteria) this;
}
public Criteria andAidIdLessThan(Integer value) {
addCriterion("aid_id <", value, "aidId");
return (Criteria) this;
}
public Criteria andAidIdLessThanOrEqualTo(Integer value) {
addCriterion("aid_id <=", value, "aidId");
return (Criteria) this;
}
public Criteria andAidIdIn(List<Integer> values) {
addCriterion("aid_id in", values, "aidId");
return (Criteria) this;
}
public Criteria andAidIdNotIn(List<Integer> values) {
addCriterion("aid_id not in", values, "aidId");
return (Criteria) this;
}
public Criteria andAidIdBetween(Integer value1, Integer value2) {
addCriterion("aid_id between", value1, value2, "aidId");
return (Criteria) this;
}
public Criteria andAidIdNotBetween(Integer value1, Integer value2) {
addCriterion("aid_id not between", value1, value2, "aidId");
return (Criteria) this;
}
public Criteria andContentIsNull() {
addCriterion("content is null");
return (Criteria) this;
}
public Criteria andContentIsNotNull() {
addCriterion("content is not null");
return (Criteria) this;
}
public Criteria andContentEqualTo(String value) {
addCriterion("content =", value, "content");
return (Criteria) this;
}
public Criteria andContentNotEqualTo(String value) {
addCriterion("content <>", value, "content");
return (Criteria) this;
}
public Criteria andContentGreaterThan(String value) {
addCriterion("content >", value, "content");
return (Criteria) this;
}
public Criteria andContentGreaterThanOrEqualTo(String value) {
addCriterion("content >=", value, "content");
return (Criteria) this;
}
public Criteria andContentLessThan(String value) {
addCriterion("content <", value, "content");
return (Criteria) this;
}
public Criteria andContentLessThanOrEqualTo(String value) {
addCriterion("content <=", value, "content");
return (Criteria) this;
}
public Criteria andContentLike(String value) {
addCriterion("content like", value, "content");
return (Criteria) this;
}
public Criteria andContentNotLike(String value) {
addCriterion("content not like", value, "content");
return (Criteria) this;
}
public Criteria andContentIn(List<String> values) {
addCriterion("content in", values, "content");
return (Criteria) this;
}
public Criteria andContentNotIn(List<String> values) {
addCriterion("content not in", values, "content");
return (Criteria) this;
}
public Criteria andContentBetween(String value1, String value2) {
addCriterion("content between", value1, value2, "content");
return (Criteria) this;
}
public Criteria andContentNotBetween(String value1, String value2) {
addCriterion("content not between", value1, value2, "content");
return (Criteria) this;
}
public Criteria andLevelIsNull() {
addCriterion("level is null");
return (Criteria) this;
}
public Criteria andLevelIsNotNull() {
addCriterion("level is not null");
return (Criteria) this;
}
public Criteria andLevelEqualTo(Byte value) {
addCriterion("level =", value, "level");
return (Criteria) this;
}
public Criteria andLevelNotEqualTo(Byte value) {
addCriterion("level <>", value, "level");
return (Criteria) this;
}
public Criteria andLevelGreaterThan(Byte value) {
addCriterion("level >", value, "level");
return (Criteria) this;
}
public Criteria andLevelGreaterThanOrEqualTo(Byte value) {
addCriterion("level >=", value, "level");
return (Criteria) this;
}
public Criteria andLevelLessThan(Byte value) {
addCriterion("level <", value, "level");
return (Criteria) this;
}
public Criteria andLevelLessThanOrEqualTo(Byte value) {
addCriterion("level <=", value, "level");
return (Criteria) this;
}
public Criteria andLevelIn(List<Byte> values) {
addCriterion("level in", values, "level");
return (Criteria) this;
}
public Criteria andLevelNotIn(List<Byte> values) {
addCriterion("level not in", values, "level");
return (Criteria) this;
}
public Criteria andLevelBetween(Byte value1, Byte value2) {
addCriterion("level between", value1, value2, "level");
return (Criteria) this;
}
public Criteria andLevelNotBetween(Byte value1, Byte value2) {
addCriterion("level not between", value1, value2, "level");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdateAtIsNull() {
addCriterion("update_at is null");
return (Criteria) this;
}
public Criteria andUpdateAtIsNotNull() {
addCriterion("update_at is not null");
return (Criteria) this;
}
public Criteria andUpdateAtEqualTo(Date value) {
addCriterion("update_at =", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtNotEqualTo(Date value) {
addCriterion("update_at <>", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtGreaterThan(Date value) {
addCriterion("update_at >", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtGreaterThanOrEqualTo(Date value) {
addCriterion("update_at >=", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtLessThan(Date value) {
addCriterion("update_at <", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtLessThanOrEqualTo(Date value) {
addCriterion("update_at <=", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtIn(List<Date> values) {
addCriterion("update_at in", values, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtNotIn(List<Date> values) {
addCriterion("update_at not in", values, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtBetween(Date value1, Date value2) {
addCriterion("update_at between", value1, value2, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtNotBetween(Date value1, Date value2) {
addCriterion("update_at not between", value1, value2, "updateAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

107
bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainImg.java

@ -0,0 +1,107 @@
package com.wmeimob.bjyy.model;
import java.io.Serializable;
import java.util.Date;
public class TrainImg implements Serializable {
private Integer id;
private Integer contentId;
private String url;
private Byte sort;
private Long userId;
private Date createdAt;
private Date updateAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getContentId() {
return contentId;
}
public void setContentId(Integer contentId) {
this.contentId = contentId;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url == null ? null : url.trim();
}
public Byte getSort() {
return sort;
}
public void setSort(Byte sort) {
this.sort = sort;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdateAt() {
return updateAt;
}
public void setUpdateAt(Date updateAt) {
this.updateAt = updateAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", contentId=").append(contentId);
sb.append(", url=").append(url);
sb.append(", sort=").append(sort);
sb.append(", userId=").append(userId);
sb.append(", createdAt=").append(createdAt);
sb.append(", updateAt=").append(updateAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

691
bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainImgExample.java

@ -0,0 +1,691 @@
package com.wmeimob.bjyy.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TrainImgExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TrainImgExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andContentIdIsNull() {
addCriterion("content_id is null");
return (Criteria) this;
}
public Criteria andContentIdIsNotNull() {
addCriterion("content_id is not null");
return (Criteria) this;
}
public Criteria andContentIdEqualTo(Integer value) {
addCriterion("content_id =", value, "contentId");
return (Criteria) this;
}
public Criteria andContentIdNotEqualTo(Integer value) {
addCriterion("content_id <>", value, "contentId");
return (Criteria) this;
}
public Criteria andContentIdGreaterThan(Integer value) {
addCriterion("content_id >", value, "contentId");
return (Criteria) this;
}
public Criteria andContentIdGreaterThanOrEqualTo(Integer value) {
addCriterion("content_id >=", value, "contentId");
return (Criteria) this;
}
public Criteria andContentIdLessThan(Integer value) {
addCriterion("content_id <", value, "contentId");
return (Criteria) this;
}
public Criteria andContentIdLessThanOrEqualTo(Integer value) {
addCriterion("content_id <=", value, "contentId");
return (Criteria) this;
}
public Criteria andContentIdIn(List<Integer> values) {
addCriterion("content_id in", values, "contentId");
return (Criteria) this;
}
public Criteria andContentIdNotIn(List<Integer> values) {
addCriterion("content_id not in", values, "contentId");
return (Criteria) this;
}
public Criteria andContentIdBetween(Integer value1, Integer value2) {
addCriterion("content_id between", value1, value2, "contentId");
return (Criteria) this;
}
public Criteria andContentIdNotBetween(Integer value1, Integer value2) {
addCriterion("content_id not between", value1, value2, "contentId");
return (Criteria) this;
}
public Criteria andUrlIsNull() {
addCriterion("url is null");
return (Criteria) this;
}
public Criteria andUrlIsNotNull() {
addCriterion("url is not null");
return (Criteria) this;
}
public Criteria andUrlEqualTo(String value) {
addCriterion("url =", value, "url");
return (Criteria) this;
}
public Criteria andUrlNotEqualTo(String value) {
addCriterion("url <>", value, "url");
return (Criteria) this;
}
public Criteria andUrlGreaterThan(String value) {
addCriterion("url >", value, "url");
return (Criteria) this;
}
public Criteria andUrlGreaterThanOrEqualTo(String value) {
addCriterion("url >=", value, "url");
return (Criteria) this;
}
public Criteria andUrlLessThan(String value) {
addCriterion("url <", value, "url");
return (Criteria) this;
}
public Criteria andUrlLessThanOrEqualTo(String value) {
addCriterion("url <=", value, "url");
return (Criteria) this;
}
public Criteria andUrlLike(String value) {
addCriterion("url like", value, "url");
return (Criteria) this;
}
public Criteria andUrlNotLike(String value) {
addCriterion("url not like", value, "url");
return (Criteria) this;
}
public Criteria andUrlIn(List<String> values) {
addCriterion("url in", values, "url");
return (Criteria) this;
}
public Criteria andUrlNotIn(List<String> values) {
addCriterion("url not in", values, "url");
return (Criteria) this;
}
public Criteria andUrlBetween(String value1, String value2) {
addCriterion("url between", value1, value2, "url");
return (Criteria) this;
}
public Criteria andUrlNotBetween(String value1, String value2) {
addCriterion("url not between", value1, value2, "url");
return (Criteria) this;
}
public Criteria andSortIsNull() {
addCriterion("sort is null");
return (Criteria) this;
}
public Criteria andSortIsNotNull() {
addCriterion("sort is not null");
return (Criteria) this;
}
public Criteria andSortEqualTo(Byte value) {
addCriterion("sort =", value, "sort");
return (Criteria) this;
}
public Criteria andSortNotEqualTo(Byte value) {
addCriterion("sort <>", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThan(Byte value) {
addCriterion("sort >", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThanOrEqualTo(Byte value) {
addCriterion("sort >=", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThan(Byte value) {
addCriterion("sort <", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThanOrEqualTo(Byte value) {
addCriterion("sort <=", value, "sort");
return (Criteria) this;
}
public Criteria andSortIn(List<Byte> values) {
addCriterion("sort in", values, "sort");
return (Criteria) this;
}
public Criteria andSortNotIn(List<Byte> values) {
addCriterion("sort not in", values, "sort");
return (Criteria) this;
}
public Criteria andSortBetween(Byte value1, Byte value2) {
addCriterion("sort between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andSortNotBetween(Byte value1, Byte value2) {
addCriterion("sort not between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdateAtIsNull() {
addCriterion("update_at is null");
return (Criteria) this;
}
public Criteria andUpdateAtIsNotNull() {
addCriterion("update_at is not null");
return (Criteria) this;
}
public Criteria andUpdateAtEqualTo(Date value) {
addCriterion("update_at =", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtNotEqualTo(Date value) {
addCriterion("update_at <>", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtGreaterThan(Date value) {
addCriterion("update_at >", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtGreaterThanOrEqualTo(Date value) {
addCriterion("update_at >=", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtLessThan(Date value) {
addCriterion("update_at <", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtLessThanOrEqualTo(Date value) {
addCriterion("update_at <=", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtIn(List<Date> values) {
addCriterion("update_at in", values, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtNotIn(List<Date> values) {
addCriterion("update_at not in", values, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtBetween(Date value1, Date value2) {
addCriterion("update_at between", value1, value2, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtNotBetween(Date value1, Date value2) {
addCriterion("update_at not between", value1, value2, "updateAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

96
bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainRecord.java

@ -0,0 +1,96 @@
package com.wmeimob.bjyy.model;
import java.io.Serializable;
import java.util.Date;
public class TrainRecord implements Serializable {
private Integer id;
private String testId;
private Integer questionId;
private Long userId;
private Date createdAt;
private Date updateAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getTestId() {
return testId;
}
public void setTestId(String testId) {
this.testId = testId == null ? null : testId.trim();
}
public Integer getQuestionId() {
return questionId;
}
public void setQuestionId(Integer questionId) {
this.questionId = questionId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdateAt() {
return updateAt;
}
public void setUpdateAt(Date updateAt) {
this.updateAt = updateAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", testId=").append(testId);
sb.append(", questionId=").append(questionId);
sb.append(", userId=").append(userId);
sb.append(", createdAt=").append(createdAt);
sb.append(", updateAt=").append(updateAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

631
bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainRecordExample.java

@ -0,0 +1,631 @@
package com.wmeimob.bjyy.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TrainRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TrainRecordExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTestIdIsNull() {
addCriterion("test_id is null");
return (Criteria) this;
}
public Criteria andTestIdIsNotNull() {
addCriterion("test_id is not null");
return (Criteria) this;
}
public Criteria andTestIdEqualTo(String value) {
addCriterion("test_id =", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotEqualTo(String value) {
addCriterion("test_id <>", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdGreaterThan(String value) {
addCriterion("test_id >", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdGreaterThanOrEqualTo(String value) {
addCriterion("test_id >=", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLessThan(String value) {
addCriterion("test_id <", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLessThanOrEqualTo(String value) {
addCriterion("test_id <=", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdLike(String value) {
addCriterion("test_id like", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotLike(String value) {
addCriterion("test_id not like", value, "testId");
return (Criteria) this;
}
public Criteria andTestIdIn(List<String> values) {
addCriterion("test_id in", values, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotIn(List<String> values) {
addCriterion("test_id not in", values, "testId");
return (Criteria) this;
}
public Criteria andTestIdBetween(String value1, String value2) {
addCriterion("test_id between", value1, value2, "testId");
return (Criteria) this;
}
public Criteria andTestIdNotBetween(String value1, String value2) {
addCriterion("test_id not between", value1, value2, "testId");
return (Criteria) this;
}
public Criteria andQuestionIdIsNull() {
addCriterion("question_id is null");
return (Criteria) this;
}
public Criteria andQuestionIdIsNotNull() {
addCriterion("question_id is not null");
return (Criteria) this;
}
public Criteria andQuestionIdEqualTo(Integer value) {
addCriterion("question_id =", value, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdNotEqualTo(Integer value) {
addCriterion("question_id <>", value, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdGreaterThan(Integer value) {
addCriterion("question_id >", value, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdGreaterThanOrEqualTo(Integer value) {
addCriterion("question_id >=", value, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdLessThan(Integer value) {
addCriterion("question_id <", value, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdLessThanOrEqualTo(Integer value) {
addCriterion("question_id <=", value, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdIn(List<Integer> values) {
addCriterion("question_id in", values, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdNotIn(List<Integer> values) {
addCriterion("question_id not in", values, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdBetween(Integer value1, Integer value2) {
addCriterion("question_id between", value1, value2, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdNotBetween(Integer value1, Integer value2) {
addCriterion("question_id not between", value1, value2, "questionId");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdateAtIsNull() {
addCriterion("update_at is null");
return (Criteria) this;
}
public Criteria andUpdateAtIsNotNull() {
addCriterion("update_at is not null");
return (Criteria) this;
}
public Criteria andUpdateAtEqualTo(Date value) {
addCriterion("update_at =", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtNotEqualTo(Date value) {
addCriterion("update_at <>", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtGreaterThan(Date value) {
addCriterion("update_at >", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtGreaterThanOrEqualTo(Date value) {
addCriterion("update_at >=", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtLessThan(Date value) {
addCriterion("update_at <", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtLessThanOrEqualTo(Date value) {
addCriterion("update_at <=", value, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtIn(List<Date> values) {
addCriterion("update_at in", values, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtNotIn(List<Date> values) {
addCriterion("update_at not in", values, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtBetween(Date value1, Date value2) {
addCriterion("update_at between", value1, value2, "updateAt");
return (Criteria) this;
}
public Criteria andUpdateAtNotBetween(Date value1, Date value2) {
addCriterion("update_at not between", value1, value2, "updateAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

39
bjyy-dal/src/main/java/com/wmeimob/bjyy/vo/TrainVo.java

@ -0,0 +1,39 @@
package com.wmeimob.bjyy.vo;
import lombok.Data;
import java.util.List;
/**
* @description:
* @author: whj
* @time: 2021/2/5 15:51
*/
public class TrainVo {
@Data
public static class TrainContentVo{
/**教具*/
private String id;
private String name;
private String description;
/**题目*/
private List<ContentVo> contentVos;
}
@Data
public static class ContentVo{
/**题目ID*/
private int id;
/**内容*/
private String content;
/**图片*/
private List<ContentImage> images;
}
@Data
public static class ContentImage {
private String url;
}
}

49
bjyy-dal/src/main/resources/generatorConfig.xml

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<generatorConfiguration>
<!-- <properties resource="generatorConfig.properties" /> -->
<!--<classPathEntry location="mysql-connector-java-5.1.30.jar" />-->
<context id="context1">
<plugin type="org.mybatis.generator.plugins.SerializablePlugin" />
<plugin type="org.mybatis.generator.plugins.ToStringPlugin" />
<!-- 重新生成xml文件,而不是追加 -->
<plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin" />
<commentGenerator>
<!-- 去除自动生成的注释 -->
<property name="suppressAllComments" value="true" />
</commentGenerator>
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://test.tall.wiki:3306/yanyuan?useUnicode=true&amp;characterEncoding=UTF-8&amp;tinyInt1isBit=false" userId="root"
password="po3OynBO[M3579p6L7)o" />
<javaModelGenerator targetPackage="com.wmeimob.bjyy.model"
targetProject=".\src\main\java">
<property name="trimStrings" value="true" />
<property name="enableSubPackages" value="true" />
</javaModelGenerator>
<sqlMapGenerator targetPackage="com.wmeimob.bjyy.mapping"
targetProject=".\src\main\java">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<javaClientGenerator targetPackage="com.wmeimob.bjyy.dao"
targetProject=".\src\main\java" type="XMLMAPPER">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<!--<table tableName="u_user" domainObjectName="User"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>-->
<!--<table tableName="u_mental_test" domainObjectName="MentalTest"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>-->
<table tableName="t_train_aid" domainObjectName="TrainAid"></table>
<table tableName="t_train_content" domainObjectName="TrainContent"></table>
<table tableName="t_train_img" domainObjectName="TrainImg"></table>
<table tableName="t_train_record" domainObjectName="TrainRecord"></table>
</context>
</generatorConfiguration>

31
bjyy-weixin/src/main/java/com/wmeimob/bjyy/controller/DebugController.java

@ -0,0 +1,31 @@
package com.wmeimob.bjyy.controller;
import com.itextpdf.text.DocumentException;
import com.wmeimob.bjyy.service.TrainService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.io.IOException;
/**
* @description:
* @author: whj
* @time: 2021/2/5 18:21
*/
@Controller
@RequestMapping("/debug")
public class DebugController {
@Resource
private TrainService trainService;
@ResponseBody
@RequestMapping("/")
public String index() throws IOException, DocumentException {
String url = trainService.generateTrainPlan("f60005dc-87a0-4b6d-a212-66e80a421f42", (byte) 3);
System.out.println("==========" + url);
return url;
}
}

14
bjyy-weixin/src/main/java/com/wmeimob/bjyy/controller/MentalController.java

@ -10,6 +10,7 @@ import java.util.List;
import java.util.Random;
import java.util.UUID;
import com.wmeimob.bjyy.service.TrainService;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
@ -37,6 +38,8 @@ import com.wmeimob.bjyy.vo.PracticeVO;
import com.wmeimob.bjyy.vo.ResultVO;
import com.wmeimob.bjyy.vo.ScoreVO;
import javax.annotation.Resource;
/**
* 脑力测评controller
* @author WMM04
@ -56,6 +59,9 @@ public class MentalController {
@Autowired
private AddressService addressService;
@Resource
private TrainService trainService;
/**
* 系统首页
* @return
@ -345,7 +351,8 @@ public class MentalController {
grade=gra.getGrade();
}
}
mentalTest.setId(UUID.randomUUID().toString());
mentalTest.setUserId(user.getId());
mentalTest.setFromType((byte) type);
@ -363,6 +370,11 @@ public class MentalController {
mentalTest.setUpdateAt(new Date());
mentalTest.setStatus(true);
int addCareRecord = mentalService.addMentalRecord(mentalTest);
// 生成训练试题
String pdfUrl = trainService.generateTrainPlan(mentalTest.getId(), (byte)grade);
if(addCareRecord>0){
result.setCode(0);
}else{

20
bjyy-weixin/src/main/java/com/wmeimob/bjyy/service/TrainService.java

@ -0,0 +1,20 @@
package com.wmeimob.bjyy.service;
import com.itextpdf.text.DocumentException;
import java.io.IOException;
/**
* @author whj
* 康复训练
*/
public interface TrainService {
/**
* 生成康复训练计划
* @param testId 测评结果ID
* @param grade 测评等级
* @return 测评计划路径
*/
String generateTrainPlan(String testId, byte grade) throws IOException, DocumentException;
}

161
bjyy-weixin/src/main/java/com/wmeimob/bjyy/service/impl/TrainServiceImpl.java

@ -0,0 +1,161 @@
package com.wmeimob.bjyy.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.wmeimob.bjyy.util.DateUtil;
import com.itextpdf.text.DocumentException;
import com.wmeimob.bjyy.dao.MentalTestMapper;
import com.wmeimob.bjyy.dao.TrainContentMapper;
import com.wmeimob.bjyy.dao.TrainDao;
import com.wmeimob.bjyy.dao.TrainRecordMapper;
import com.wmeimob.bjyy.model.MentalTest;
import com.wmeimob.bjyy.model.TrainRecord;
import com.wmeimob.bjyy.service.TrainService;
import com.wmeimob.bjyy.util.CommonUtils;
import com.wmeimob.bjyy.util.PdfUtil;
import com.wmeimob.bjyy.vo.TrainVo;
import com.wmeimob.bjyy.weixin.WeChatConfig;
import lombok.extern.log4j.Log4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.*;
/**
* @description:
* @author: whj
* @time: 2021/2/5 15:11
*/
@Log4j
@Service
@Transactional(rollbackFor = Exception.class)
public class TrainServiceImpl implements TrainService {
@Resource
private TrainContentMapper trainContentMapper;
@Resource
private TrainDao trainDao;
@Resource
private TrainRecordMapper trainRecordMapper;
@Resource
private MentalTestMapper mentalTestMapper;
@Override
public String generateTrainPlan(String testId, byte grade) throws IOException, DocumentException {
log.info("为"+testId+"生成"+grade+"训练计划");
List<TrainVo.TrainContentVo> vos = trainDao.queryByLevel(grade);
if (vos == null || vos.isEmpty()) {
log.info("没有找到对应等级的试题");
return null;
}
List<TrainRecord> records = new ArrayList<>();
List<PdfUtil.Row> contents = new ArrayList<>();
Random random = new Random();
for (int i = 0; i < vos.size(); i+=2) {
int day = i/2 + 1;
String dayChinese = CommonUtils.numMap.get(day);
// pdf第几天
PdfUtil.Row row = new PdfUtil.Row();
PdfUtil.Cell cell = new PdfUtil.Cell();
cell.setContent("第"+dayChinese+"天(________年________月________日)(________年________月________日)");
cell.setBorderLeft(null);
cell.setBorderBottom(null);
cell.setCenter(false);
row.addCell(cell);
contents.add(row);
// 添加题目
TrainVo.TrainContentVo vo = vos.get(i);
fillRows(testId, records, contents, random, vo);
if (i+1 >= vos.size()) {
break;
}
TrainVo.TrainContentVo vo2 = vos.get(i+1);
fillRows(testId, records, contents, random, vo2);
}
//保存记录
records.forEach(record -> {
trainRecordMapper.insert(record);
});
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.WEEK_OF_YEAR, 2);
//介绍
List<PdfUtil.Row> intros = new ArrayList<>();
PdfUtil.Row row = new PdfUtil.Row();
PdfUtil.Cell cell = new PdfUtil.Cell();
cell.setContent(" 根据长者“脑力测评”,系统生成此训练方案,训练周期为2周,每周训练5天,每天训练时常40分钟左右,第二周训练内容重复第一周方案。");
cell.setBorderBottom(null);
cell.setBorderLeft(null);
cell.setCenter(false);
row.addCell(cell);
intros.add(row);
PdfUtil.Margin margin = new PdfUtil.Margin();
String parentPath = WeChatConfig.getValue("filePath");
String fileName = PdfUtil.credatePdf(
new PdfUtil.ImageFile(WeChatConfig.getValue("logoPath"), 80, 100, 10),
parentPath,
"脑益宝—老年脑健康认知训练方案",
DateUtil.format(new Date(), DateUtil.yyyyMMddDot)+ "-" + DateUtil.format(calendar.getTime(), DateUtil.yyyyMMddDot),
intros, contents, margin
);
// PdfUtil.fillImage("", parentPath+fileName, new PdfUtil.ImageFile(WeChatConfig.getValue("logoPath"), 50, 50, 40));
MentalTest test = new MentalTest();
test.setId(testId);
test.setPdfUrl(parentPath + fileName);
mentalTestMapper.updateByPrimaryKeySelective(test);
return WeChatConfig.getValue("domain") + fileName;
}
private void fillRows(String testId, List<TrainRecord> records, List<PdfUtil.Row> contents, Random random, TrainVo.TrainContentVo vo) {
// 生成随机数
List<TrainVo.ContentVo> contentVos = vo.getContentVos();
int index = random.nextInt(contentVos.size());
TrainVo.ContentVo contentVo = contentVos.get(index);
// 记录内容
TrainRecord record = new TrainRecord();
record.setQuestionId(contentVo.getId());
record.setTestId(testId);
records.add(record);
// 添加pdf内容
//类型
PdfUtil.Row row = new PdfUtil.Row();
PdfUtil.Cell cell = new PdfUtil.Cell();
cell.setContent(vo.getName());
cell.setCenter(false);
cell.setBorderBottom(null);
cell.setBorderLeft(null);
row.addCell(cell);
contents.add(row);
// 题目
PdfUtil.Row row2 = new PdfUtil.Row();
PdfUtil.Cell cell2 = new PdfUtil.Cell();
cell2.setContent(contentVo.getContent());
cell2.setCenter(false);
cell2.setBorderBottom(null);
cell2.setBorderLeft(null);
row2.addCell(cell2);
contents.add(row2);
// 图片
if (CollectionUtil.isNotEmpty(contentVo.getImages())) {
PdfUtil.Row row3 = new PdfUtil.Row();
contentVo.getImages().forEach(image->{
PdfUtil.Cell cell3 = new PdfUtil.Cell();
cell3.setContent(WeChatConfig.getValue("projectPath") + image.getUrl());
cell3.setType((byte)1);
cell3.setCenter(false);
cell3.setBorderBottom(null);
cell3.setBorderLeft(null);
row3.addCell(cell3);
});
contents.add(row3);
}
contents.add(new PdfUtil.Row());
}
}

BIN
bjyy-weixin/src/main/webapp/static/images/logo.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

11
generatorConfig.xml

@ -11,8 +11,8 @@
<property name="suppressAllComments" value="true" />
</commentGenerator>
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://114.215.241.185:3306/bjyy_test" userId="mmtest"
password="123456" />
connectionURL="jdbc:mysql://test.tall.wiki:3306/yanyuan" userId="root"
password="po3OynBO[M3579p6L7)o" />
<javaModelGenerator targetPackage="com.wmeimob.bjyy.model"
targetProject="bjyy-dal">
<property name="trimStrings" value="true" />
@ -28,10 +28,13 @@
</javaClientGenerator>
<table tableName="u_user" domainObjectName="User"
<!--<table tableName="u_user" domainObjectName="User"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
</table>-->
<table tableName="t_train_aid" domainObjectName="TrainAid"></table>
<table tableName="t_train_content" domainObjectName="TrainContent"></table>
<table tableName="t_train_img" domainObjectName="TrainImg"></table>
</context>
</generatorConfiguration>

29
pom.xml

@ -322,6 +322,35 @@
<artifactId>fastjson</artifactId>
<version>1.2.31</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
</dependency>
<!-- hutool-all -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.1.21</version>
</dependency>
<!--PDF生成-->
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf</artifactId>
<version>9.1.19</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.13.1</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-asian</artifactId>
<version>5.2.0</version>
</dependency>
</dependencies>
<build>

Loading…
Cancel
Save