Commit 64d4f18d authored by bing zhang's avatar bing zhang
Browse files

1

parent 539344b2
<?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>
<?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.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>
<?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.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>
<?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>
<?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.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>
<?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>
<?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.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>
<?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.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>
<?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>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment