This commit is contained in:
alvis
2020-07-16 14:12:31 +08:00
parent 1c159a7bad
commit f746aef851
2140 changed files with 7218 additions and 4689 deletions

View File

@@ -0,0 +1,254 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.ExamPaperAnswerMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.ExamPaperAnswer">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="exam_paper_id" jdbcType="INTEGER" property="examPaperId" />
<result column="paper_name" jdbcType="VARCHAR" property="paperName" />
<result column="paper_type" jdbcType="INTEGER" property="paperType" />
<result column="subject_id" jdbcType="INTEGER" property="subjectId" />
<result column="system_score" jdbcType="INTEGER" property="systemScore" />
<result column="user_score" jdbcType="INTEGER" property="userScore" />
<result column="paper_score" jdbcType="INTEGER" property="paperScore" />
<result column="question_correct" jdbcType="INTEGER" property="questionCorrect" />
<result column="question_count" jdbcType="INTEGER" property="questionCount" />
<result column="do_time" jdbcType="INTEGER" property="doTime" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_user" jdbcType="INTEGER" property="createUser" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="task_exam_id" jdbcType="INTEGER" property="taskExamId" />
</resultMap>
<sql id="Base_Column_List">
id, exam_paper_id, paper_name, paper_type, subject_id, system_score, user_score,
paper_score, question_correct, question_count, do_time, status, create_user, create_time,
task_exam_id
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_exam_paper_answer
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_exam_paper_answer
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.ExamPaperAnswer" useGeneratedKeys="true" keyProperty="id">
insert into t_exam_paper_answer (id, exam_paper_id, paper_name,
paper_type, subject_id, system_score,
user_score, paper_score, question_correct,
question_count, do_time, status,
create_user, create_time, task_exam_id
)
values (#{id,jdbcType=INTEGER}, #{examPaperId,jdbcType=INTEGER}, #{paperName,jdbcType=VARCHAR},
#{paperType,jdbcType=INTEGER}, #{subjectId,jdbcType=INTEGER}, #{systemScore,jdbcType=INTEGER},
#{userScore,jdbcType=INTEGER}, #{paperScore,jdbcType=INTEGER}, #{questionCorrect,jdbcType=INTEGER},
#{questionCount,jdbcType=INTEGER}, #{doTime,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{createUser,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{taskExamId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.ExamPaperAnswer" useGeneratedKeys="true" keyProperty="id">
insert into t_exam_paper_answer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="examPaperId != null">
exam_paper_id,
</if>
<if test="paperName != null">
paper_name,
</if>
<if test="paperType != null">
paper_type,
</if>
<if test="subjectId != null">
subject_id,
</if>
<if test="systemScore != null">
system_score,
</if>
<if test="userScore != null">
user_score,
</if>
<if test="paperScore != null">
paper_score,
</if>
<if test="questionCorrect != null">
question_correct,
</if>
<if test="questionCount != null">
question_count,
</if>
<if test="doTime != null">
do_time,
</if>
<if test="status != null">
status,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="taskExamId != null">
task_exam_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="examPaperId != null">
#{examPaperId,jdbcType=INTEGER},
</if>
<if test="paperName != null">
#{paperName,jdbcType=VARCHAR},
</if>
<if test="paperType != null">
#{paperType,jdbcType=INTEGER},
</if>
<if test="subjectId != null">
#{subjectId,jdbcType=INTEGER},
</if>
<if test="systemScore != null">
#{systemScore,jdbcType=INTEGER},
</if>
<if test="userScore != null">
#{userScore,jdbcType=INTEGER},
</if>
<if test="paperScore != null">
#{paperScore,jdbcType=INTEGER},
</if>
<if test="questionCorrect != null">
#{questionCorrect,jdbcType=INTEGER},
</if>
<if test="questionCount != null">
#{questionCount,jdbcType=INTEGER},
</if>
<if test="doTime != null">
#{doTime,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="createUser != null">
#{createUser,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="taskExamId != null">
#{taskExamId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.ExamPaperAnswer">
update t_exam_paper_answer
<set>
<if test="examPaperId != null">
exam_paper_id = #{examPaperId,jdbcType=INTEGER},
</if>
<if test="paperName != null">
paper_name = #{paperName,jdbcType=VARCHAR},
</if>
<if test="paperType != null">
paper_type = #{paperType,jdbcType=INTEGER},
</if>
<if test="subjectId != null">
subject_id = #{subjectId,jdbcType=INTEGER},
</if>
<if test="systemScore != null">
system_score = #{systemScore,jdbcType=INTEGER},
</if>
<if test="userScore != null">
user_score = #{userScore,jdbcType=INTEGER},
</if>
<if test="paperScore != null">
paper_score = #{paperScore,jdbcType=INTEGER},
</if>
<if test="questionCorrect != null">
question_correct = #{questionCorrect,jdbcType=INTEGER},
</if>
<if test="questionCount != null">
question_count = #{questionCount,jdbcType=INTEGER},
</if>
<if test="doTime != null">
do_time = #{doTime,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="taskExamId != null">
task_exam_id = #{taskExamId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.ExamPaperAnswer">
update t_exam_paper_answer
set exam_paper_id = #{examPaperId,jdbcType=INTEGER},
paper_name = #{paperName,jdbcType=VARCHAR},
paper_type = #{paperType,jdbcType=INTEGER},
subject_id = #{subjectId,jdbcType=INTEGER},
system_score = #{systemScore,jdbcType=INTEGER},
user_score = #{userScore,jdbcType=INTEGER},
paper_score = #{paperScore,jdbcType=INTEGER},
question_correct = #{questionCorrect,jdbcType=INTEGER},
question_count = #{questionCount,jdbcType=INTEGER},
do_time = #{doTime,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_user = #{createUser,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
task_exam_id = #{taskExamId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="studentPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageVM">
SELECT
<include refid="Base_Column_List"/>
FROM t_exam_paper_answer
<where>
and create_user = #{createUser}
<if test="subjectId != null">
and subject_id = #{subjectId}
</if>
</where>
</select>
<select id="selectAllCount" resultType="java.lang.Integer">
SELECT count(*) from t_exam_paper_answer
</select>
<select id="selectCountByDate" resultType="com.mindskip.xzs.domain.other.KeyValue">
SELECT create_time as name,COUNT(create_time) as value from
(
SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_exam_paper_answer
WHERE create_time between #{startTime} and #{endTime}
) a
GROUP BY create_time
</select>
<select id="getByPidUid" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_exam_paper_answer
where exam_paper_id = #{pid} and create_user=#{uid}
limit 1
</select>
</mapper>

View File

@@ -0,0 +1,331 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.ExamPaperMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.ExamPaper">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="subject_id" jdbcType="INTEGER" property="subjectId" />
<result column="paper_type" jdbcType="INTEGER" property="paperType" />
<result column="grade_level" jdbcType="INTEGER" property="gradeLevel" />
<result column="score" jdbcType="INTEGER" property="score" />
<result column="question_count" jdbcType="INTEGER" property="questionCount" />
<result column="suggest_time" jdbcType="INTEGER" property="suggestTime" />
<result column="limit_start_time" jdbcType="TIMESTAMP" property="limitStartTime" />
<result column="limit_end_time" jdbcType="TIMESTAMP" property="limitEndTime" />
<result column="frame_text_content_id" jdbcType="INTEGER" property="frameTextContentId" />
<result column="create_user" jdbcType="INTEGER" property="createUser" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="task_exam_id" jdbcType="INTEGER" property="taskExamId" />
</resultMap>
<sql id="Base_Column_List">
id, name, subject_id, paper_type, grade_level, score, question_count, suggest_time,
limit_start_time, limit_end_time, frame_text_content_id, create_user, create_time,
deleted, task_exam_id
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_exam_paper
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_exam_paper
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.ExamPaper" useGeneratedKeys="true" keyProperty="id">
insert into t_exam_paper (id, name, subject_id,
paper_type, grade_level, score,
question_count, suggest_time, limit_start_time,
limit_end_time, frame_text_content_id, create_user,
create_time, deleted, task_exam_id
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{subjectId,jdbcType=INTEGER},
#{paperType,jdbcType=INTEGER}, #{gradeLevel,jdbcType=INTEGER}, #{score,jdbcType=INTEGER},
#{questionCount,jdbcType=INTEGER}, #{suggestTime,jdbcType=INTEGER}, #{limitStartTime,jdbcType=TIMESTAMP},
#{limitEndTime,jdbcType=TIMESTAMP}, #{frameTextContentId,jdbcType=INTEGER}, #{createUser,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}, #{taskExamId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.ExamPaper" useGeneratedKeys="true" keyProperty="id">
insert into t_exam_paper
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="subjectId != null">
subject_id,
</if>
<if test="paperType != null">
paper_type,
</if>
<if test="gradeLevel != null">
grade_level,
</if>
<if test="score != null">
score,
</if>
<if test="questionCount != null">
question_count,
</if>
<if test="suggestTime != null">
suggest_time,
</if>
<if test="limitStartTime != null">
limit_start_time,
</if>
<if test="limitEndTime != null">
limit_end_time,
</if>
<if test="frameTextContentId != null">
frame_text_content_id,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="taskExamId != null">
task_exam_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="subjectId != null">
#{subjectId,jdbcType=INTEGER},
</if>
<if test="paperType != null">
#{paperType,jdbcType=INTEGER},
</if>
<if test="gradeLevel != null">
#{gradeLevel,jdbcType=INTEGER},
</if>
<if test="score != null">
#{score,jdbcType=INTEGER},
</if>
<if test="questionCount != null">
#{questionCount,jdbcType=INTEGER},
</if>
<if test="suggestTime != null">
#{suggestTime,jdbcType=INTEGER},
</if>
<if test="limitStartTime != null">
#{limitStartTime,jdbcType=TIMESTAMP},
</if>
<if test="limitEndTime != null">
#{limitEndTime,jdbcType=TIMESTAMP},
</if>
<if test="frameTextContentId != null">
#{frameTextContentId,jdbcType=INTEGER},
</if>
<if test="createUser != null">
#{createUser,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
<if test="taskExamId != null">
#{taskExamId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.ExamPaper">
update t_exam_paper
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="subjectId != null">
subject_id = #{subjectId,jdbcType=INTEGER},
</if>
<if test="paperType != null">
paper_type = #{paperType,jdbcType=INTEGER},
</if>
<if test="gradeLevel != null">
grade_level = #{gradeLevel,jdbcType=INTEGER},
</if>
<if test="score != null">
score = #{score,jdbcType=INTEGER},
</if>
<if test="questionCount != null">
question_count = #{questionCount,jdbcType=INTEGER},
</if>
<if test="suggestTime != null">
suggest_time = #{suggestTime,jdbcType=INTEGER},
</if>
<if test="limitStartTime != null">
limit_start_time = #{limitStartTime,jdbcType=TIMESTAMP},
</if>
<if test="limitEndTime != null">
limit_end_time = #{limitEndTime,jdbcType=TIMESTAMP},
</if>
<if test="frameTextContentId != null">
frame_text_content_id = #{frameTextContentId,jdbcType=INTEGER},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
<if test="taskExamId != null">
task_exam_id = #{taskExamId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.ExamPaper">
update t_exam_paper
set name = #{name,jdbcType=VARCHAR},
subject_id = #{subjectId,jdbcType=INTEGER},
paper_type = #{paperType,jdbcType=INTEGER},
grade_level = #{gradeLevel,jdbcType=INTEGER},
score = #{score,jdbcType=INTEGER},
question_count = #{questionCount,jdbcType=INTEGER},
suggest_time = #{suggestTime,jdbcType=INTEGER},
limit_start_time = #{limitStartTime,jdbcType=TIMESTAMP},
limit_end_time = #{limitEndTime,jdbcType=TIMESTAMP},
frame_text_content_id = #{frameTextContentId,jdbcType=INTEGER},
create_user = #{createUser,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=BIT},
task_exam_id = #{taskExamId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<resultMap id="PaperInfoResultMap" type="com.mindskip.xzs.viewmodel.student.dashboard.PaperInfo">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="limit_start_time" jdbcType="TIMESTAMP" property="limitStartTime" />
<result column="limit_end_time" jdbcType="TIMESTAMP" property="limitEndTime" />
</resultMap>
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM">
SELECT
<include refid="Base_Column_List"/>
FROM t_exam_paper
<where>
and deleted=0
<if test="id != null ">
and id= #{id}
</if>
<if test="level != null ">
and grade_level= #{level}
</if>
<if test="subjectId != null ">
and subject_id= #{subjectId}
</if>
<if test="paperType != null ">
and paper_type= #{paperType}
</if>
</where>
</select>
<select id="taskExamPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM">
SELECT
<include refid="Base_Column_List"/>
FROM t_exam_paper
<where>
and deleted=0
and task_exam_id is null
and grade_level= #{level}
and paper_type=#{paperType}
</where>
</select>
<select id="studentPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.student.exam.ExamPaperPageVM">
SELECT
<include refid="Base_Column_List"/>
FROM t_exam_paper
<where>
and deleted=0
<if test="subjectId != null ">
and subject_id=#{subjectId}
</if>
<if test="levelId != null ">
and grade_level=#{levelId}
</if>
and paper_type=#{paperType}
</where>
</select>
<select id="indexPaper" resultMap="PaperInfoResultMap" parameterType="com.mindskip.xzs.viewmodel.student.dashboard.PaperFilter">
SELECT id,name,limit_start_time,limit_end_time
FROM t_exam_paper
<where>
and deleted=0
and paper_type= #{examPaperType}
and grade_level=#{gradeLevel}
<if test="examPaperType == 3 ">
</if>
<if test="examPaperType == 4 ">
and #{dateTime} between limit_start_time and limit_end_time
</if>
</where>
ORDER BY id desc limit 5
</select>
<select id="selectAllCount" resultType="java.lang.Integer">
SELECT count(*) from t_exam_paper where deleted=0
</select>
<select id="selectCountByDate" resultType="com.mindskip.xzs.domain.other.KeyValue">
SELECT create_time as name,COUNT(create_time) as value from
(
SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_exam_paper
WHERE deleted=0 and create_time between #{startTime} and #{endTime}
) a
GROUP BY create_time
</select>
<update id="updateTaskPaper">
update t_exam_paper set task_exam_id = #{taskId} where id in
<foreach item="id" collection="paperIds" open="(" separator=","
close=")">
#{id}
</foreach>
</update>
<update id="clearTaskPaper" parameterType="java.util.List">
update t_exam_paper set task_exam_id = null where id in
<foreach item="id" collection="paperIds" open="(" separator=","
close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,282 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.ExamPaperQuestionCustomerAnswerMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="question_id" jdbcType="INTEGER" property="questionId" />
<result column="exam_paper_id" jdbcType="INTEGER" property="examPaperId" />
<result column="exam_paper_answer_id" jdbcType="INTEGER" property="examPaperAnswerId" />
<result column="question_type" jdbcType="INTEGER" property="questionType" />
<result column="subject_id" jdbcType="INTEGER" property="subjectId" />
<result column="customer_score" jdbcType="INTEGER" property="customerScore" />
<result column="question_score" jdbcType="INTEGER" property="questionScore" />
<result column="question_text_content_id" jdbcType="INTEGER" property="questionTextContentId" />
<result column="answer" jdbcType="VARCHAR" property="answer" />
<result column="text_content_id" jdbcType="INTEGER" property="textContentId" />
<result column="do_right" jdbcType="BIT" property="doRight" />
<result column="create_user" jdbcType="INTEGER" property="createUser" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="item_order" jdbcType="INTEGER" property="itemOrder" />
</resultMap>
<sql id="Base_Column_List">
id, question_id, exam_paper_id, exam_paper_answer_id, question_type, subject_id,
customer_score, question_score, question_text_content_id, answer, text_content_id,
do_right, create_user, create_time, item_order
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_exam_paper_question_customer_answer
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_exam_paper_question_customer_answer
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer" useGeneratedKeys="true" keyProperty="id">
insert into t_exam_paper_question_customer_answer (id, question_id, exam_paper_id,
exam_paper_answer_id, question_type, subject_id,
customer_score, question_score, question_text_content_id,
answer, text_content_id, do_right,
create_user, create_time, item_order
)
values (#{id,jdbcType=INTEGER}, #{questionId,jdbcType=INTEGER}, #{examPaperId,jdbcType=INTEGER},
#{examPaperAnswerId,jdbcType=INTEGER}, #{questionType,jdbcType=INTEGER}, #{subjectId,jdbcType=INTEGER},
#{customerScore,jdbcType=INTEGER}, #{questionScore,jdbcType=INTEGER}, #{questionTextContentId,jdbcType=INTEGER},
#{answer,jdbcType=VARCHAR}, #{textContentId,jdbcType=INTEGER}, #{doRight,jdbcType=BIT},
#{createUser,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{itemOrder,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer" useGeneratedKeys="true" keyProperty="id">
insert into t_exam_paper_question_customer_answer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="questionId != null">
question_id,
</if>
<if test="examPaperId != null">
exam_paper_id,
</if>
<if test="examPaperAnswerId != null">
exam_paper_answer_id,
</if>
<if test="questionType != null">
question_type,
</if>
<if test="subjectId != null">
subject_id,
</if>
<if test="customerScore != null">
customer_score,
</if>
<if test="questionScore != null">
question_score,
</if>
<if test="questionTextContentId != null">
question_text_content_id,
</if>
<if test="answer != null">
answer,
</if>
<if test="textContentId != null">
text_content_id,
</if>
<if test="doRight != null">
do_right,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="itemOrder != null">
item_order,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="questionId != null">
#{questionId,jdbcType=INTEGER},
</if>
<if test="examPaperId != null">
#{examPaperId,jdbcType=INTEGER},
</if>
<if test="examPaperAnswerId != null">
#{examPaperAnswerId,jdbcType=INTEGER},
</if>
<if test="questionType != null">
#{questionType,jdbcType=INTEGER},
</if>
<if test="subjectId != null">
#{subjectId,jdbcType=INTEGER},
</if>
<if test="customerScore != null">
#{customerScore,jdbcType=INTEGER},
</if>
<if test="questionScore != null">
#{questionScore,jdbcType=INTEGER},
</if>
<if test="questionTextContentId != null">
#{questionTextContentId,jdbcType=INTEGER},
</if>
<if test="answer != null">
#{answer,jdbcType=VARCHAR},
</if>
<if test="textContentId != null">
#{textContentId,jdbcType=INTEGER},
</if>
<if test="doRight != null">
#{doRight,jdbcType=BIT},
</if>
<if test="createUser != null">
#{createUser,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="itemOrder != null">
#{itemOrder,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer">
update t_exam_paper_question_customer_answer
<set>
<if test="questionId != null">
question_id = #{questionId,jdbcType=INTEGER},
</if>
<if test="examPaperId != null">
exam_paper_id = #{examPaperId,jdbcType=INTEGER},
</if>
<if test="examPaperAnswerId != null">
exam_paper_answer_id = #{examPaperAnswerId,jdbcType=INTEGER},
</if>
<if test="questionType != null">
question_type = #{questionType,jdbcType=INTEGER},
</if>
<if test="subjectId != null">
subject_id = #{subjectId,jdbcType=INTEGER},
</if>
<if test="customerScore != null">
customer_score = #{customerScore,jdbcType=INTEGER},
</if>
<if test="questionScore != null">
question_score = #{questionScore,jdbcType=INTEGER},
</if>
<if test="questionTextContentId != null">
question_text_content_id = #{questionTextContentId,jdbcType=INTEGER},
</if>
<if test="answer != null">
answer = #{answer,jdbcType=VARCHAR},
</if>
<if test="textContentId != null">
text_content_id = #{textContentId,jdbcType=INTEGER},
</if>
<if test="doRight != null">
do_right = #{doRight,jdbcType=BIT},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="itemOrder != null">
item_order = #{itemOrder,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer">
update t_exam_paper_question_customer_answer
set question_id = #{questionId,jdbcType=INTEGER},
exam_paper_id = #{examPaperId,jdbcType=INTEGER},
exam_paper_answer_id = #{examPaperAnswerId,jdbcType=INTEGER},
question_type = #{questionType,jdbcType=INTEGER},
subject_id = #{subjectId,jdbcType=INTEGER},
customer_score = #{customerScore,jdbcType=INTEGER},
question_score = #{questionScore,jdbcType=INTEGER},
question_text_content_id = #{questionTextContentId,jdbcType=INTEGER},
answer = #{answer,jdbcType=VARCHAR},
text_content_id = #{textContentId,jdbcType=INTEGER},
do_right = #{doRight,jdbcType=BIT},
create_user = #{createUser,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
item_order = #{itemOrder,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectListByPaperAnswerId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_exam_paper_question_customer_answer
where exam_paper_answer_id = #{id,jdbcType=INTEGER}
order by item_order
</select>
<select id="studentPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentRequestVM">
SELECT
<include refid="Base_Column_List"/>
FROM t_exam_paper_question_customer_answer
<where>
and do_right=FALSE
and create_user=#{createUser}
</where>
</select>
<insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id" >
insert into t_exam_paper_question_customer_answer ( question_id, question_score,
subject_id, create_time, create_user,
text_content_id, exam_paper_id, question_type,
answer, customer_score, exam_paper_answer_id ,
do_right,question_text_content_id,item_order)
values
<foreach collection="list" item="item" index="index"
separator=",">
( #{item.questionId,jdbcType=INTEGER}, #{item.questionScore,jdbcType=INTEGER},
#{item.subjectId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.createUser,jdbcType=INTEGER},
#{item.textContentId,jdbcType=INTEGER}, #{item.examPaperId,jdbcType=INTEGER}, #{item.questionType,jdbcType=INTEGER},
#{item.answer,jdbcType=VARCHAR}, #{item.customerScore,jdbcType=INTEGER}, #{item.examPaperAnswerId,jdbcType=INTEGER},
#{item.doRight,jdbcType=BIT},#{item.questionTextContentId,jdbcType=INTEGER},#{item.itemOrder,jdbcType=INTEGER})
</foreach>
</insert>
<select id="selectAllCount" resultType="java.lang.Integer">
SELECT count(*) from t_exam_paper_question_customer_answer
</select>
<select id="selectCountByDate" resultType="com.mindskip.xzs.domain.other.KeyValue">
SELECT create_time as name,COUNT(create_time) as value from
(
SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_exam_paper_question_customer_answer
WHERE create_time between #{startTime} and #{endTime}
) a
GROUP BY create_time
</select>
<update id="updateScore" parameterType="java.util.List">
<foreach collection="list" item="item" >
update t_exam_paper_question_customer_answer
set customer_score=#{item.customerScore} , do_right=#{item.doRight}
where id=#{item.id} ;
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.MessageMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.Message">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="send_user_id" jdbcType="INTEGER" property="sendUserId" />
<result column="send_user_name" jdbcType="VARCHAR" property="sendUserName" />
<result column="send_real_name" jdbcType="VARCHAR" property="sendRealName" />
<result column="receive_user_count" jdbcType="INTEGER" property="receiveUserCount" />
<result column="read_count" jdbcType="INTEGER" property="readCount" />
</resultMap>
<sql id="Base_Column_List">
id, title, content, create_time, send_user_id, send_user_name, send_real_name, receive_user_count,
read_count
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_message
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_message
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.Message" useGeneratedKeys="true" keyProperty="id">
insert into t_message (id, title, content,
create_time, send_user_id, send_user_name,
send_real_name, receive_user_count, read_count
)
values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{sendUserId,jdbcType=INTEGER}, #{sendUserName,jdbcType=VARCHAR},
#{sendRealName,jdbcType=VARCHAR}, #{receiveUserCount,jdbcType=INTEGER}, #{readCount,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.Message" useGeneratedKeys="true" keyProperty="id">
insert into t_message
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="title != null">
title,
</if>
<if test="content != null">
content,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="sendUserId != null">
send_user_id,
</if>
<if test="sendUserName != null">
send_user_name,
</if>
<if test="sendRealName != null">
send_real_name,
</if>
<if test="receiveUserCount != null">
receive_user_count,
</if>
<if test="readCount != null">
read_count,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="sendUserId != null">
#{sendUserId,jdbcType=INTEGER},
</if>
<if test="sendUserName != null">
#{sendUserName,jdbcType=VARCHAR},
</if>
<if test="sendRealName != null">
#{sendRealName,jdbcType=VARCHAR},
</if>
<if test="receiveUserCount != null">
#{receiveUserCount,jdbcType=INTEGER},
</if>
<if test="readCount != null">
#{readCount,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.Message">
update t_message
<set>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="sendUserId != null">
send_user_id = #{sendUserId,jdbcType=INTEGER},
</if>
<if test="sendUserName != null">
send_user_name = #{sendUserName,jdbcType=VARCHAR},
</if>
<if test="sendRealName != null">
send_real_name = #{sendRealName,jdbcType=VARCHAR},
</if>
<if test="receiveUserCount != null">
receive_user_count = #{receiveUserCount,jdbcType=INTEGER},
</if>
<if test="readCount != null">
read_count = #{readCount,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.Message">
update t_message
set title = #{title,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
send_user_id = #{sendUserId,jdbcType=INTEGER},
send_user_name = #{sendUserName,jdbcType=VARCHAR},
send_real_name = #{sendRealName,jdbcType=VARCHAR},
receive_user_count = #{receiveUserCount,jdbcType=INTEGER},
read_count = #{readCount,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.message.MessagePageRequestVM">
select
<include refid="Base_Column_List" />
from t_message
<where>
<if test="sendUserName != null">
and send_user_name like concat('%',#{sendUserName},'%')
</if>
</where>
</select>
<select id="selectByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_message
where id in
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<update id="readAdd" parameterType="java.lang.Integer">
UPDATE t_message SET read_count = read_count + 1
WHERE id= #{id} and read_count = (SELECT m.read_count from ( SELECT read_count FROM t_message WHERE id = #{id} ) m)
</update>
</mapper>

View File

@@ -0,0 +1,174 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.MessageUserMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.MessageUser">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="message_id" jdbcType="INTEGER" property="messageId" />
<result column="receive_user_id" jdbcType="INTEGER" property="receiveUserId" />
<result column="receive_user_name" jdbcType="VARCHAR" property="receiveUserName" />
<result column="receive_real_name" jdbcType="VARCHAR" property="receiveRealName" />
<result column="readed" jdbcType="BIT" property="readed" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="read_time" jdbcType="TIMESTAMP" property="readTime" />
</resultMap>
<sql id="Base_Column_List">
id, message_id, receive_user_id, receive_user_name, receive_real_name, readed, create_time,
read_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_message_user
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_message_user
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.MessageUser" useGeneratedKeys="true" keyProperty="id">
insert into t_message_user (id, message_id, receive_user_id,
receive_user_name, receive_real_name, readed,
create_time, read_time)
values (#{id,jdbcType=INTEGER}, #{messageId,jdbcType=INTEGER}, #{receiveUserId,jdbcType=INTEGER},
#{receiveUserName,jdbcType=VARCHAR}, #{receiveRealName,jdbcType=VARCHAR}, #{readed,jdbcType=BIT},
#{createTime,jdbcType=TIMESTAMP}, #{readTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.MessageUser" useGeneratedKeys="true" keyProperty="id">
insert into t_message_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="messageId != null">
message_id,
</if>
<if test="receiveUserId != null">
receive_user_id,
</if>
<if test="receiveUserName != null">
receive_user_name,
</if>
<if test="receiveRealName != null">
receive_real_name,
</if>
<if test="readed != null">
readed,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="readTime != null">
read_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="messageId != null">
#{messageId,jdbcType=INTEGER},
</if>
<if test="receiveUserId != null">
#{receiveUserId,jdbcType=INTEGER},
</if>
<if test="receiveUserName != null">
#{receiveUserName,jdbcType=VARCHAR},
</if>
<if test="receiveRealName != null">
#{receiveRealName,jdbcType=VARCHAR},
</if>
<if test="readed != null">
#{readed,jdbcType=BIT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="readTime != null">
#{readTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.MessageUser" >
update t_message_user
<set>
<if test="messageId != null">
message_id = #{messageId,jdbcType=INTEGER},
</if>
<if test="receiveUserId != null">
receive_user_id = #{receiveUserId,jdbcType=INTEGER},
</if>
<if test="receiveUserName != null">
receive_user_name = #{receiveUserName,jdbcType=VARCHAR},
</if>
<if test="receiveRealName != null">
receive_real_name = #{receiveRealName,jdbcType=VARCHAR},
</if>
<if test="readed != null">
readed = #{readed,jdbcType=BIT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="readTime != null">
read_time = #{readTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.MessageUser">
update t_message_user
set message_id = #{messageId,jdbcType=INTEGER},
receive_user_id = #{receiveUserId,jdbcType=INTEGER},
receive_user_name = #{receiveUserName,jdbcType=VARCHAR},
receive_real_name = #{receiveRealName,jdbcType=VARCHAR},
readed = #{readed,jdbcType=BIT},
create_time = #{createTime,jdbcType=TIMESTAMP},
read_time = #{readTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByMessageIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_message_user
where message_id in
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<insert id="inserts" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
insert into t_message_user (message_id, receive_user_id,
receive_user_name, receive_real_name, readed,
create_time)
values
<foreach collection="list" item="item" index="index"
separator=",">
(#{item.messageId,jdbcType=INTEGER}, #{item.receiveUserId,jdbcType=INTEGER},
#{item.receiveUserName,jdbcType=VARCHAR}, #{item.receiveRealName,jdbcType=VARCHAR}, #{item.readed,jdbcType=BIT},
#{item.createTime,jdbcType=TIMESTAMP})
</foreach>
</insert>
<select id="studentPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.student.user.MessageRequestVM">
select
<include refid="Base_Column_List" />
from t_message_user
where receive_user_id = #{receiveUserId}
</select>
<select id="unReadCount" resultType="java.lang.Integer" parameterType="java.lang.Integer">
select count(*)
from t_message_user
where readed='f' and receive_user_id = #{userId}
</select>
</mapper>

View File

@@ -0,0 +1,228 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.QuestionMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.Question">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="question_type" jdbcType="INTEGER" property="questionType" />
<result column="subject_id" jdbcType="INTEGER" property="subjectId" />
<result column="score" jdbcType="INTEGER" property="score" />
<result column="grade_level" jdbcType="INTEGER" property="gradeLevel" />
<result column="difficult" jdbcType="INTEGER" property="difficult" />
<result column="correct" jdbcType="VARCHAR" property="correct" />
<result column="info_text_content_id" jdbcType="INTEGER" property="infoTextContentId" />
<result column="create_user" jdbcType="INTEGER" property="createUser" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="deleted" jdbcType="BIT" property="deleted" />
</resultMap>
<sql id="Base_Column_List">
id, question_type, subject_id, score, grade_level, difficult, correct, info_text_content_id,
create_user, status, create_time, deleted
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_question
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_question
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.Question" useGeneratedKeys="true" keyProperty="id">
insert into t_question (id, question_type, subject_id,
score, grade_level, difficult,
correct, info_text_content_id, create_user,
status, create_time, deleted
)
values (#{id,jdbcType=INTEGER}, #{questionType,jdbcType=INTEGER}, #{subjectId,jdbcType=INTEGER},
#{score,jdbcType=INTEGER}, #{gradeLevel,jdbcType=INTEGER}, #{difficult,jdbcType=INTEGER},
#{correct,jdbcType=VARCHAR}, #{infoTextContentId,jdbcType=INTEGER}, #{createUser,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}
)
</insert>
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.Question" useGeneratedKeys="true" keyProperty="id">
insert into t_question
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="questionType != null">
question_type,
</if>
<if test="subjectId != null">
subject_id,
</if>
<if test="score != null">
score,
</if>
<if test="gradeLevel != null">
grade_level,
</if>
<if test="difficult != null">
difficult,
</if>
<if test="correct != null">
correct,
</if>
<if test="infoTextContentId != null">
info_text_content_id,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="status != null">
status,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="deleted != null">
deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="questionType != null">
#{questionType,jdbcType=INTEGER},
</if>
<if test="subjectId != null">
#{subjectId,jdbcType=INTEGER},
</if>
<if test="score != null">
#{score,jdbcType=INTEGER},
</if>
<if test="gradeLevel != null">
#{gradeLevel,jdbcType=INTEGER},
</if>
<if test="difficult != null">
#{difficult,jdbcType=INTEGER},
</if>
<if test="correct != null">
#{correct,jdbcType=VARCHAR},
</if>
<if test="infoTextContentId != null">
#{infoTextContentId,jdbcType=INTEGER},
</if>
<if test="createUser != null">
#{createUser,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.Question">
update t_question
<set>
<if test="questionType != null">
question_type = #{questionType,jdbcType=INTEGER},
</if>
<if test="subjectId != null">
subject_id = #{subjectId,jdbcType=INTEGER},
</if>
<if test="score != null">
score = #{score,jdbcType=INTEGER},
</if>
<if test="gradeLevel != null">
grade_level = #{gradeLevel,jdbcType=INTEGER},
</if>
<if test="difficult != null">
difficult = #{difficult,jdbcType=INTEGER},
</if>
<if test="correct != null">
correct = #{correct,jdbcType=VARCHAR},
</if>
<if test="infoTextContentId != null">
info_text_content_id = #{infoTextContentId,jdbcType=INTEGER},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.Question">
update t_question
set question_type = #{questionType,jdbcType=INTEGER},
subject_id = #{subjectId,jdbcType=INTEGER},
score = #{score,jdbcType=INTEGER},
grade_level = #{gradeLevel,jdbcType=INTEGER},
difficult = #{difficult,jdbcType=INTEGER},
correct = #{correct,jdbcType=VARCHAR},
info_text_content_id = #{infoTextContentId,jdbcType=INTEGER},
create_user = #{createUser,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=BIT}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.question.QuestionPageRequestVM">
SELECT
<include refid="Base_Column_List"/>
FROM t_question
<where>
and deleted=0
<if test="id != null ">
and id= #{id}
</if>
<if test="level != null ">
and grade_level= #{level}
</if>
<if test="subjectId != null ">
and subject_id= #{subjectId}
</if>
<if test="questionType != null ">
and question_type= #{questionType}
</if>
</where>
</select>
<select id="selectByIds" resultMap="BaseResultMap" >
SELECT
<include refid="Base_Column_List"/>
FROM t_question where id in
<foreach item="id" collection="ids" open="(" separator=","
close=")">
#{id}
</foreach>
</select>
<select id="selectAllCount" resultType="java.lang.Integer">
SELECT count(*) from t_question where deleted=0
</select>
<select id="selectCountByDate" resultType="com.mindskip.xzs.domain.other.KeyValue">
SELECT create_time as name,COUNT(create_time) as value from
(
SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_question
WHERE deleted=0 and create_time between #{startTime} and #{endTime}
) a
GROUP BY create_time
</select>
</mapper>

View File

@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.SubjectMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.Subject">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="level" jdbcType="INTEGER" property="level" />
<result column="level_name" jdbcType="VARCHAR" property="levelName" />
<result column="item_order" jdbcType="INTEGER" property="itemOrder" />
<result column="deleted" jdbcType="BIT" property="deleted" />
</resultMap>
<sql id="Base_Column_List">
id, name, level, level_name, item_order, deleted
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_subject
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_subject
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.Subject" useGeneratedKeys="true" keyProperty="id">
insert into t_subject (id, name, level,
level_name, item_order, deleted
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER},
#{levelName,jdbcType=VARCHAR}, #{itemOrder,jdbcType=INTEGER}, #{deleted,jdbcType=BIT}
)
</insert>
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.Subject" useGeneratedKeys="true" keyProperty="id">
insert into t_subject
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="level != null">
level,
</if>
<if test="levelName != null">
level_name,
</if>
<if test="itemOrder != null">
item_order,
</if>
<if test="deleted != null">
deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="level != null">
#{level,jdbcType=INTEGER},
</if>
<if test="levelName != null">
#{levelName,jdbcType=VARCHAR},
</if>
<if test="itemOrder != null">
#{itemOrder,jdbcType=INTEGER},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.Subject">
update t_subject
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="level != null">
level = #{level,jdbcType=INTEGER},
</if>
<if test="levelName != null">
level_name = #{levelName,jdbcType=VARCHAR},
</if>
<if test="itemOrder != null">
item_order = #{itemOrder,jdbcType=INTEGER},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.Subject">
update t_subject
set name = #{name,jdbcType=VARCHAR},
level = #{level,jdbcType=INTEGER},
level_name = #{levelName,jdbcType=VARCHAR},
item_order = #{itemOrder,jdbcType=INTEGER},
deleted = #{deleted,jdbcType=BIT}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getSubjectByLevel" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_subject where level= #{level}
order by item_order
</select>
<select id="allSubject" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_subject
</select>
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.education.SubjectPageRequestVM">
SELECT
<include refid="Base_Column_List"/>
FROM t_subject
<where>
and deleted=0
<if test="id != null ">
and id= #{id}
</if>
<if test="level != null ">
and level= #{level}
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.TaskExamCustomerAnswerMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.TaskExamCustomerAnswer">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="task_exam_id" jdbcType="INTEGER" property="taskExamId" />
<result column="create_user" jdbcType="INTEGER" property="createUser" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="text_content_id" jdbcType="INTEGER" property="textContentId" />
</resultMap>
<sql id="Base_Column_List">
id, task_exam_id, create_user, create_time, text_content_id
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_task_exam_customer_answer
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_task_exam_customer_answer
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.TaskExamCustomerAnswer" useGeneratedKeys="true" keyProperty="id">
insert into t_task_exam_customer_answer (id, task_exam_id, create_user,
create_time, text_content_id)
values (#{id,jdbcType=INTEGER}, #{taskExamId,jdbcType=INTEGER}, #{createUser,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{textContentId,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.TaskExamCustomerAnswer" useGeneratedKeys="true" keyProperty="id">
insert into t_task_exam_customer_answer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="taskExamId != null">
task_exam_id,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="textContentId != null">
text_content_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="taskExamId != null">
#{taskExamId,jdbcType=INTEGER},
</if>
<if test="createUser != null">
#{createUser,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="textContentId != null">
#{textContentId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.TaskExamCustomerAnswer">
update t_task_exam_customer_answer
<set>
<if test="taskExamId != null">
task_exam_id = #{taskExamId,jdbcType=INTEGER},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="textContentId != null">
text_content_id = #{textContentId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.TaskExamCustomerAnswer">
update t_task_exam_customer_answer
set task_exam_id = #{taskExamId,jdbcType=INTEGER},
create_user = #{createUser,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
text_content_id = #{textContentId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getByTUid" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_task_exam_customer_answer
where task_exam_id = #{tid} and create_user=#{uid}
limit 1
</select>
<select id="selectByTUid" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_task_exam_customer_answer
where create_user=#{uid} and
task_exam_id in
<foreach collection="taskIds" open="(" close=")" separator="," item="id">
#{id}
</foreach>
</select>
</mapper>

View File

@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.TaskExamMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.TaskExam">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="grade_level" jdbcType="INTEGER" property="gradeLevel" />
<result column="frame_text_content_id" jdbcType="INTEGER" property="frameTextContentId" />
<result column="create_user" jdbcType="INTEGER" property="createUser" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="create_user_name" jdbcType="VARCHAR" property="createUserName" />
</resultMap>
<sql id="Base_Column_List">
id, title, grade_level, frame_text_content_id, create_user, create_time, deleted,
create_user_name
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_task_exam
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_task_exam
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.TaskExam" useGeneratedKeys="true" keyProperty="id">
insert into t_task_exam (id, title, grade_level,
frame_text_content_id, create_user, create_time,
deleted, create_user_name)
values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{gradeLevel,jdbcType=INTEGER},
#{frameTextContentId,jdbcType=INTEGER}, #{createUser,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{deleted,jdbcType=BIT}, #{createUserName,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.TaskExam" useGeneratedKeys="true" keyProperty="id">
insert into t_task_exam
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="title != null">
title,
</if>
<if test="gradeLevel != null">
grade_level,
</if>
<if test="frameTextContentId != null">
frame_text_content_id,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="createUserName != null">
create_user_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="gradeLevel != null">
#{gradeLevel,jdbcType=INTEGER},
</if>
<if test="frameTextContentId != null">
#{frameTextContentId,jdbcType=INTEGER},
</if>
<if test="createUser != null">
#{createUser,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
<if test="createUserName != null">
#{createUserName,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.TaskExam">
update t_task_exam
<set>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="gradeLevel != null">
grade_level = #{gradeLevel,jdbcType=INTEGER},
</if>
<if test="frameTextContentId != null">
frame_text_content_id = #{frameTextContentId,jdbcType=INTEGER},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
<if test="createUserName != null">
create_user_name = #{createUserName,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.TaskExam">
update t_task_exam
set title = #{title,jdbcType=VARCHAR},
grade_level = #{gradeLevel,jdbcType=INTEGER},
frame_text_content_id = #{frameTextContentId,jdbcType=INTEGER},
create_user = #{createUser,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=BIT},
create_user_name = #{createUserName,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.task.TaskPageRequestVM">
select
<include refid="Base_Column_List" />
from t_task_exam
<where>
and deleted=0
<if test="gradeLevel != null">
and grade_level = #{gradeLevel}
</if>
</where>
</select>
<select id="getByGradeLevel" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List" />
from t_task_exam
where deleted=0
and grade_level = #{gradeLevel,jdbcType=INTEGER}
</select>
</mapper>

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.TextContentMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.TextContent">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
id, content, create_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_text_content
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_text_content
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.TextContent" useGeneratedKeys="true" keyProperty="id">
insert into t_text_content (id, content, create_time
)
values (#{id,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.TextContent" useGeneratedKeys="true" keyProperty="id">
insert into t_text_content
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="content != null">
content,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.TextContent">
update t_text_content
<set>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.TextContent">
update t_text_content
set content = #{content,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.UserEventLogMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.UserEventLog">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="user_name" jdbcType="VARCHAR" property="userName" />
<result column="real_name" jdbcType="VARCHAR" property="realName" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
id, user_id, user_name, real_name, content, create_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_user_event_log
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_user_event_log
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.UserEventLog" useGeneratedKeys="true" keyProperty="id">
insert into t_user_event_log (id, user_id, user_name,
real_name, content, create_time
)
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR},
#{realName,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.UserEventLog" useGeneratedKeys="true" keyProperty="id">
insert into t_user_event_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="userName != null">
user_name,
</if>
<if test="realName != null">
real_name,
</if>
<if test="content != null">
content,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="userName != null">
#{userName,jdbcType=VARCHAR},
</if>
<if test="realName != null">
#{realName,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.UserEventLog">
update t_user_event_log
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
</if>
<if test="realName != null">
real_name = #{realName,jdbcType=VARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.UserEventLog">
update t_user_event_log
set user_id = #{userId,jdbcType=INTEGER},
user_name = #{userName,jdbcType=VARCHAR},
real_name = #{realName,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getUserEventLogByUserId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_user_event_log
where user_id=#{value}
order by id desc
limit 10
</select>
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.user.UserEventPageRequestVM">
select
<include refid="Base_Column_List"/>
from t_user_event_log
<where>
<if test="userId != null">
and user_id= #{userId}
</if>
<if test="userName != null">
and user_name= #{userName}
</if>
</where>
</select>
<select id="selectCountByDate" resultType="com.mindskip.xzs.domain.other.KeyValue">
SELECT create_time as name,COUNT(create_time) as value from
(
SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_user_event_log
WHERE create_time between #{startTime} and #{endTime}
) a
GROUP BY create_time
</select>
</mapper>

View File

@@ -0,0 +1,414 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.UserMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.User">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="user_uuid" jdbcType="VARCHAR" property="userUuid" />
<result column="user_name" jdbcType="VARCHAR" property="userName" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="real_name" jdbcType="VARCHAR" property="realName" />
<result column="age" jdbcType="INTEGER" property="age" />
<result column="sex" jdbcType="INTEGER" property="sex" />
<result column="birth_day" jdbcType="TIMESTAMP" property="birthDay" />
<result column="user_level" jdbcType="INTEGER" property="userLevel" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="role" jdbcType="INTEGER" property="role" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="image_path" jdbcType="VARCHAR" property="imagePath" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
<result column="last_active_time" jdbcType="TIMESTAMP" property="lastActiveTime" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="wx_open_id" jdbcType="VARCHAR" property="wxOpenId" />
</resultMap>
<sql id="Base_Column_List">
id, user_uuid, user_name, password, real_name, age, sex, birth_day, user_level, phone,
role, status, image_path, create_time, modify_time, last_active_time, deleted, wx_open_id
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_user
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_user
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.User" useGeneratedKeys="true" keyProperty="id">
insert into t_user (id, user_uuid, user_name,
password, real_name, age,
sex, birth_day, user_level,
phone, role, status,
image_path, create_time, modify_time,
last_active_time, deleted, wx_open_id
)
values (#{id,jdbcType=INTEGER}, #{userUuid,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR},
#{password,jdbcType=VARCHAR}, #{realName,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER},
#{sex,jdbcType=INTEGER}, #{birthDay,jdbcType=TIMESTAMP}, #{userLevel,jdbcType=INTEGER},
#{phone,jdbcType=VARCHAR}, #{role,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{imagePath,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{modifyTime,jdbcType=TIMESTAMP},
#{lastActiveTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}, #{wxOpenId,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.User" useGeneratedKeys="true" keyProperty="id">
insert into t_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userUuid != null">
user_uuid,
</if>
<if test="userName != null">
user_name,
</if>
<if test="password != null">
password,
</if>
<if test="realName != null">
real_name,
</if>
<if test="age != null">
age,
</if>
<if test="sex != null">
sex,
</if>
<if test="birthDay != null">
birth_day,
</if>
<if test="userLevel != null">
user_level,
</if>
<if test="phone != null">
phone,
</if>
<if test="role != null">
role,
</if>
<if test="status != null">
status,
</if>
<if test="imagePath != null">
image_path,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="modifyTime != null">
modify_time,
</if>
<if test="lastActiveTime != null">
last_active_time,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="wxOpenId != null">
wx_open_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="userUuid != null">
#{userUuid,jdbcType=VARCHAR},
</if>
<if test="userName != null">
#{userName,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="realName != null">
#{realName,jdbcType=VARCHAR},
</if>
<if test="age != null">
#{age,jdbcType=INTEGER},
</if>
<if test="sex != null">
#{sex,jdbcType=INTEGER},
</if>
<if test="birthDay != null">
#{birthDay,jdbcType=TIMESTAMP},
</if>
<if test="userLevel != null">
#{userLevel,jdbcType=INTEGER},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="role != null">
#{role,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="imagePath != null">
#{imagePath,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="modifyTime != null">
#{modifyTime,jdbcType=TIMESTAMP},
</if>
<if test="lastActiveTime != null">
#{lastActiveTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
<if test="wxOpenId != null">
#{wxOpenId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.User">
update t_user
<set>
<if test="userUuid != null">
user_uuid = #{userUuid,jdbcType=VARCHAR},
</if>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="realName != null">
real_name = #{realName,jdbcType=VARCHAR},
</if>
<if test="age != null">
age = #{age,jdbcType=INTEGER},
</if>
<if test="sex != null">
sex = #{sex,jdbcType=INTEGER},
</if>
<if test="birthDay != null">
birth_day = #{birthDay,jdbcType=TIMESTAMP},
</if>
<if test="userLevel != null">
user_level = #{userLevel,jdbcType=INTEGER},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="role != null">
role = #{role,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="imagePath != null">
image_path = #{imagePath,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="modifyTime != null">
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
</if>
<if test="lastActiveTime != null">
last_active_time = #{lastActiveTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
<if test="wxOpenId != null">
wx_open_id = #{wxOpenId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.User">
update t_user
set user_uuid = #{userUuid,jdbcType=VARCHAR},
user_name = #{userName,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
real_name = #{realName,jdbcType=VARCHAR},
age = #{age,jdbcType=INTEGER},
sex = #{sex,jdbcType=INTEGER},
birth_day = #{birthDay,jdbcType=TIMESTAMP},
user_level = #{userLevel,jdbcType=INTEGER},
phone = #{phone,jdbcType=VARCHAR},
role = #{role,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
image_path = #{imagePath,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
last_active_time = #{lastActiveTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=BIT},
wx_open_id = #{wxOpenId,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getAllUser" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_user where deleted=0
</select>
<select id="getUserById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_user
where id=#{value}
</select>
<select id="getUserByUserName" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_user
where deleted=0 and user_name=#{value} limit 1
</select>
<select id="getUserByUserNamePwd" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_user
where deleted=0 and user_name=#{username} and password=#{pwd} limit 1
</select>
<select id="getUserByUuid" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_user
where deleted=0 and user_uuid=#{value,jdbcType=VARCHAR}
</select>
<select id="userPageList" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_user
<where>
and deleted=0
<if test="name != null and name != ''">
and real_name like concat('%',#{name},'%')
</if>
</where>
ORDER BY id
<if test="offset != null and limit != null ">
<bind name="patternAdd" value="limit*offset"/>
limit #{limit} OFFSET #{offset}
</if>
</select>
<select id="userPageCount" resultType="java.lang.Integer">
select count(*) from t_user
<where>
and deleted=0
<if test="name != null and name != ''">
and real_name like concat('%', #{name}, '%')
</if>
</where>
</select>
<select id="userPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.user.UserPageRequestVM">
SELECT
<include refid="Base_Column_List"/>
FROM t_user
<where>
and deleted=0
<if test="userName != null and userName != ''">
and user_name like concat('%',#{userName},'%')
</if>
<if test="role != null ">
and role= #{role}
</if>
</where>
</select>
<insert id="insertUser" parameterType="com.mindskip.xzs.domain.User"
useGeneratedKeys="true" keyProperty="id">
insert into t_user
(user_uuid,user_name,password,real_name,age, last_active_time)
values
(#{userUuid,jdbcType=VARCHAR},#{userName},#{password},#{realName},#{age},#{lastActiveTime})
</insert>
<insert id="insertUsers" parameterType="java.util.List"
useGeneratedKeys="true" keyProperty="id">
insert into t_user
(user_uuid,user_name,password,real_name,age,last_active_time)
values
<foreach collection="list" item="item" index="index"
separator=",">
(#{item.userUuid},#{item.userName},#{item.password},#{item.realName},#{item.age},
#{item.lastActiveTime})
</foreach>
</insert>
<update id="updateUser" parameterType="com.mindskip.xzs.domain.User">
update t_user
<set>
<if test="realName != null">real_name = #{realName},</if>
<if test="age != null">age = #{age},</if>
<if test="lastActiveTime != null">last_active_time = #{lastActiveTime},</if>
</set>
where id = #{id}
</update>
<update id="updateUsersAge">
update t_user set age = #{age} where id in
<foreach item="id" collection="idslist" open="(" separator=","
close=")">
#{id}
</foreach>
</update>
<delete id="deleteUsersByIds">
delete from t_user where id in
<foreach item="id" collection="list" open="(" separator=","
close=")">
#{id}
</foreach>
</delete>
<select id="selectAllCount" resultType="java.lang.Integer">
SELECT count(*) from t_user where deleted=0
</select>
<select id="selectByUserName" resultType="com.mindskip.xzs.domain.other.KeyValue">
SELECT id as value,user_name as name
from t_user
where deleted=0 and user_name like concat('%',#{value},'%')
limit 5
</select>
<select id="selectByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_user
where id in
<foreach item="id" collection="list" open="(" separator=","
close=")">
#{id}
</foreach>
</select>
<select id="selectByWxOpenId" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_user
where deleted=0 and wx_open_id = #{wxOpenId}
limit 1
</select>
</mapper>

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.UserTokenMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.UserToken">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="token" jdbcType="VARCHAR" property="token" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="wx_open_id" jdbcType="VARCHAR" property="wxOpenId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="user_name" jdbcType="VARCHAR" property="userName" />
</resultMap>
<sql id="Base_Column_List">
id, token, user_id, wx_open_id, create_time, end_time, user_name
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_user_token
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_user_token
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.UserToken" useGeneratedKeys="true" keyProperty="id">
insert into t_user_token (id, token, user_id,
wx_open_id, create_time, end_time,
user_name)
values (#{id,jdbcType=INTEGER}, #{token,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER},
#{wxOpenId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
#{userName,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.UserToken" useGeneratedKeys="true" keyProperty="id">
insert into t_user_token
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="token != null">
token,
</if>
<if test="userId != null">
user_id,
</if>
<if test="wxOpenId != null">
wx_open_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="userName != null">
user_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="token != null">
#{token,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="wxOpenId != null">
#{wxOpenId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP},
</if>
<if test="userName != null">
#{userName,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.UserToken">
update t_user_token
<set>
<if test="token != null">
token = #{token,jdbcType=VARCHAR},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="wxOpenId != null">
wx_open_id = #{wxOpenId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.UserToken">
update t_user_token
set token = #{token,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=INTEGER},
wx_open_id = #{wxOpenId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
user_name = #{userName,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getToken" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_user_token
where token = #{token,jdbcType=VARCHAR}
order by id desc
limit 1
</select>
</mapper>