|
|
|
@ -2,20 +2,21 @@
|
|
|
|
|
<!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.StuUserMapper">
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuUser">
|
|
|
|
|
<id column="userid" jdbcType="VARCHAR" property="userid"/>
|
|
|
|
|
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
|
|
|
<result column="student_id" jdbcType="VARCHAR" property="studentId"/>
|
|
|
|
|
<result column="class_id" jdbcType="VARCHAR" property="classId"/>
|
|
|
|
|
<result column="username" jdbcType="VARCHAR" property="username"/>
|
|
|
|
|
<result column="password" jdbcType="VARCHAR" property="password"/>
|
|
|
|
|
<result column="phone" jdbcType="VARCHAR" property="phone"/>
|
|
|
|
|
<result column="email" jdbcType="VARCHAR" property="email"/>
|
|
|
|
|
<result column="major" jdbcType="VARCHAR" property="major"/>
|
|
|
|
|
<result column="role_id" jdbcType="INTEGER" property="roleId"/>
|
|
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
|
|
<result column="school_id" jdbcType="VARCHAR" property="schoolId"/>
|
|
|
|
|
<result column="school_name" jdbcType="VARCHAR" property="schoolName"/>
|
|
|
|
|
<result column="status" jdbcType="INTEGER" property="status"/>
|
|
|
|
|
<id column="userid" jdbcType="VARCHAR" property="userid" />
|
|
|
|
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
|
|
|
|
<result column="student_id" jdbcType="VARCHAR" property="studentId" />
|
|
|
|
|
<result column="class_id" jdbcType="VARCHAR" property="classId" />
|
|
|
|
|
<result column="username" jdbcType="VARCHAR" property="username" />
|
|
|
|
|
<result column="password" jdbcType="VARCHAR" property="password" />
|
|
|
|
|
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
|
|
|
|
<result column="email" jdbcType="VARCHAR" property="email" />
|
|
|
|
|
<result column="major" jdbcType="VARCHAR" property="major" />
|
|
|
|
|
<result column="role_id" jdbcType="INTEGER" property="roleId" />
|
|
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
|
|
<result column="school_id" jdbcType="VARCHAR" property="schoolId" />
|
|
|
|
|
<result column="school_name" jdbcType="VARCHAR" property="schoolName" />
|
|
|
|
|
<result column="status" jdbcType="INTEGER" property="status" />
|
|
|
|
|
<result column="exam_status" jdbcType="VARCHAR" property="examStatus" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
<sql id="Example_Where_Clause">
|
|
|
|
|
<where>
|
|
|
|
@ -35,8 +36,7 @@
|
|
|
|
|
</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>
|
|
|
|
@ -65,8 +65,7 @@
|
|
|
|
|
</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>
|
|
|
|
@ -78,20 +77,18 @@
|
|
|
|
|
</where>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
userid
|
|
|
|
|
, name, student_id, class_id, username, password, phone, email, major, role_id,
|
|
|
|
|
create_time, school_id, school_name, status
|
|
|
|
|
userid, name, student_id, class_id, username, password, phone, email, major, role_id,
|
|
|
|
|
create_time, school_id, school_name, status, exam_status
|
|
|
|
|
</sql>
|
|
|
|
|
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuUserExample"
|
|
|
|
|
resultMap="BaseResultMap">
|
|
|
|
|
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuUserExample" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<if test="distinct">
|
|
|
|
|
distinct
|
|
|
|
|
</if>
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
from stu_userinfo
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderByClause != null">
|
|
|
|
|
order by ${orderByClause}
|
|
|
|
@ -99,19 +96,18 @@
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
from stu_userinfo
|
|
|
|
|
where userid = #{userid,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
|
|
delete
|
|
|
|
|
from stu_userinfo
|
|
|
|
|
delete from stu_userinfo
|
|
|
|
|
where userid = #{userid,jdbcType=VARCHAR}
|
|
|
|
|
</delete>
|
|
|
|
|
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuUserExample">
|
|
|
|
|
delete from stu_userinfo
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
</delete>
|
|
|
|
|
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuUser">
|
|
|
|
@ -119,12 +115,14 @@
|
|
|
|
|
class_id, username, password,
|
|
|
|
|
phone, email, major,
|
|
|
|
|
role_id, create_time, school_id,
|
|
|
|
|
school_name, status)
|
|
|
|
|
school_name, status, exam_status
|
|
|
|
|
)
|
|
|
|
|
values (#{userid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{studentId,jdbcType=VARCHAR},
|
|
|
|
|
#{classId,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
|
|
|
|
|
#{phone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{major,jdbcType=VARCHAR},
|
|
|
|
|
#{roleId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{schoolId,jdbcType=VARCHAR},
|
|
|
|
|
#{schoolName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER})
|
|
|
|
|
#{schoolName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{examStatus,jdbcType=VARCHAR}
|
|
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuUser">
|
|
|
|
|
insert into stu_userinfo
|
|
|
|
@ -171,6 +169,9 @@
|
|
|
|
|
<if test="status != null">
|
|
|
|
|
status,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="examStatus != null">
|
|
|
|
|
exam_status,
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="userid != null">
|
|
|
|
@ -215,13 +216,15 @@
|
|
|
|
|
<if test="status != null">
|
|
|
|
|
#{status,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="examStatus != null">
|
|
|
|
|
#{examStatus,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuUserExample"
|
|
|
|
|
resultType="java.lang.Long">
|
|
|
|
|
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuUserExample" resultType="java.lang.Long">
|
|
|
|
|
select count(*) from stu_userinfo
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
|
|
@ -269,9 +272,12 @@
|
|
|
|
|
<if test="record.status != null">
|
|
|
|
|
status = #{record.status,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="record.examStatus != null">
|
|
|
|
|
exam_status = #{record.examStatus,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause"/>
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByExample" parameterType="map">
|
|
|
|
@ -289,9 +295,10 @@
|
|
|
|
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
school_id = #{record.schoolId,jdbcType=VARCHAR},
|
|
|
|
|
school_name = #{record.schoolName,jdbcType=VARCHAR},
|
|
|
|
|
status = #{record.status,jdbcType=INTEGER}
|
|
|
|
|
status = #{record.status,jdbcType=INTEGER},
|
|
|
|
|
exam_status = #{record.examStatus,jdbcType=VARCHAR}
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause"/>
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuUser">
|
|
|
|
@ -336,6 +343,9 @@
|
|
|
|
|
<if test="status != null">
|
|
|
|
|
status = #{status,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="examStatus != null">
|
|
|
|
|
exam_status = #{examStatus,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
where userid = #{userid,jdbcType=VARCHAR}
|
|
|
|
|
</update>
|
|
|
|
@ -353,10 +363,10 @@
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
school_id = #{schoolId,jdbcType=VARCHAR},
|
|
|
|
|
school_name = #{schoolName,jdbcType=VARCHAR},
|
|
|
|
|
status = #{status,jdbcType=INTEGER}
|
|
|
|
|
status = #{status,jdbcType=INTEGER},
|
|
|
|
|
exam_status = #{examStatus,jdbcType=VARCHAR}
|
|
|
|
|
where userid = #{userid,jdbcType=VARCHAR}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<insert id="batchInsertStudents" parameterType="java.util.List">
|
|
|
|
|
INSERT INTO stu_userinfo (userid, name, student_id, class_id, username, password, phone,
|
|
|
|
|
school_name,email,major,
|
|
|
|
@ -370,15 +380,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="UserDtoMap" type="com.sztzjy.financial_bigdata.entity.stu_dto.StuUserDto">
|
|
|
|
|
<result column="school_name" jdbcType="VARCHAR" property="schoolName"/>
|
|
|
|
|
<result column="class_name" jdbcType="VARCHAR" property="className"/>
|
|
|
|
|
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
|
|
|
<result column="student_id" jdbcType="VARCHAR" property="studentId"/>
|
|
|
|
|
<result column="phone" jdbcType="VARCHAR" property="phone"/>
|
|
|
|
|
<result column="email" jdbcType="VARCHAR" property="email"/>
|
|
|
|
|
<result column="score" jdbcType="VARCHAR" property="score"/>
|
|
|
|
|
<result column="chapter_name" jdbcType="VARCHAR" property="chapterName"/>
|
|
|
|
|
<result column="report_id" jdbcType="VARCHAR" property="reportId"/>
|
|
|
|
|
<result column="school_name" jdbcType="VARCHAR" property="schoolName" />
|
|
|
|
|
<result column="class_name" jdbcType="VARCHAR" property="className" />
|
|
|
|
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
|
|
|
|
<result column="student_id" jdbcType="VARCHAR" property="studentId" />
|
|
|
|
|
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
|
|
|
|
<result column="email" jdbcType="VARCHAR" property="email" />
|
|
|
|
|
<result column="score" jdbcType="VARCHAR" property="score" />
|
|
|
|
|
<result column="chapter_name" jdbcType="VARCHAR" property="chapterName" />
|
|
|
|
|
<result column="report_id" jdbcType="VARCHAR" property="reportId" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<select id="selectByCondition" resultMap="UserDtoMap">
|
|
|
|
@ -409,9 +419,11 @@
|
|
|
|
|
WHERE class_id IN (SELECT class_id
|
|
|
|
|
FROM tea_and_student_exam
|
|
|
|
|
WHERE exam_manage_id = #{examManageId}
|
|
|
|
|
<if test='classId != null and classId != ""'>
|
|
|
|
|
<if test="classId != null and classId != """>
|
|
|
|
|
AND class_id = #{classId}
|
|
|
|
|
</if>
|
|
|
|
|
)GROUP BY class_id ) AS subquery;
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|