whb
commit e0943292bb

@ -38,6 +38,6 @@ public class Constant {
public static final String THEORY = "理论考试模块"; public static final String THEORY = "理论考试模块";
public static final String RESOURCE = "资源中心模块"; public static final String RESOURCE = "资源中心模块";
public static final String API_URL = "http://120.79.54.255:8889"; public static final String API_URL = "http://120.79.54.255:8889";
// public static final String API_URL = "http://192.168.2.29:8889"; // public static final String API_URL = "http://192.168.2.44:8889";
} }

@ -127,7 +127,10 @@ public class StuIndexController {
StuUserDto stuUserDto = new StuUserDto(); StuUserDto stuUserDto = new StuUserDto();
BeanUtils.copyProperties(stuUser, stuUserDto); BeanUtils.copyProperties(stuUser, stuUserDto);
StuClass stuClass = stuClassMapper.selectByPrimaryKey(stuUser.getClassId()); StuClassExample example =new StuClassExample();
example.createCriteria().andClassIdEqualTo(stuUser.getClassId());
List<StuClass> stuClassList = stuClassMapper.selectByExample(example);
StuClass stuClass = stuClassList.get(0);
stuUserDto.setClassName(stuClass.getClassName()); stuUserDto.setClassName(stuClass.getClassName());
stuUserDto.setIpPlace(sysLoginLogs.get(0).getIpAddress()); stuUserDto.setIpPlace(sysLoginLogs.get(0).getIpAddress());
stuUserDto.setLastIP(sysLoginLogs.get(0).getLoginIp()); stuUserDto.setLastIP(sysLoginLogs.get(0).getLoginIp());

@ -154,9 +154,12 @@ public class TeaExamManageController {
list.add(s); list.add(s);
} }
} }
StuClassExample example =new StuClassExample();
example.createCriteria().andClassIdIn(list).andSystemOwnerEqualTo(systemOwner);
List<StuClass> stuClasslist = stuClassMapper.selectByExample(example);
String s = ""; String s = "";
for (String id : list) { for (StuClass stuClass : stuClasslist) {
StuClass stuClass = stuClassMapper.selectByPrimaryKey(id);
s += stuClass.getClassName() + ","; s += stuClass.getClassName() + ",";
} }
// 去掉最后一个逗号 // 去掉最后一个逗号

@ -147,8 +147,9 @@ public class TeaGradeManageController {
@RequestParam String schoolId, @RequestParam String schoolId,
@ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord, @ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord,
@RequestParam(required = false) String classId, @RequestParam(required = false) String classId,
@RequestParam(required = false) String examManageId) { @RequestParam(required = false) String examManageId,
List<TeaExamAndUserDto> list = getTeaExamAndUserDtos(schoolId, keyWord, classId, examManageId); @RequestParam String systemOwner) {
List<TeaExamAndUserDto> list = getTeaExamAndUserDtos(schoolId, keyWord, classId, examManageId, systemOwner);
if (list == null || list.isEmpty()) { if (list == null || list.isEmpty()) {
return new ResultEntity<PageInfo<TeaExamAndUserDto>>(new PageInfo<>()); return new ResultEntity<PageInfo<TeaExamAndUserDto>>(new PageInfo<>());
} }
@ -211,7 +212,8 @@ public class TeaGradeManageController {
@AnonymousAccess @AnonymousAccess
@PostMapping("/getClassByExamManageId") @PostMapping("/getClassByExamManageId")
@ApiOperation("考试模式--图表统计接口班级下拉框返回classID和班级名") //只显示新建实训时添加的班级 @ApiOperation("考试模式--图表统计接口班级下拉框返回classID和班级名") //只显示新建实训时添加的班级
public ResultEntity<List<Map<String, String>>> getClassByExamManageId(@RequestParam String examManageId) { public ResultEntity<List<Map<String, String>>> getClassByExamManageId(@RequestParam String examManageId,
@RequestParam String systemOwner) {
TeaAndStudentExamExample teaAndStudentExamExample = new TeaAndStudentExamExample(); TeaAndStudentExamExample teaAndStudentExamExample = new TeaAndStudentExamExample();
teaAndStudentExamExample.createCriteria().andExamManageIdEqualTo(examManageId); teaAndStudentExamExample.createCriteria().andExamManageIdEqualTo(examManageId);
List<TeaAndStudentExam> teaAndStudentExams = teaAndStudentExamMapper.selectByExample(teaAndStudentExamExample); List<TeaAndStudentExam> teaAndStudentExams = teaAndStudentExamMapper.selectByExample(teaAndStudentExamExample);
@ -220,11 +222,18 @@ public class TeaGradeManageController {
if (!teaAndStudentExams.isEmpty()) { if (!teaAndStudentExams.isEmpty()) {
TeaAndStudentExam teaAndStudentExam = teaAndStudentExams.get(0); TeaAndStudentExam teaAndStudentExam = teaAndStudentExams.get(0);
String classId = teaAndStudentExam.getClassId(); String classId = teaAndStudentExam.getClassId();
String[] split = classId.split(","); String[] split = classId.split(",");
for (String singleId : split) { List<String> idlist = Arrays.asList(split);
StuClass stuClass = stuClassMapper.selectByPrimaryKey(singleId);
StuClassExample example = new StuClassExample();
example.createCriteria().andClassIdIn(idlist).andSystemOwnerEqualTo(systemOwner);
List<StuClass> stuClassList = stuClassMapper.selectByExample(example);
for (StuClass stuClass : stuClassList) {
String className = stuClass.getClassName(); String className = stuClass.getClassName();
map.put(singleId, className); map.put(stuClass.getId(), className);
} }
list.add(map); list.add(map);
} }
@ -311,8 +320,9 @@ public class TeaGradeManageController {
@RequestParam String schoolId, @RequestParam String schoolId,
@ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord, @ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord,
@RequestParam(required = false) String classId, @RequestParam(required = false) String classId,
@RequestParam(required = false) String examManageId) { @RequestParam(required = false) String examManageId,
List<TeaExamAndUserDto> list = getTeaExamAndUserDtos(schoolId, keyWord, classId, examManageId); @RequestParam String systemOwner) {
List<TeaExamAndUserDto> list = getTeaExamAndUserDtos(schoolId, keyWord, classId, examManageId, systemOwner);
list.sort(new TeaGradeManageServiceImpl.StuUserDtoComparator()); //比较器按得分排序 list.sort(new TeaGradeManageServiceImpl.StuUserDtoComparator()); //比较器按得分排序
int i = 0; int i = 0;
@ -335,11 +345,11 @@ public class TeaGradeManageController {
} }
private List<TeaExamAndUserDto> getTeaExamAndUserDtos(String schoolId, String keyWord, String classId, String examManageId) { private List<TeaExamAndUserDto> getTeaExamAndUserDtos(String schoolId, String keyWord, String classId, String examManageId, String systemOwner) {
List<TeaExamAndUserDto> list = new ArrayList<>(); List<TeaExamAndUserDto> list = new ArrayList<>();
// 批量查询用户信息 // 批量查询用户信息
List<StuUser> stuUsers = userMapper.selectTeaExamAndUserDtos(schoolId, keyWord, classId); List<StuUser> stuUsers = userMapper.selectTeaExamAndUserDtos(schoolId, keyWord, classId, systemOwner);
// 构建用户id列表 // 构建用户id列表
List<String> userIds = stuUsers.stream() List<String> userIds = stuUsers.stream()
@ -371,7 +381,9 @@ public class TeaGradeManageController {
Map<String, StuStudentExamWithBLOBs> userExamMap = stuStudentExams.stream() Map<String, StuStudentExamWithBLOBs> userExamMap = stuStudentExams.stream()
.collect(Collectors.toMap(StuStudentExamWithBLOBs::getUserid, Function.identity())); .collect(Collectors.toMap(StuStudentExamWithBLOBs::getUserid, Function.identity()));
List<StuClass> stuClass = stuClassMapper.getByPrimaryKeys(classIds); StuClassExample example = new StuClassExample();
example.createCriteria().andClassIdIn(classIds).andSystemOwnerEqualTo(systemOwner);
List<StuClass> stuClass = stuClassMapper.selectByExample(example);
// 构建班级ID与班级对象的映射关系 // 构建班级ID与班级对象的映射关系
Map<String, StuClass> classMap = stuClass.stream() Map<String, StuClass> classMap = stuClass.stream()
@ -382,9 +394,12 @@ public class TeaGradeManageController {
TeaExamAndUserDto teaExamAndUserDto = new TeaExamAndUserDto(); TeaExamAndUserDto teaExamAndUserDto = new TeaExamAndUserDto();
teaExamAndUserDto.setName(stuUser.getName()); teaExamAndUserDto.setName(stuUser.getName());
teaExamAndUserDto.setStudentId(stuUser.getStudentId()); teaExamAndUserDto.setStudentId(stuUser.getStudentId());
// 从映射关系中获取班级对象 // 从映射关系中获取班级对象
if (classMap.get(stuUser.getClassId())==null){
continue;
}
StuClass classdata = classMap.get(stuUser.getClassId()); StuClass classdata = classMap.get(stuUser.getClassId());
teaExamAndUserDto.setClassName(classdata.getClassName()); teaExamAndUserDto.setClassName(classdata.getClassName());
StuStudentExamWithBLOBs stuStudentExam = userExamMap.get(stuUser.getUserid()); StuStudentExamWithBLOBs stuStudentExam = userExamMap.get(stuUser.getUserid());
@ -471,7 +486,10 @@ public class TeaGradeManageController {
StuUser user = userMapper.selectByPrimaryKey(trainingReport.getUserId()); StuUser user = userMapper.selectByPrimaryKey(trainingReport.getUserId());
trainingReportDto.setName(user.getName()); trainingReportDto.setName(user.getName());
trainingReportDto.setStudentId(user.getStudentId()); trainingReportDto.setStudentId(user.getStudentId());
StuClass stuClass = stuClassMapper.selectByPrimaryKey(user.getClassId()); StuClassExample example = new StuClassExample();
example.createCriteria().andClassIdEqualTo(user.getClassId());
List<StuClass> stuClassList = stuClassMapper.selectByExample(example);
StuClass stuClass = stuClassList.get(0);
trainingReportDto.setClassName(stuClass.getClassName()); trainingReportDto.setClassName(stuClass.getClassName());
list.add(trainingReportDto); list.add(trainingReportDto);
} }

@ -227,11 +227,12 @@ public class UserController {
for (int i = 0; i < zyUserInfoList.size(); i++) { for (int i = 0; i < zyUserInfoList.size(); i++) {
StuClass stuClass = new StuClass(); StuClass stuClass = new StuClass();
ZYUserInfo zyUserInfo = zyUserInfoList.get(i); ZYUserInfo zyUserInfo = zyUserInfoList.get(i);
Integer roleId = zyUserInfo.getRoleId(); //3教师 4学生
Integer zyUserId = zyUserInfo.getUserId(); Integer zyUserId = zyUserInfo.getUserId();
String username = zyUserInfo.getUsername(); // studentid String username = zyUserInfo.getUsername(); // studentid
String name = zyUserInfo.getName(); String name = zyUserInfo.getName();
String password = zyUserInfo.getPassword(); String password = zyUserInfo.getPassword();
Integer roleId = zyUserInfo.getRoleId(); //3教师 4学生
StuUserExample example = new StuUserExample(); StuUserExample example = new StuUserExample();
example.createCriteria().andZyUseridEqualTo(zyUserId).andSystemOnwerEqualTo(systemOwner); example.createCriteria().andZyUseridEqualTo(zyUserId).andSystemOnwerEqualTo(systemOwner);
@ -261,10 +262,12 @@ public class UserController {
users.add(stuUser); users.add(stuUser);
if (roleId == 4) { if (roleId == 4) {
stuClass.setId(IdUtil.randomUUID());
stuClass.setClassId(zyUserInfo.getClassId().toString()); stuClass.setClassId(zyUserInfo.getClassId().toString());
stuClass.setClassName(zyUserInfo.getClassName()); stuClass.setClassName(zyUserInfo.getClassName());
stuClass.setSchoolName(zyUserInfo.getSchoolName()); stuClass.setSchoolName(zyUserInfo.getSchoolName());
stuClass.setCreateTime(new Date()); stuClass.setCreateTime(new Date());
stuClass.setSystemOwner(systemOwner);
map.put(zyUserInfo.getClassId().toString(), stuClass); map.put(zyUserInfo.getClassId().toString(), stuClass);
} }
} }

@ -10,6 +10,8 @@ import io.swagger.annotations.ApiModelProperty;
* stu_class * stu_class
*/ */
public class StuClass { public class StuClass {
private String id;
private String classId; private String classId;
@ApiModelProperty("班级名称") @ApiModelProperty("班级名称")
@ -24,6 +26,14 @@ public class StuClass {
@ApiModelProperty("归属系统") @ApiModelProperty("归属系统")
private String systemOwner; private String systemOwner;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getClassId() { public String getClassId() {
return classId; return classId;
} }

@ -105,6 +105,76 @@ public class StuClassExample {
criteria.add(new Criterion(condition, value1, value2)); 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(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andClassIdIsNull() { public Criteria andClassIdIsNull() {
addCriterion("class_id is null"); addCriterion("class_id is null");
return (Criteria) this; return (Criteria) this;
@ -374,6 +444,76 @@ public class StuClassExample {
addCriterion("school_name not between", value1, value2, "schoolName"); addCriterion("school_name not between", value1, value2, "schoolName");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSystemOwnerIsNull() {
addCriterion("system_owner is null");
return (Criteria) this;
}
public Criteria andSystemOwnerIsNotNull() {
addCriterion("system_owner is not null");
return (Criteria) this;
}
public Criteria andSystemOwnerEqualTo(String value) {
addCriterion("system_owner =", value, "systemOwner");
return (Criteria) this;
}
public Criteria andSystemOwnerNotEqualTo(String value) {
addCriterion("system_owner <>", value, "systemOwner");
return (Criteria) this;
}
public Criteria andSystemOwnerGreaterThan(String value) {
addCriterion("system_owner >", value, "systemOwner");
return (Criteria) this;
}
public Criteria andSystemOwnerGreaterThanOrEqualTo(String value) {
addCriterion("system_owner >=", value, "systemOwner");
return (Criteria) this;
}
public Criteria andSystemOwnerLessThan(String value) {
addCriterion("system_owner <", value, "systemOwner");
return (Criteria) this;
}
public Criteria andSystemOwnerLessThanOrEqualTo(String value) {
addCriterion("system_owner <=", value, "systemOwner");
return (Criteria) this;
}
public Criteria andSystemOwnerLike(String value) {
addCriterion("system_owner like", value, "systemOwner");
return (Criteria) this;
}
public Criteria andSystemOwnerNotLike(String value) {
addCriterion("system_owner not like", value, "systemOwner");
return (Criteria) this;
}
public Criteria andSystemOwnerIn(List<String> values) {
addCriterion("system_owner in", values, "systemOwner");
return (Criteria) this;
}
public Criteria andSystemOwnerNotIn(List<String> values) {
addCriterion("system_owner not in", values, "systemOwner");
return (Criteria) this;
}
public Criteria andSystemOwnerBetween(String value1, String value2) {
addCriterion("system_owner between", value1, value2, "systemOwner");
return (Criteria) this;
}
public Criteria andSystemOwnerNotBetween(String value1, String value2) {
addCriterion("system_owner not between", value1, value2, "systemOwner");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {

@ -15,7 +15,7 @@ public interface StuClassMapper {
int deleteByExample(StuClassExample example); int deleteByExample(StuClassExample example);
int deleteByPrimaryKey(String classId); int deleteByPrimaryKey(String id);
int insert(StuClass record); int insert(StuClass record);
@ -23,7 +23,7 @@ public interface StuClassMapper {
List<StuClass> selectByExample(StuClassExample example); List<StuClass> selectByExample(StuClassExample example);
StuClass selectByPrimaryKey(String classId); StuClass selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") StuClass record, @Param("example") StuClassExample example); int updateByExampleSelective(@Param("record") StuClass record, @Param("example") StuClassExample example);
@ -40,7 +40,7 @@ public interface StuClassMapper {
@Select("SELECT s.class_name FROM stu_class s, stu_userinfo u WHERE s.class_id = u.class_id and s.class_id = #{classId};") @Select("SELECT s.class_name FROM stu_class s, stu_userinfo u WHERE s.class_id = u.class_id and s.class_id = #{classId};")
String selectClassNameByClassId(@Param("classId")String classId); String selectClassNameByClassId(@Param("classId")String classId);
List<StuClass> selectByPrimaryKeys(@Param("classIds") Set<String> classIds); // List<StuClass> selectByPrimaryKeys(@Param("classIds") Set<String> classIds);
//
List<StuClass> getByPrimaryKeys(@Param("classIds") List<String> classIds); // List<StuClass> getByPrimaryKeys(@Param("classIds") List<String> classIds);
} }

@ -66,7 +66,10 @@ public interface StuUserMapper {
"</script>") "</script>")
List<StuUser> selectByPrimaryKeys(@Param("userIds") List<String> userIds); List<StuUser> selectByPrimaryKeys(@Param("userIds") List<String> userIds);
List<StuUser> selectTeaExamAndUserDtos(@Param("schoolId")String schoolId,@Param("keyWord") String keyWord, @Param("classId")String classId); List<StuUser> selectTeaExamAndUserDtos(@Param("schoolId")String schoolId,
@Param("keyWord") String keyWord,
@Param("classId")String classId,
@Param("systemOwner")String systemOwner);
List<StuUser> getByNameAndStudentID(@Param("schoolId")String schoolId, List<StuUser> getByNameAndStudentID(@Param("schoolId")String schoolId,
@Param("keyWord") String keyWord, @Param("keyWord") String keyWord,

@ -298,7 +298,12 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
// 批量获取班级信息 // 批量获取班级信息
Set<String> classIds = stuUsers.stream().map(StuUser::getClassId).collect(Collectors.toSet()); Set<String> classIds = stuUsers.stream().map(StuUser::getClassId).collect(Collectors.toSet());
List<StuClass> stuClasses = classMapper.selectByPrimaryKeys(classIds);
StuClassExample example =new StuClassExample();
List<String> IDlist = new ArrayList<>(classIds);
example.createCriteria().andClassIdIn(IDlist).andSystemOwnerEqualTo(systemOwner);
List<StuClass> stuClasses = classMapper.selectByExample(example);
Map<String, String> classIdToNameMap = stuClasses.stream().collect(Collectors.toMap(StuClass::getClassId, StuClass::getClassName)); Map<String, String> classIdToNameMap = stuClasses.stream().collect(Collectors.toMap(StuClass::getClassId, StuClass::getClassName));
// 批量获取实训记录 // 批量获取实训记录

@ -42,7 +42,7 @@
<property name="enableSubPackages" value="true"/> <property name="enableSubPackages" value="true"/>
</javaClientGenerator> </javaClientGenerator>
<!-- 需要生成的表 --> <!-- 需要生成的表 -->
<!-- <table tableName="stu_class" domainObjectName="StuClass" />--> <table tableName="stu_class" domainObjectName="StuClass" />
<!-- <table tableName="stu_error" domainObjectName="StuError" />--> <!-- <table tableName="stu_error" domainObjectName="StuError" />-->
<!-- <table tableName="stu_exam_case" domainObjectName="StuExamCase" />--> <!-- <table tableName="stu_exam_case" domainObjectName="StuExamCase" />-->
<!-- <table tableName="stu_student_exam" domainObjectName="StuStudentExam" />--> <!-- <table tableName="stu_student_exam" domainObjectName="StuStudentExam" />-->
@ -55,7 +55,7 @@
<!-- <table tableName="sys_course_chapter" domainObjectName="SysCourseChapter" />--> <!-- <table tableName="sys_course_chapter" domainObjectName="SysCourseChapter" />-->
<!-- <table tableName="sys_log" domainObjectName="SysLog" />--> <!-- <table tableName="sys_log" domainObjectName="SysLog" />-->
<!-- <table tableName="sys_objective_question" domainObjectName="SysObjectiveQuestion" />--> <!-- <table tableName="sys_objective_question" domainObjectName="SysObjectiveQuestion" />-->
<table tableName="tea_exam_manage" domainObjectName="TeaExamManage" /> <!-- <table tableName="tea_exam_manage" domainObjectName="TeaExamManage" />-->
<!-- <table tableName="tea_learning_statistics" domainObjectName="TeaLearningStatistics" />--> <!-- <table tableName="tea_learning_statistics" domainObjectName="TeaLearningStatistics" />-->
<!-- <table tableName="tea_resource_center" domainObjectName="TeaResourceCenter" />--> <!-- <table tableName="tea_resource_center" domainObjectName="TeaResourceCenter" />-->
<!-- <table tableName="training_report" domainObjectName="TrainingReport" />--> <!-- <table tableName="training_report" domainObjectName="TrainingReport" />-->

@ -2,7 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.financial_bigdata.mapper.StuClassMapper"> <mapper namespace="com.sztzjy.financial_bigdata.mapper.StuClassMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuClass"> <resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuClass">
<id column="class_id" jdbcType="VARCHAR" property="classId" /> <id column="id" jdbcType="VARCHAR" property="id" />
<result column="class_id" jdbcType="VARCHAR" property="classId" />
<result column="class_name" jdbcType="VARCHAR" property="className" /> <result column="class_name" jdbcType="VARCHAR" property="className" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="school_name" jdbcType="VARCHAR" property="schoolName" /> <result column="school_name" jdbcType="VARCHAR" property="schoolName" />
@ -67,7 +68,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
class_id, class_name, create_time, school_name, system_owner id, class_id, class_name, create_time, school_name, system_owner
</sql> </sql>
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuClassExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuClassExample" resultMap="BaseResultMap">
select select
@ -87,11 +88,11 @@
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from stu_class from stu_class
where class_id = #{classId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from stu_class delete from stu_class
where class_id = #{classId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</delete> </delete>
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuClassExample"> <delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuClassExample">
delete from stu_class delete from stu_class
@ -100,14 +101,19 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuClass"> <insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
insert into stu_class (class_id, class_name, create_time, insert into stu_class (id, class_id, class_name,
school_name, system_owner) create_time, school_name, system_owner
values (#{classId,jdbcType=VARCHAR}, #{className,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, )
#{schoolName,jdbcType=VARCHAR}, #{systemOwner,jdbcType=VARCHAR}) values (#{id,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR}, #{className,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{schoolName,jdbcType=VARCHAR}, #{systemOwner,jdbcType=VARCHAR}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuClass"> <insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
insert into stu_class insert into stu_class
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="classId != null"> <if test="classId != null">
class_id, class_id,
</if> </if>
@ -125,6 +131,9 @@
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="classId != null"> <if test="classId != null">
#{classId,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR},
</if> </if>
@ -151,6 +160,9 @@
<update id="updateByExampleSelective" parameterType="map"> <update id="updateByExampleSelective" parameterType="map">
update stu_class update stu_class
<set> <set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.classId != null"> <if test="record.classId != null">
class_id = #{record.classId,jdbcType=VARCHAR}, class_id = #{record.classId,jdbcType=VARCHAR},
</if> </if>
@ -173,7 +185,8 @@
</update> </update>
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
update stu_class update stu_class
set class_id = #{record.classId,jdbcType=VARCHAR}, set id = #{record.id,jdbcType=VARCHAR},
class_id = #{record.classId,jdbcType=VARCHAR},
class_name = #{record.className,jdbcType=VARCHAR}, class_name = #{record.className,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
school_name = #{record.schoolName,jdbcType=VARCHAR}, school_name = #{record.schoolName,jdbcType=VARCHAR},
@ -185,6 +198,9 @@
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuClass"> <update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
update stu_class update stu_class
<set> <set>
<if test="classId != null">
class_id = #{classId,jdbcType=VARCHAR},
</if>
<if test="className != null"> <if test="className != null">
class_name = #{className,jdbcType=VARCHAR}, class_name = #{className,jdbcType=VARCHAR},
</if> </if>
@ -198,32 +214,33 @@
system_owner = #{systemOwner,jdbcType=VARCHAR}, system_owner = #{systemOwner,jdbcType=VARCHAR},
</if> </if>
</set> </set>
where class_id = #{classId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.StuClass"> <update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
update stu_class update stu_class
set class_name = #{className,jdbcType=VARCHAR}, set class_id = #{classId,jdbcType=VARCHAR},
class_name = #{className,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
school_name = #{schoolName,jdbcType=VARCHAR}, school_name = #{schoolName,jdbcType=VARCHAR},
system_owner = #{systemOwner,jdbcType=VARCHAR} system_owner = #{systemOwner,jdbcType=VARCHAR}
where class_id = #{classId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<select id="selectByPrimaryKeys" parameterType="java.util.Set" resultMap="BaseResultMap"> <!-- <select id="selectByPrimaryKeys" parameterType="java.util.Set" resultMap="BaseResultMap">-->
SELECT * <!-- SELECT *-->
FROM stu_class <!-- FROM stu_class-->
WHERE class_id IN <!-- WHERE id IN-->
<foreach close=")" collection="classIds" item="classId" open="(" separator=","> <!-- <foreach close=")" collection="classIds" item="classId" open="(" separator=",">-->
#{classId} <!-- #{id}-->
</foreach> <!-- </foreach>-->
</select> <!-- </select>-->
<select id="getByPrimaryKeys" parameterType="java.util.List" resultMap="BaseResultMap"> <!-- <select id="getByPrimaryKeys" parameterType="java.util.List" resultMap="BaseResultMap">-->
SELECT * <!-- SELECT *-->
FROM stu_class <!-- FROM stu_class-->
WHERE class_id IN <!-- WHERE id IN-->
<foreach close=")" collection="classIds" item="classId" open="(" separator=","> <!-- <foreach close=")" collection="classIds" item="classId" open="(" separator=",">-->
#{classId} <!-- #{id}-->
</foreach> <!-- </foreach>-->
</select> <!-- </select>-->
</mapper> </mapper>

@ -452,7 +452,8 @@
<select id="selectTeaExamAndUserDtos" resultMap="BaseResultMap"> <select id="selectTeaExamAndUserDtos" resultMap="BaseResultMap">
select * from stu_userinfo u select * from stu_userinfo u
where where
u.role_id = 4 system_onwer =#{systemOwner}
AND u.role_id = 4
AND u.school_id = #{schoolId} AND u.school_id = #{schoolId}
<if test="keyWord != null and keyWord!=''"> <if test="keyWord != null and keyWord!=''">
AND student_id like CONCAT ('%',#{keyWord},'%') or name like CONCAT ('%',#{keyWord},'%') AND student_id like CONCAT ('%',#{keyWord},'%') or name like CONCAT ('%',#{keyWord},'%')

Loading…
Cancel
Save