Blame view

resources/mybatis1/sunvote/CourseManagementMapper.xml 4.9 KB
57330ff4   孙向锦   添加一些模块信息
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  <?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="CourseManagementMapper">
  	
  	<!--表名 -->
  	<sql id="tableName">
  		SV_COURSEMANAGEMENT
  	</sql>
  	
  	<!-- 字段 -->
  	<sql id="Field">
  		TEACHER_ID,	
  		CLASS_ID,	
  		SUBJECT_ID,	
  		START_DATE,	
  		END_DATE,	
  		REMARK,	
cea072ff   孙向锦   更新到服务器
18
19
  		GRADE_ID,
  		TERM_ID,
8246d00c   孙向锦   修复bug
20
  		SCHOOL_ID,
57330ff4   孙向锦   添加一些模块信息
21
22
23
24
25
26
27
28
29
30
31
  		ID
  	</sql>
  	
  	<!-- 字段值 -->
  	<sql id="FieldValue">
  		#{TEACHER_ID},	
  		#{CLASS_ID},	
  		#{SUBJECT_ID},	
  		#{START_DATE},	
  		#{END_DATE},	
  		#{REMARK},	
cea072ff   孙向锦   更新到服务器
32
33
  		#{GRADE_ID},	
  		#{TERM_ID},	
8246d00c   孙向锦   修复bug
34
  		#{SCHOOL_ID},	
57330ff4   孙向锦   添加一些模块信息
35
36
37
38
39
40
41
42
  		#{ID}
  	</sql>
  	
  	<!-- 新增-->
  	<insert id="save" parameterType="pd">
  		insert into 
  	<include refid="tableName"></include>
  		(
fe1b8420   孙向锦   任课管理添加
43
  			ID,
57330ff4   孙向锦   添加一些模块信息
44
45
46
47
48
  			TEACHER_ID,	
  			CLASS_ID,	
  			SUBJECT_ID,	
  			START_DATE,	
  			END_DATE,	
cea072ff   孙向锦   更新到服务器
49
50
  			GRADE_ID,
  			TERM_ID,
8246d00c   孙向锦   修复bug
51
  			SCHOOL_ID,
57330ff4   孙向锦   添加一些模块信息
52
53
  			REMARK
  		) values (
fe1b8420   孙向锦   任课管理添加
54
  		#{ID},	
57330ff4   孙向锦   添加一些模块信息
55
56
57
58
59
  		#{TEACHER_ID},	
  		#{CLASS_ID},	
  		#{SUBJECT_ID},	
  		#{START_DATE},	
  		#{END_DATE},	
cea072ff   孙向锦   更新到服务器
60
61
  		#{GRADE_ID},	
  		#{TERM_ID},	
8246d00c   孙向锦   修复bug
62
  		#{SCHOOL_ID},	
57330ff4   孙向锦   添加一些模块信息
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
  		#{REMARK}
  		)
  	</insert>
  	
  	<!-- 删除-->
  	<delete id="delete" parameterType="pd">
  		delete from
  		<include refid="tableName"></include>
  		where 
  			ID = #{ID}
  	</delete>
  	
  	<!-- 修改 -->
  	<update id="edit" parameterType="pd">
  		update
  		<include refid="tableName"></include>
  		set 
  			TEACHER_ID = #{TEACHER_ID},
  			CLASS_ID = #{CLASS_ID},
  			SUBJECT_ID = #{SUBJECT_ID},
  			START_DATE = #{START_DATE},
  			END_DATE = #{END_DATE},
  			REMARK = #{REMARK},
cea072ff   孙向锦   更新到服务器
86
87
  			GRADE_ID = #{GRADE_ID},	
  			TERM_ID = #{TERM_ID},	
8246d00c   孙向锦   修复bug
88
  			SCHOOL_ID = #{SCHOOL_ID},	
fe1b8420   孙向锦   任课管理添加
89
  		ID = ID
57330ff4   孙向锦   添加一些模块信息
90
91
92
93
94
95
96
97
98
99
100
101
102
103
  		where 
  		ID = #{ID}
  	</update>
  	
  	<!-- 通过ID获取数据 -->
  	<select id="findById" parameterType="pd" resultType="pd">
  		select 
  		<include refid="Field"></include>
  		from 
  		<include refid="tableName"></include>
  		where 
  			ID = #{ID}
  	</select>
  	
b3c44d84   孙向锦   课后练bug修复
104
105
106
107
108
109
110
111
112
113
114
115
116
117
  	<select id="findByCourse" parameterType="pd" resultType="pd">
  		select 
  		<include refid="Field"></include>
  		from 
  		<include refid="tableName"></include>
  		where 
  			1 =1 
  			and TEACHER_ID  = #{TEACHER_ID} 
  			and CLASS_ID= #{TEACHER_ID} 	
  			and SUBJECT_ID= #{TEACHER_ID} 	
  			
  			limit 0,1
  	</select>
  	
57330ff4   孙向锦   添加一些模块信息
118
119
120
121
122
123
124
125
126
127
  	<!-- 列表 -->
  	<select id="datalistPage" parameterType="page" resultType="pd">
  		select
  		<include refid="Field"></include>
  		from 
  		<include refid="tableName"></include>
  		where 1=1
  		<if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
  			and
  				(
9f161055   孙向锦   修改高斯客户反馈
128
129
130
131
132
133
134
135
  				
  				)
  		</if>
  		
  		<if test="pd.TERM_ID!= null and pd.TERM_ID != ''"><!-- 关键词检索 -->
  			and
  				(
  				TERM_ID = #{pd.TERM_ID}
57330ff4   孙向锦   添加一些模块信息
136
137
138
139
140
141
142
143
144
145
  				)
  		</if>
  	</select>
  	
  	<!-- 列表(全部) -->
  	<select id="listAll" parameterType="pd" resultType="pd">
  		select
  		<include refid="Field"></include>
  		from 
  		<include refid="tableName"></include>
6b3a5ad0   孙向锦   添加管理员界面
146
147
  		where 1 =1 
  		
57330ff4   孙向锦   添加一些模块信息
148
149
  	</select>
  	
6b3a5ad0   孙向锦   添加管理员界面
150
151
152
153
  	<!-- 列表(全部) -->
  	<select id="listCourse" parameterType="pd" resultType="pd">
  		SELECT
  			sv_teacher.`NAME`,
6b3a5ad0   孙向锦   添加管理员界面
154
  			sv_sclass.CLASS_NAME,
6b3a5ad0   孙向锦   添加管理员界面
155
  			sv_subject.CNAME,
b638e17a   jack   1.英文翻译(三)
156
  			sv_subject.ENAME,
837ae11d   孙向锦   添加班長管理
157
158
159
160
  			SV_COURSEMANAGEMENT.SUBJECT_ID,
  			SV_COURSEMANAGEMENT.TEACHER_ID,
  			SV_COURSEMANAGEMENT.CLASS_ID,
  			SV_COURSEMANAGEMENT.ID,
6b3a5ad0   孙向锦   添加管理员界面
161
162
163
164
  		SV_COURSEMANAGEMENT.HEAD_MASTER
  		FROM
  			SV_COURSEMANAGEMENT
  		LEFT JOIN sv_sclass ON SV_COURSEMANAGEMENT.CLASS_ID = sv_sclass.ID
6b3a5ad0   孙向锦   添加管理员界面
165
166
167
  		LEFT JOIN sv_teacher ON sv_coursemanagement.TEACHER_ID = sv_teacher.ID
  		LEFT JOIN sv_subject on sv_coursemanagement.SUBJECT_ID = sv_subject.ID
  		WHERE
837ae11d   孙向锦   添加班長管理
168
  			SV_COURSEMANAGEMENT.SCHOOL_ID = #{SCHOOL_ID}
6b3a5ad0   孙向锦   添加管理员界面
169
170
171
  		
  	</select>
  	
a479f295   孙向锦   添加了报表逻辑
172
173
174
175
176
177
178
  	<select id="listTeacherClass" parameterType="pd" resultType="pd">
  		SELECT
  			sv_sclass.*
  		FROM
  			sv_coursemanagement
  		LEFT JOIN sv_sclass ON sv_coursemanagement.CLASS_ID = sv_sclass.ID
  		WHERE
b3c44d84   孙向锦   课后练bug修复
179
180
181
182
183
184
185
186
  		    1 = 1 
  		    <if test="TEACHER_ID != null and TEACHER_ID != ''">
  				and sv_coursemanagement.TEACHER_ID =  #{TEACHER_ID}
  			</if>
  		    <if test="SCHOOL_ID != null and SCHOOL_ID != ''">
  				and sv_coursemanagement.SCHOOL_ID =  #{SCHOOL_ID}
  			</if>
  		group by sv_sclass.CLASS_CODE
015d5970   孙向锦   更新删除接口
187
  		order by sv_sclass.CLASS_CODE
a479f295   孙向锦   添加了报表逻辑
188
189
190
  		
  	</select>
  	
cba5931f   孙向锦   添加翻页
191
192
193
194
  	<!-- 列表(全部) -->
  	<select id="listCourselistPage" parameterType="page" resultType="pd">
  		SELECT
  			sv_teacher.`NAME`,
cba5931f   孙向锦   添加翻页
195
  			sv_sclass.CLASS_NAME,
cba5931f   孙向锦   添加翻页
196
  			sv_subject.CNAME,
b638e17a   jack   1.英文翻译(三)
197
  			sv_subject.ENAME,
837ae11d   孙向锦   添加班長管理
198
199
200
201
  			SV_COURSEMANAGEMENT.SUBJECT_ID,
  			SV_COURSEMANAGEMENT.TEACHER_ID,
  			SV_COURSEMANAGEMENT.CLASS_ID,
  			SV_COURSEMANAGEMENT.ID,
cba5931f   孙向锦   添加翻页
202
203
204
205
  		SV_COURSEMANAGEMENT.HEAD_MASTER
  		FROM
  			SV_COURSEMANAGEMENT
  		LEFT JOIN sv_sclass ON SV_COURSEMANAGEMENT.CLASS_ID = sv_sclass.ID
cba5931f   孙向锦   添加翻页
206
207
208
  		LEFT JOIN sv_teacher ON sv_coursemanagement.TEACHER_ID = sv_teacher.ID
  		LEFT JOIN sv_subject on sv_coursemanagement.SUBJECT_ID = sv_subject.ID
  		WHERE
837ae11d   孙向锦   添加班長管理
209
  			SV_COURSEMANAGEMENT.SCHOOL_ID = #{pd.SCHOOL_ID}
cba5931f   孙向锦   添加翻页
210
211
212
  		
  	</select>
  	
6b3a5ad0   孙向锦   添加管理员界面
213
214
  	
  	
57330ff4   孙向锦   添加一些模块信息
215
216
217
218
219
220
221
222
223
224
225
226
227
  	<!-- 批量删除 -->
  	<delete id="deleteAll" parameterType="String">
  		delete from
  		<include refid="tableName"></include>
  		where 
  			ID in
  		<foreach item="item" index="index" collection="array" open="(" separator="," close=")">
                   #{item}
  		</foreach>
  	</delete>
  	
  	<!-- fh313596790qq(青苔) -->
  </mapper>