自动生成配置文件和mapper xml

newBigdata
xiaoCJ 11 months ago
parent b771b1e3cf
commit 6a73e7b149

@ -65,54 +65,12 @@ public class TeaGradeManageController {
private SysWeightMapper sysWeightMapper;
@Autowired
private StuTheoryExamMapper stuTheoryExamMapper;
// @AnonymousAccess
// @PostMapping("/getExamInfo")
// @ApiOperation("考试模式--页面展示(学生端实战考核复用)")
// public ResultEntity<PageInfo<TeaExamManageCountDto>> getExamInfo(@RequestParam Integer index,
// @RequestParam Integer size,
// @ApiParam("ManyAnswer为考试时间JudgeAnswer为发布人") @RequestParam String schoolId) {
//
// List<TeaExamManage> teaExamManages = teaExamManageMapper.selectBySchoolId(schoolId);
// List<TeaExamManageCountDto>teaExamManageCountDtos =new AstList();
// for (TeaExamManage teaExamManage : teaExamManages) {
// List<String> nameList = new ArrayList<>();
// TeaExamManageCountDto copyexamManageWithBLOBs = new TeaExamManageCountDto();
// int num = 0;
// //获取班级和考试人数
// String classId = teaAndStudentExamMapper.selectByExamId(teaExamManage.getExamManageId());
// String[] split = classId.split(",");
// for (String s : split) {
// StuClass stuClass = stuClassMapper.selectByPrimaryKey(s);
// String className = stuClass.getClassName();
// nameList.add(className);
// int count = userMapper.selectNumByClass(s);
// num = num + count;
// }
// copyexamManageWithBLOBs.setExamClass(nameList);
// copyexamManageWithBLOBs.setExamNum(num);
// BeanUtils.copyProperties(teaExamManage, copyexamManageWithBLOBs);
// Date now = new Date(); // 当前日期
// Date endTime = teaExamManage.getEndTime(); // 从 teaExamManage 对象中获取的日期
// Date startTime = teaExamManage.getStartTime();
//
// if (now.compareTo(endTime) > 0) {
// copyexamManageWithBLOBs.setExamStatus("已结束");
// } else if (now.compareTo(startTime) < 0) {
// copyexamManageWithBLOBs.setExamStatus("未开始");
// } else {
// copyexamManageWithBLOBs.setExamStatus("进行中");
// }
// String concatenatedTimeString = startTime + " -- " + endTime;
// copyexamManageWithBLOBs.setExamTime(concatenatedTimeString); //考试时间
// String userId = teaExamManage.getUserId();
// StuUser stuUser = userMapper.selectByPrimaryKey(userId);
// copyexamManageWithBLOBs.setName(stuUser.getName()); //发布人
// teaExamManageCountDtos.add(copyexamManageWithBLOBs);
// }
// PageUtil.pageHelper(teaExamManageCountDtos, index, size);
// return new ResultEntity<>(new PageInfo<>(teaExamManageCountDtos));
// }
@Autowired
private SysCaseQuestionMapper sysCaseQuestionMapper;
@Autowired
private SysCaseQuestionStepMapper sysCaseQuestionStepMapper;
@Autowired
private SysObjectiveQuestionMapper sysObjectiveQuestionMapper;
@AnonymousAccess
@ -124,23 +82,61 @@ public class TeaGradeManageController {
List<TeaExamManage> teaExamManages = teaExamManageMapper.selectBySchoolId(schoolId);
List<TeaExamManageCountDto> teaExamManageCountDtos = new ArrayList<>();
Map<String, StuUser> userMap = new HashMap<>();
// 批量查询班级信息
List<String> examIds = new ArrayList<>();
List<String> userIds = new ArrayList<>();
for (TeaExamManage teaExamManage : teaExamManages) {
examIds.add(teaExamManage.getExamManageId());
String userId = teaExamManage.getUserId();
userIds.add(userId);
}
//存储用户信息
List<StuUser> stuUsers = userMapper.selectByPrimaryKeys(userIds);
for (StuUser stuUser : stuUsers) {
userMap.put(stuUser.getUserid(), stuUser);
}
for (TeaExamManage teaExamManage : teaExamManages) {
TeaExamManageCountDto copyexamManageWithBLOBs = new TeaExamManageCountDto();
//获取班级和考试人数
TeaAndStudentExam teaAndStudentExam = teaAndStudentExamMapper.selectByExamMangeId(teaExamManage.getExamManageId());
String classId = teaAndStudentExam.getClassId();
String[] split = classId.split(",");
List<String> ids = new ArrayList<>(Arrays.asList(split));
int num = userMapper.selectNumByClass(ids);
copyexamManageWithBLOBs.setExamClass(teaAndStudentExam.getClassName());
copyexamManageWithBLOBs.setExamNum(num);
BeanUtils.copyProperties(teaExamManage, copyexamManageWithBLOBs);
Date now = new Date(); // 当前日期
Date endTime = teaExamManage.getEndTime(); // 从 teaExamManage 对象中获取的日期
Date startTime = teaExamManage.getStartTime();
if (now.compareTo(endTime) > 0) {
copyexamManageWithBLOBs.setExamStatus("已结束");
} else if (now.compareTo(startTime) < 0) {
copyexamManageWithBLOBs.setExamStatus("未开始");
} else {
copyexamManageWithBLOBs.setExamStatus("进行中");
}
String concatenatedTimeString = startTime + " -- " + endTime;
copyexamManageWithBLOBs.setExamTime(concatenatedTimeString); //考试时间
String userId = teaExamManage.getUserId();
StuUser stuUser = userMap.get(userId);
copyexamManageWithBLOBs.setName(stuUser.getName()); //发布人
teaExamManageCountDtos.add(copyexamManageWithBLOBs);
}
PageInfo pageInfo = PageUtil.pageHelper(teaExamManageCountDtos, index, size);
return new ResultEntity<PageInfo<TeaExamManageCountDto>>(pageInfo);
return new ResultEntity<>(pageInfo);
}
@AnonymousAccess
@PostMapping("/getExamInfoAndRank")
@ApiOperation("考试模式--成绩排名和成绩情况展示") //TODO 图片可能需要一个接口去取
public ResultEntity<PageInfo> getExamInfoAndRank(@RequestParam Integer index,
public ResultEntity<PageInfo<TeaExamAndUserDto>> getExamInfoAndRank(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam String schoolId,
@ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord,
@ -152,6 +148,14 @@ public class TeaGradeManageController {
return new ResultEntity<>(pageInfo);
}
@AnonymousAccess
@PostMapping("/getExamNameAndId")
@ApiOperation("考试模式--考试名称下拉框") //TODO 图片可能需要一个接口去取
public ResultEntity<List<Map<String, String>>> getExamNameAndId(@RequestParam String schoolId) {
List<Map<String, String>> list = teaExamManageMapper.selectNameAndIdBySchoolId(schoolId);
return new ResultEntity<>(list);
}
@GetMapping("/exportExam")
@ApiOperation("考试模式--页面单个考试导出")
@ -210,11 +214,54 @@ public class TeaGradeManageController {
}
@AnonymousAccess
@PostMapping("/getGradeReport")
@ApiOperation("考试模式--成绩报告接口") //TODO 待写 成绩报告接口 需要计算题目的正确率,暂时没想好
public void getGradeReport() {
@PostMapping("/getGradeReportCase")
@ApiOperation("考试模式--成绩报告案例题questionOriginal所属章节contentOriginal为考核点数量") //TODO 案例题正确率字段暂无
public ResultEntity<PageInfo<SysCaseQuestion>> getGradeReportCase(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam String examManageId) {
TeaExamManageWithBLOBs teaExamManageWithBLOBs = teaExamManageMapper.selectByPrimaryKey(examManageId);
String caseIdList = teaExamManageWithBLOBs.getCaseIdlist();
List<String> list = Arrays.asList(caseIdList.split(","));
PageHelper.startPage(index, size);
List<SysCaseQuestion> resultList = sysCaseQuestionStepMapper.getGradeReportCase(list);
PageInfo pageInfo = new PageInfo(resultList);
return new ResultEntity(pageInfo);
}
@AnonymousAccess
@PostMapping("/getGradeReportObjective")
@ApiOperation("考试模式--成绩报告客观题") //TODO 客观题正确率字段暂无
public ResultEntity<PageInfo<SysCaseQuestion>> getGradeReportObjective(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam String examManageId) {
TeaExamManageWithBLOBs teaExamManageWithBLOBs = teaExamManageMapper.selectByPrimaryKey(examManageId);
if (teaExamManageWithBLOBs == null) {
return null;
}
List<String> list = new ArrayList();
if (StringUtils.isNotBlank(teaExamManageWithBLOBs.getSingleIdlist())) {
String singleIdList = teaExamManageWithBLOBs.getSingleIdlist();
String[] split = singleIdList.split(",");
list.addAll(Arrays.asList(split));
}
if (StringUtils.isNotBlank(teaExamManageWithBLOBs.getManyIdlist())) {
String manyIdList = teaExamManageWithBLOBs.getManyIdlist();
String[] split = manyIdList.split(",");
list.addAll(Arrays.asList(split));
}
if (StringUtils.isNotBlank(teaExamManageWithBLOBs.getJudgeIdlist())) {
String judgeIdList = teaExamManageWithBLOBs.getJudgeIdlist();
String[] split = judgeIdList.split(",");
list.addAll(Arrays.asList(split));
}
PageHelper.startPage(index, size);
List<SysCaseQuestion> resultList = sysObjectiveQuestionMapper.getGradeReportObjective(list);
PageInfo pageInfo = new PageInfo(resultList);
return new ResultEntity(pageInfo);
}
@AnonymousAccess
@GetMapping("/exportRank")

@ -313,6 +313,76 @@ public class TeaAndStudentExamExample {
addCriterion("class_id not between", value1, value2, "classId");
return (Criteria) this;
}
public Criteria andClassNameIsNull() {
addCriterion("class_name is null");
return (Criteria) this;
}
public Criteria andClassNameIsNotNull() {
addCriterion("class_name is not null");
return (Criteria) this;
}
public Criteria andClassNameEqualTo(String value) {
addCriterion("class_name =", value, "className");
return (Criteria) this;
}
public Criteria andClassNameNotEqualTo(String value) {
addCriterion("class_name <>", value, "className");
return (Criteria) this;
}
public Criteria andClassNameGreaterThan(String value) {
addCriterion("class_name >", value, "className");
return (Criteria) this;
}
public Criteria andClassNameGreaterThanOrEqualTo(String value) {
addCriterion("class_name >=", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLessThan(String value) {
addCriterion("class_name <", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLessThanOrEqualTo(String value) {
addCriterion("class_name <=", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLike(String value) {
addCriterion("class_name like", value, "className");
return (Criteria) this;
}
public Criteria andClassNameNotLike(String value) {
addCriterion("class_name not like", value, "className");
return (Criteria) this;
}
public Criteria andClassNameIn(List<String> values) {
addCriterion("class_name in", values, "className");
return (Criteria) this;
}
public Criteria andClassNameNotIn(List<String> values) {
addCriterion("class_name not in", values, "className");
return (Criteria) this;
}
public Criteria andClassNameBetween(String value1, String value2) {
addCriterion("class_name between", value1, value2, "className");
return (Criteria) this;
}
public Criteria andClassNameNotBetween(String value1, String value2) {
addCriterion("class_name not between", value1, value2, "className");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

@ -47,5 +47,5 @@ public class TeaExamManageCountDto {
private int examNum;
@ApiModelProperty("考试班级")
private List<String> examClass;
private String examClass;
}

@ -39,6 +39,9 @@ public class TeaExamManageDto {
@ApiModelProperty("班级id")
private String classId;
@ApiModelProperty("班级名字")
private String className;
@ApiModelProperty("LOGO地址")
private String logoAddress;

@ -54,6 +54,14 @@ public interface StuUserMapper {
+")</script>")
int selectNumByClass(@Param("classIdList") List<String> classIdList);
// @Select("select count(*) from stu_userinfo where class_id = #{s}")
// int selectNumByClass(@Param("s") String s);
List<Integer> selectNumByClasss(List<String> classIdList);
@Select("<script>" +
"select userid,name FROM stu_userinfo WHERE userid IN("
+"<foreach collection='userIds' separator=',' item='id'>"
+ "#{id} "
+ "</foreach> "
+")</script>")
List<StuUser> selectByPrimaryKeys(@Param("userIds")List<String> userIds);
}

@ -1,11 +1,14 @@
package com.sztzjy.financial_bigdata.mapper;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestion;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface SysCaseQuestionStepMapper {
long countByExample(SysCaseQuestionStepExample example);
@ -29,4 +32,7 @@ public interface SysCaseQuestionStepMapper {
int updateByPrimaryKeySelective(SysCaseQuestionStep record);
int updateByPrimaryKey(SysCaseQuestionStep record);
List<SysCaseQuestion> getGradeReportCase(@Param("list") List<String> list);
}

@ -1,5 +1,6 @@
package com.sztzjy.financial_bigdata.mapper;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestion;
import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion;
import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionExample;
import java.util.List;
@ -47,4 +48,6 @@ public interface SysObjectiveQuestionMapper {
List<SysObjectiveQuestion> selectRandomObjectiveMany();
List<SysObjectiveQuestion> selectRandomObjectiveJudge();
List<SysCaseQuestion> getGradeReportObjective(@Param("list") List<String> list);
}

@ -2,12 +2,12 @@ package com.sztzjy.financial_bigdata.mapper;
import com.sztzjy.financial_bigdata.entity.TeaAndStudentExam;
import com.sztzjy.financial_bigdata.entity.TeaAndStudentExamExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface TeaAndStudentExamMapper {
long countByExample(TeaAndStudentExamExample example);
@ -32,6 +32,5 @@ public interface TeaAndStudentExamMapper {
int updateByPrimaryKey(TeaAndStudentExam record);
// @Select("select class_id from tea_and_student_exam where exam_manage_id =#{examManageId}")
// String selectByExamId(@Param("examManageId") String examManageId);
TeaAndStudentExam selectByExamMangeId(@Param("examManageId") String examManageId);
}

@ -3,7 +3,10 @@ package com.sztzjy.financial_bigdata.mapper;
import com.sztzjy.financial_bigdata.entity.TeaExamManage;
import com.sztzjy.financial_bigdata.entity.TeaExamManageExample;
import com.sztzjy.financial_bigdata.entity.TeaExamManageWithBLOBs;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -46,4 +49,12 @@ public interface TeaExamManageMapper {
List<TeaExamManage> selectBySchoolId(@Param("schoolId")String schoolId);
@Select("select exam_name,exam_manage_id from tea_exam_manage where school_id =#{schoolId}")
List<Map<String, String>> selectNameAndIdBySchoolId(@Param("schoolId")String schoolId);
@Select("select sse.total_score,sum(tam.case_score+tam.single_score+tam.many_score+tam.judge_score) " +
"FROM tea_exam_manage tam JOIN stu_student_exam sse ON tam.exam_manage_id = sse.exam_manage_id" +
" GROUP BY sse.total_score ORDER BY MAX(tam.end_time) limit 1")
Map<BigDecimal,BigDecimal> getLastEaxmScore();
}

@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* @Author xcj
@ -66,13 +67,14 @@ public class StuIndexServiceImpl implements StuIndexService {
int examSize = stuStudentExamWithBLOBs.size(); //参与考核次数
stuTheoryIndexInfoDto.setTaskNum(examSize);
//TODO 最近一次考核正确率
// Map<BD>teaExamManageMapper.getLastEaxmScore();//拿到最近考试的得分和 老师设置的题目总分 // TODO 最近一次考核正确率
int lastRank = studentExamMapper.selectLastExamRank(userId); // 最近一次考核排名
stuTheoryIndexInfoDto.setLastTaskRank(lastRank);
//TODO 正确率最低的考核案例
//TODO 正确率最低的考核案例 案例题正确率字段暂无
//理论考试数据
StuTheoryIndexInfoDto theoryIndexInfoDto = stuTheoryRecordMapper.selectTheoryInfo(userId);

@ -54,7 +54,7 @@ public class TeaExamManageServiceImpl implements ITeaExamManageService {
if (teaExamManagedto.getEndTime() == null || teaExamManagedto.getStartTime() == null) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请输入考试时间!");
}
if (StringUtils.isBlank(teaExamManagedto.getClassId())) {
if (StringUtils.isBlank(teaExamManagedto.getClassId())||StringUtils.isBlank(teaExamManagedto.getClassName())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请选择考试班级!");
}
if (teaExamManageWithBLOBs.getCaseWeight() == null || teaExamManageWithBLOBs.getObjectiveWeight() == null) {
@ -65,6 +65,7 @@ public class TeaExamManageServiceImpl implements ITeaExamManageService {
TeaAndStudentExam teaAndStudentExam = new TeaAndStudentExam();
teaAndStudentExam.setExamManageId(examManageId);
teaAndStudentExam.setClassId(teaExamManagedto.getClassId());
teaAndStudentExam.setClassName(teaExamManagedto.getClassName());
teaAndStudentExam.setId(IdUtil.randomUUID());
teaAndStudentExamMapper.insert(teaAndStudentExam);
teaExamManageWithBLOBs.setExamManageId(examManageId);

@ -32,7 +32,8 @@
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
@ -61,7 +62,8 @@
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
@ -73,10 +75,12 @@
</where>
</sql>
<sql id="Base_Column_List">
case_step_id, case_id, title, content, question, answer, content_original, question_original,
case_step_id
, case_id, title, content, question, answer, content_original, question_original,
answer_original, sort, score
</sql>
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample" resultMap="BaseResultMap">
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
@ -97,7 +101,8 @@
where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from sys_case_question_step
delete
from sys_case_question_step
where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample">
@ -113,7 +118,8 @@
sort, score)
values (#{caseStepId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
#{content,jdbcType=VARCHAR}, #{question,jdbcType=VARCHAR}, #{answer,jdbcType=VARCHAR},
#{contentOriginal,jdbcType=VARCHAR}, #{questionOriginal,jdbcType=VARCHAR}, #{answerOriginal,jdbcType=VARCHAR},
#{contentOriginal,jdbcType=VARCHAR}, #{questionOriginal,jdbcType=VARCHAR},
#{answerOriginal,jdbcType=VARCHAR},
#{sort,jdbcType=INTEGER}, #{score,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep">
@ -189,7 +195,8 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample" resultType="java.lang.Long">
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample"
resultType="java.lang.Long">
select count(*) from sys_case_question_step
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
@ -304,4 +311,23 @@
where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</update>
<resultMap id="DtoMap" type="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep">
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="chapter_name" jdbcType="VARCHAR" property="questionOriginal"/>
<result column="step_count" jdbcType="VARCHAR" property="contentOriginal"/>
<result column="content" jdbcType="VARCHAR" property="questionOriginal"/>
<result column="answer_original" jdbcType="VARCHAR" property="answerOriginal"/>
</resultMap>
<select id="getGradeReportCase" parameterType="java.util.List" resultMap="DtoMap">
SELECT s2.title, s3.chapter_name, COUNT(*) AS step_count
FROM sys_case_question_step s1
JOIN sys_case_question s2 ON s1.case_id = s2.case_id
JOIN sys_course_chapter s3 ON s2.chapter_id = s3.chapter_id
WHERE s2.case_id IN
<foreach collection="list" separator="," item="id" open="(" close=")">
#{id}
</foreach>
GROUP BY s2.title, s3.chapter_name
</select>
</mapper>

@ -450,4 +450,13 @@
</select>
<select id="getGradeReportObjective" parameterType="java.util.List" resultMap="BaseResultMap">
SELECT content, chapter_name,answer,`type`
from sys_objective_question
WHERE objective_id IN
<foreach collection="list" separator="," item="id" open="(" close=")">
#{id}
</foreach>
</select>
</mapper>

@ -5,6 +5,7 @@
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="exam_manage_id" jdbcType="VARCHAR" property="examManageId" />
<result column="class_id" jdbcType="VARCHAR" property="classId" />
<result column="class_name" jdbcType="VARCHAR" property="className" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -65,7 +66,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, exam_manage_id, class_id
id, exam_manage_id, class_id, class_name
</sql>
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.TeaAndStudentExamExample" resultMap="BaseResultMap">
select
@ -98,10 +99,10 @@
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.TeaAndStudentExam">
insert into tea_and_student_exam (id, exam_manage_id, class_id
)
values (#{id,jdbcType=VARCHAR}, #{examManageId,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR}
)
insert into tea_and_student_exam (id, exam_manage_id, class_id,
class_name)
values (#{id,jdbcType=VARCHAR}, #{examManageId,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR},
#{className,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.TeaAndStudentExam">
insert into tea_and_student_exam
@ -115,6 +116,9 @@
<if test="classId != null">
class_id,
</if>
<if test="className != null">
class_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -126,6 +130,9 @@
<if test="classId != null">
#{classId,jdbcType=VARCHAR},
</if>
<if test="className != null">
#{className,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.TeaAndStudentExamExample" resultType="java.lang.Long">
@ -146,6 +153,9 @@
<if test="record.classId != null">
class_id = #{record.classId,jdbcType=VARCHAR},
</if>
<if test="record.className != null">
class_name = #{record.className,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -155,7 +165,8 @@
update tea_and_student_exam
set id = #{record.id,jdbcType=VARCHAR},
exam_manage_id = #{record.examManageId,jdbcType=VARCHAR},
class_id = #{record.classId,jdbcType=VARCHAR}
class_id = #{record.classId,jdbcType=VARCHAR},
class_name = #{record.className,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -169,13 +180,20 @@
<if test="classId != null">
class_id = #{classId,jdbcType=VARCHAR},
</if>
<if test="className != null">
class_name = #{className,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.TeaAndStudentExam">
update tea_and_student_exam
set exam_manage_id = #{examManageId,jdbcType=VARCHAR},
class_id = #{classId,jdbcType=VARCHAR}
class_id = #{classId,jdbcType=VARCHAR},
class_name = #{className,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<select id="selectByExamMangeId" parameterType="java.lang.String" resultMap="BaseResultMap">
select class_name,class_id from tea_and_student_exam where exam_manage_id = #{examManageId}
</select>
</mapper>
Loading…
Cancel
Save