b9411514
陈杰
first
|
1
2
3
4
5
6
7
8
|
<?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.sincere.student.mapper.MajorMapper">
<resultMap id="MajorMap" type="com.sincere.student.model.Major">
<id column="id" property="id"/>
<result column="major" property="major"/>
<result column="major_code" property="majorCode"/>
|
4dbd6f38
陈杰
bug 修复
|
9
|
<result column="p_id" property="pId"/>
|
05508d96
陈杰
bug 修复
|
10
|
</resultMap>
|
b9411514
陈杰
first
|
11
12
|
<select id="getList" parameterType="com.sincere.student.model.Major" resultMap="MajorMap">
|
473605c5
陈杰
bug 修复
|
13
14
15
16
17
|
select * from university_major
<where>
<if test="pId != 0">
and p_id = #{pId}
</if>
|
b9411514
陈杰
first
|
18
19
|
<if test="major != null">
and major like #{major}
|
123dbb81
徐泉
研学代码提交
|
20
21
|
</if>
</where>
|
4dbd6f38
陈杰
bug 修复
|
22
|
</select>
|
123dbb81
徐泉
研学代码提交
|
23
24
|
<select id="getListCount" parameterType="com.sincere.student.model.Major" resultType="java.lang.Integer">
|
b9411514
陈杰
first
|
25
|
select count(0) from university_major
|
123dbb81
徐泉
研学代码提交
|
26
27
|
<where>
<if test="pId >= 0">
|
b9411514
陈杰
first
|
28
29
30
31
32
|
and p_id = #{pId}
</if>
<if test="major != null">
and major like #{major}
</if>
|
4dbd6f38
陈杰
bug 修复
|
33
34
|
<if test="majorCode != null">
and major_code like #{majorCode}
|
b9411514
陈杰
first
|
35
|
</if>
|
3c7f8a2c
陈杰
bug 修复
|
36
|
</where>
|
b9411514
陈杰
first
|
37
38
|
</select>
|
b9411514
陈杰
first
|
39
40
41
|
<insert id="create" parameterType="com.sincere.student.model.Major" >
insert into university_major (major,major_code,p_id)
values (#{major},#{majorCode},#{pId})
|
123dbb81
徐泉
研学代码提交
|
42
|
</insert>
|
05508d96
陈杰
bug 修复
|
43
|
|
4dbd6f38
陈杰
bug 修复
|
44
|
<delete id="delete" parameterType="java.lang.Integer">
|
b9411514
陈杰
first
|
45
46
47
48
49
50
|
delete university_major where id = #{id}
</delete>
<update id="update" parameterType="com.sincere.student.model.Major">
update university_major
<trim prefix="set" suffixOverrides=",">
|
d10218de
陈杰
bug 修复
|
51
52
53
54
|
<if test="major!=null">
major=#{major},
</if>
<if test="majorCode!=null">
|
b9411514
陈杰
first
|
55
56
57
58
59
60
|
major_code=#{majorCode},
</if>
</trim>
where id = #{id}
</update>
</mapper>
|
4a51395c
陈杰
bug 修复
|
|
|
b9411514
陈杰
first
|
|
|
2f3069be
陈杰
bug 修复
|
|
|
123dbb81
徐泉
研学代码提交
|
|
|
2f3069be
陈杰
bug 修复
|
|
|
b9411514
陈杰
first
|
|
|