|
|
|
@ -2,21 +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" />
|
|
|
|
|
<result column="exam_status" jdbcType="VARCHAR" property="examStatus" />
|
|
|
|
|
<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>
|
|
|
|
@ -36,7 +36,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>
|
|
|
|
@ -65,7 +66,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>
|
|
|
|
@ -77,18 +79,20 @@
|
|
|
|
|
</where>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
userid, name, student_id, class_id, username, password, phone, email, major, role_id,
|
|
|
|
|
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}
|
|
|
|
@ -96,18 +100,19 @@
|
|
|
|
|
</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">
|
|
|
|
@ -115,14 +120,12 @@
|
|
|
|
|
class_id, username, password,
|
|
|
|
|
phone, email, major,
|
|
|
|
|
role_id, create_time, school_id,
|
|
|
|
|
school_name, status, exam_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}, #{examStatus,jdbcType=VARCHAR}
|
|
|
|
|
)
|
|
|
|
|
#{schoolName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{examStatus,jdbcType=VARCHAR})
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuUser">
|
|
|
|
|
insert into stu_userinfo
|
|
|
|
@ -221,10 +224,11 @@
|
|
|
|
|
</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">
|
|
|
|
@ -277,7 +281,7 @@
|
|
|
|
|
</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">
|
|
|
|
@ -298,7 +302,7 @@
|
|
|
|
|
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">
|
|
|
|
@ -380,15 +384,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">
|
|
|
|
@ -411,6 +415,18 @@
|
|
|
|
|
ORDER BY r.teacher_score DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectTeaExamAndUserDtos" resultMap="BaseResultMap">
|
|
|
|
|
select * from stu_userinfo u
|
|
|
|
|
where
|
|
|
|
|
u.role_id = 4
|
|
|
|
|
AND u.school_id = #{schoolId}
|
|
|
|
|
<if test="keyWord != null and keyWord!=''">
|
|
|
|
|
AND (u.name = #{keyWord} OR u.student_id = #{keyWord})
|
|
|
|
|
</if>
|
|
|
|
|
<if test="classId != null and classId !=''">
|
|
|
|
|
AND u.class_id = #{classId}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getAllUsersByExamManageId" resultType="java.lang.Integer">
|
|
|
|
|
SELECT SUM(user_count) AS total_user_count
|
|
|
|
|