diff --git a/bjyy-core/src/main/java/com/wmeimob/bjyy/util/CommonUtils.java b/bjyy-core/src/main/java/com/wmeimob/bjyy/util/CommonUtils.java new file mode 100644 index 0000000..37b40bc --- /dev/null +++ b/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 numMap = new HashMap<>(); + static { + numMap.put(1,"一"); + numMap.put(2,"二"); + numMap.put(3,"三"); + numMap.put(4,"四"); + numMap.put(5,"五"); + } +} diff --git a/bjyy-core/src/main/java/com/wmeimob/bjyy/util/DateUtil.java b/bjyy-core/src/main/java/com/wmeimob/bjyy/util/DateUtil.java index a389919..90b4a6d 100644 --- a/bjyy-core/src/main/java/com/wmeimob/bjyy/util/DateUtil.java +++ b/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 diff --git a/bjyy-core/src/main/java/com/wmeimob/bjyy/util/PdfUtil.java b/bjyy-core/src/main/java/com/wmeimob/bjyy/util/PdfUtil.java new file mode 100644 index 0000000..fafe75d --- /dev/null +++ b/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 intros, List 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 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 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; + } + } +} diff --git a/bjyy-core/src/main/java/com/wmeimob/bjyy/weixin/WeChatConfig.java b/bjyy-core/src/main/java/com/wmeimob/bjyy/weixin/WeChatConfig.java index a43e2b6..ef4ca4e 100644 --- a/bjyy-core/src/main/java/com/wmeimob/bjyy/weixin/WeChatConfig.java +++ b/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(); diff --git a/bjyy-core/src/main/resources/test/wechat.properties b/bjyy-core/src/main/resources/test/wechat.properties index 3762a2e..a0f0f6e 100644 --- a/bjyy-core/src/main/resources/test/wechat.properties +++ b/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/ diff --git a/bjyy-dal/pom.xml b/bjyy-dal/pom.xml index b218b19..719e540 100644 --- a/bjyy-dal/pom.xml +++ b/bjyy-dal/pom.xml @@ -39,4 +39,24 @@ mybatis + + + + org.mybatis.generator + mybatis-generator-maven-plugin + 1.3.7 + + ${basedir}/src/main/resources/generatorConfig.xml + true + + + + mysql + mysql-connector-java + 5.1.34 + + + + + diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/MentalTestMapper.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/MentalTestMapper.java index 1bb8d7f..4fd9502 100644 --- a/bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/MentalTestMapper.java +++ b/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 selectMentalRecordTop(@Param("userId")String userId); + List selectMentalRecordTop(@Param("userId")String userId); } \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainAidMapper.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainAidMapper.java new file mode 100644 index 0000000..0c3f966 --- /dev/null +++ b/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 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); +} \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainContentMapper.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainContentMapper.java new file mode 100644 index 0000000..a98494c --- /dev/null +++ b/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 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); +} \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainDao.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainDao.java new file mode 100644 index 0000000..6614962 --- /dev/null +++ b/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 queryByLevel(@Param("level") byte grade); +} diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainImgMapper.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainImgMapper.java new file mode 100644 index 0000000..54456d1 --- /dev/null +++ b/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 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); +} \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainRecordMapper.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/dao/TrainRecordMapper.java new file mode 100644 index 0000000..84f60ef --- /dev/null +++ b/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 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); +} \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/MentalTestMapper.xml b/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/MentalTestMapper.xml index 774718b..89dfcca 100644 --- a/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/MentalTestMapper.xml +++ b/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/MentalTestMapper.xml @@ -1,210 +1,220 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - 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 + + 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 - select from u_mental_test where id = #{id,jdbcType=VARCHAR} - + delete from u_mental_test where id = #{id,jdbcType=VARCHAR} - - 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 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 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, + + from_type, - + grade_result, - + + test_at, + + create_at, - + update_at, - + status, + + pdf_url, + - - + + #{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}, + + #{fromType,jdbcType=BIT}, - + #{gradeResult,jdbcType=INTEGER}, - + + #{testAt,jdbcType=TIMESTAMP}, + + #{createAt,jdbcType=TIMESTAMP}, - + #{updateAt,jdbcType=TIMESTAMP}, - + #{status,jdbcType=BIT}, + + #{pdfUrl,jdbcType=VARCHAR}, + - + update u_mental_test - - + + 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}, - + attention_num = #{attentionNum,jdbcType=DECIMAL}, - + direction_num = #{directionNum,jdbcType=DECIMAL}, - + 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}, + + pdf_url = #{pdfUrl,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} - + 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} - + - + - + - - + + - + - select from u_mental_test where status=1 - + 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}) - select from u_mental_test where status=1 - + and user_id = #{userId,jdbcType=VARCHAR} GROUP BY user_id diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainAidMapper.xml b/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainAidMapper.xml new file mode 100644 index 0000000..adeef91 --- /dev/null +++ b/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainAidMapper.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, description, user_id, created_at, update_at, rec_status + + + + + delete from t_train_aid + where id = #{id,jdbcType=INTEGER} + + + delete from t_train_aid + + + + + + 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 into t_train_aid + + + id, + + + name, + + + description, + + + user_id, + + + created_at, + + + update_at, + + + rec_status, + + + + + #{id,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{userId,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updateAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_train_aid + + + 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}, + + + + + + + + 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} + + + + + + update t_train_aid + + + 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 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} + + \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainContentMapper.xml b/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainContentMapper.xml new file mode 100644 index 0000000..523c36f --- /dev/null +++ b/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainContentMapper.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, aid_id, content, level, user_id, created_at, update_at, rec_status + + + + + delete from t_train_content + where id = #{id,jdbcType=INTEGER} + + + delete from t_train_content + + + + + + 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 into t_train_content + + + id, + + + aid_id, + + + content, + + + level, + + + user_id, + + + created_at, + + + update_at, + + + rec_status, + + + + + #{id,jdbcType=INTEGER}, + + + #{aidId,jdbcType=INTEGER}, + + + #{content,jdbcType=VARCHAR}, + + + #{level,jdbcType=TINYINT}, + + + #{userId,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updateAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_train_content + + + 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}, + + + + + + + + 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} + + + + + + update t_train_content + + + 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 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} + + \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainDao.xml b/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainDao.xml new file mode 100644 index 0000000..0563e3b --- /dev/null +++ b/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainDao.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainImgMapper.xml b/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainImgMapper.xml new file mode 100644 index 0000000..ed38125 --- /dev/null +++ b/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainImgMapper.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, content_id, url, sort, user_id, created_at, update_at, rec_status + + + + + delete from t_train_img + where id = #{id,jdbcType=INTEGER} + + + delete from t_train_img + + + + + + 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 into t_train_img + + + id, + + + content_id, + + + url, + + + sort, + + + user_id, + + + created_at, + + + update_at, + + + rec_status, + + + + + #{id,jdbcType=INTEGER}, + + + #{contentId,jdbcType=INTEGER}, + + + #{url,jdbcType=VARCHAR}, + + + #{sort,jdbcType=TINYINT}, + + + #{userId,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updateAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_train_img + + + 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}, + + + + + + + + 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} + + + + + + update t_train_img + + + 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 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} + + \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainRecordMapper.xml b/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainRecordMapper.xml new file mode 100644 index 0000000..2796935 --- /dev/null +++ b/bjyy-dal/src/main/java/com/wmeimob/bjyy/mapping/TrainRecordMapper.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, test_id, question_id, user_id, created_at, update_at, rec_status + + + + + delete from t_train_record + where id = #{id,jdbcType=INTEGER} + + + delete from t_train_record + + + + + + 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 into t_train_record + + + id, + + + test_id, + + + question_id, + + + user_id, + + + created_at, + + + update_at, + + + rec_status, + + + + + #{id,jdbcType=INTEGER}, + + + #{testId,jdbcType=VARCHAR}, + + + #{questionId,jdbcType=INTEGER}, + + + #{userId,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updateAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_train_record + + + 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}, + + + + + + + + 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} + + + + + + update t_train_record + + + 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 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} + + \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/MentalTest.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/MentalTest.java index aa72b56..358d900 100644 --- a/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/MentalTest.java +++ b/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(); diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainAid.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainAid.java new file mode 100644 index 0000000..8e8c2ea --- /dev/null +++ b/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(); + } +} \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainAidExample.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainAidExample.java new file mode 100644 index 0000000..2f27dd4 --- /dev/null +++ b/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 oredCriteria; + + public TrainAidExample() { + oredCriteria = new ArrayList(); + } + + 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List 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 values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List 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 values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List 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 values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List 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 values) { + addCriterion("update_at in", values, "updateAt"); + return (Criteria) this; + } + + public Criteria andUpdateAtNotIn(List 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 values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List 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); + } + } +} \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainContent.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainContent.java new file mode 100644 index 0000000..bd20243 --- /dev/null +++ b/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(); + } +} \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainContentExample.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainContentExample.java new file mode 100644 index 0000000..e2e5c13 --- /dev/null +++ b/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 oredCriteria; + + public TrainContentExample() { + oredCriteria = new ArrayList(); + } + + 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 values) { + addCriterion("aid_id in", values, "aidId"); + return (Criteria) this; + } + + public Criteria andAidIdNotIn(List 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 values) { + addCriterion("content in", values, "content"); + return (Criteria) this; + } + + public Criteria andContentNotIn(List 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 values) { + addCriterion("level in", values, "level"); + return (Criteria) this; + } + + public Criteria andLevelNotIn(List 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 values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List 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 values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List 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 values) { + addCriterion("update_at in", values, "updateAt"); + return (Criteria) this; + } + + public Criteria andUpdateAtNotIn(List 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 values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List 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); + } + } +} \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainImg.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainImg.java new file mode 100644 index 0000000..aef8e24 --- /dev/null +++ b/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(); + } +} \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainImgExample.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainImgExample.java new file mode 100644 index 0000000..0e6943e --- /dev/null +++ b/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 oredCriteria; + + public TrainImgExample() { + oredCriteria = new ArrayList(); + } + + 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 values) { + addCriterion("content_id in", values, "contentId"); + return (Criteria) this; + } + + public Criteria andContentIdNotIn(List 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 values) { + addCriterion("url in", values, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotIn(List 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 values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List 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 values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List 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 values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List 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 values) { + addCriterion("update_at in", values, "updateAt"); + return (Criteria) this; + } + + public Criteria andUpdateAtNotIn(List 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 values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List 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); + } + } +} \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainRecord.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainRecord.java new file mode 100644 index 0000000..2660c42 --- /dev/null +++ b/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(); + } +} \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainRecordExample.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/model/TrainRecordExample.java new file mode 100644 index 0000000..62e2b22 --- /dev/null +++ b/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 oredCriteria; + + public TrainRecordExample() { + oredCriteria = new ArrayList(); + } + + 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 values) { + addCriterion("test_id in", values, "testId"); + return (Criteria) this; + } + + public Criteria andTestIdNotIn(List 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 values) { + addCriterion("question_id in", values, "questionId"); + return (Criteria) this; + } + + public Criteria andQuestionIdNotIn(List 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 values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List 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 values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List 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 values) { + addCriterion("update_at in", values, "updateAt"); + return (Criteria) this; + } + + public Criteria andUpdateAtNotIn(List 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 values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List 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); + } + } +} \ No newline at end of file diff --git a/bjyy-dal/src/main/java/com/wmeimob/bjyy/vo/TrainVo.java b/bjyy-dal/src/main/java/com/wmeimob/bjyy/vo/TrainVo.java new file mode 100644 index 0000000..d190d4e --- /dev/null +++ b/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 contentVos; + + } + + @Data + public static class ContentVo{ + /**题目ID*/ + private int id; + /**内容*/ + private String content; + /**图片*/ + private List images; + } + @Data + public static class ContentImage { + private String url; + } +} diff --git a/bjyy-dal/src/main/resources/generatorConfig.xml b/bjyy-dal/src/main/resources/generatorConfig.xml new file mode 100644 index 0000000..8eeb79b --- /dev/null +++ b/bjyy-dal/src/main/resources/generatorConfig.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
\ No newline at end of file diff --git a/bjyy-weixin/src/main/java/com/wmeimob/bjyy/controller/DebugController.java b/bjyy-weixin/src/main/java/com/wmeimob/bjyy/controller/DebugController.java new file mode 100644 index 0000000..c223f30 --- /dev/null +++ b/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; + } +} diff --git a/bjyy-weixin/src/main/java/com/wmeimob/bjyy/controller/MentalController.java b/bjyy-weixin/src/main/java/com/wmeimob/bjyy/controller/MentalController.java index b448be3..67aa561 100644 --- a/bjyy-weixin/src/main/java/com/wmeimob/bjyy/controller/MentalController.java +++ b/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{ diff --git a/bjyy-weixin/src/main/java/com/wmeimob/bjyy/service/TrainService.java b/bjyy-weixin/src/main/java/com/wmeimob/bjyy/service/TrainService.java new file mode 100644 index 0000000..dab5172 --- /dev/null +++ b/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; +} diff --git a/bjyy-weixin/src/main/java/com/wmeimob/bjyy/service/impl/TrainServiceImpl.java b/bjyy-weixin/src/main/java/com/wmeimob/bjyy/service/impl/TrainServiceImpl.java new file mode 100644 index 0000000..557a5a0 --- /dev/null +++ b/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 vos = trainDao.queryByLevel(grade); + if (vos == null || vos.isEmpty()) { + log.info("没有找到对应等级的试题"); + return null; + } + + List records = new ArrayList<>(); + + List 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 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 records, List contents, Random random, TrainVo.TrainContentVo vo) { + // 生成随机数 + List 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()); + } +} diff --git a/bjyy-weixin/src/main/webapp/static/images/logo.jpg b/bjyy-weixin/src/main/webapp/static/images/logo.jpg new file mode 100644 index 0000000..a234097 Binary files /dev/null and b/bjyy-weixin/src/main/webapp/static/images/logo.jpg differ diff --git a/generatorConfig.xml b/generatorConfig.xml index 095756e..25f5fff 100644 --- a/generatorConfig.xml +++ b/generatorConfig.xml @@ -11,8 +11,8 @@ + connectionURL="jdbc:mysql://test.tall.wiki:3306/yanyuan" userId="root" + password="po3OynBO[M3579p6L7)o" /> @@ -28,10 +28,13 @@ - -
+ --> +
+
+
\ No newline at end of file diff --git a/pom.xml b/pom.xml index aa6d448..81727b9 100644 --- a/pom.xml +++ b/pom.xml @@ -322,6 +322,35 @@ fastjson 1.2.31 + + + org.projectlombok + lombok + 1.18.12 + + + + + cn.hutool + hutool-all + 4.1.21 + + + + org.xhtmlrenderer + flying-saucer-pdf + 9.1.19 + + + com.itextpdf + itextpdf + 5.5.13.1 + + + com.itextpdf + itext-asian + 5.2.0 +