AnalyseMapper.xml
2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?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.jevon.mapper.AnalyseMapper" >
<resultMap id="BaseResultMap" type="com.jevon.model.Analyse" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="exam_name" property="examName" jdbcType="VARCHAR" />
<result column="exam_time" property="examTime" jdbcType="VARCHAR" />
<result column="course_name" property="courseName" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="max_score" property="maxScore" jdbcType="FLOAT" />
<result column="grade" property="grade" jdbcType="VARCHAR" />
<result column="exam_scope" property="examScope" jdbcType="VARCHAR" />
</resultMap>
<insert id="insert" parameterType="com.jevon.model.Analyse" useGeneratedKeys="true" keyProperty="id">
insert into sz_learn_analyse (exam_name, exam_time,course_name,create_time,grade)
values (#{examName},#{examTime},#{courseName},#{createTime},#{grade})
</insert>
<update id="update" parameterType="com.jevon.model.Analyse">
update sz_learn_analyse
<set >
<if test="examName != null" >
exam_name = #{examName},
</if>
<if test="examTime != null" >
exam_time = #{examTime},
</if>
<if test="grade != null" >
grade = #{grade},
</if>
<if test="maxScore != 0" >
max_score = #{maxScore},
</if>
</set>
where id = #{id}
</update>
<select id="select" parameterType="com.jevon.model.Analyse" resultMap="BaseResultMap">
select * from sz_learn_analyse
<where>
<if test="courseName != null">
and course_name = #{courseName}
</if>
<if test="examName != null">
and exam_name = #{examName}
</if>
<if test="grade != null">
and grade = #{grade}
</if>
</where>
</select>
<select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select * from sz_learn_analyse where id = #{id}
</select>
<update id="updateChapter" parameterType="com.jevon.model.Analyse" >
update sz_learn_analyse set exam_time = #{examTime} , exam_scope = #{examScope} where id = #{id}
</update>
</mapper>