|  | @@ -0,0 +1,83 @@
 | 
	
		
			
				|  |  | +<?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.keao.edu.user.dao.ExamSongDao">
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<resultMap type="com.keao.edu.user.entity.ExamSong" id="ExamSong">
 | 
	
		
			
				|  |  | +		<result column="id_" property="id" />
 | 
	
		
			
				|  |  | +		<result column="song_name_" property="songName" />
 | 
	
		
			
				|  |  | +		<result column="song_author_" property="songAuthor" />
 | 
	
		
			
				|  |  | +		<result column="subject_list_" property="subjectList" />
 | 
	
		
			
				|  |  | +		<result column="level_list_" property="levelList" />
 | 
	
		
			
				|  |  | +		<result column="type_" property="type" />
 | 
	
		
			
				|  |  | +		<result column="file_url_list_" property="fileUrlList" />
 | 
	
		
			
				|  |  | +		<result column="create_time_" property="createTime" />
 | 
	
		
			
				|  |  | +		<result column="update_time_" property="updateTime" />
 | 
	
		
			
				|  |  | +	</resultMap>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 根据主键查询一条记录 -->
 | 
	
		
			
				|  |  | +	<select id="get" resultMap="ExamSong" >
 | 
	
		
			
				|  |  | +		SELECT * FROM exam_song WHERE id_ = #{id} 
 | 
	
		
			
				|  |  | +	</select>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 全查询 -->
 | 
	
		
			
				|  |  | +	<select id="findAll" resultMap="ExamSong">
 | 
	
		
			
				|  |  | +		SELECT * FROM exam_song ORDER BY id_
 | 
	
		
			
				|  |  | +	</select>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 向数据库增加一条记录 -->
 | 
	
		
			
				|  |  | +	<insert id="insert" parameterType="com.keao.edu.user.entity.ExamSong" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 | 
	
		
			
				|  |  | +		INSERT INTO exam_song (id_,song_name_,song_author_,subject_list_,level_list_,type_,file_url_list_,create_time_,update_time_)
 | 
	
		
			
				|  |  | +		VALUES(#{id},#{songName},#{songAuthor},#{subjectList},#{levelList},#{type},#{fileUrlList},NOW(),NOW())
 | 
	
		
			
				|  |  | +	</insert>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 根据主键查询一条记录 -->
 | 
	
		
			
				|  |  | +	<update id="update" parameterType="com.keao.edu.user.entity.ExamSong">
 | 
	
		
			
				|  |  | +		UPDATE exam_song
 | 
	
		
			
				|  |  | +		<set>
 | 
	
		
			
				|  |  | +			<if test="levelList != null">
 | 
	
		
			
				|  |  | +				level_list_ = #{levelList},
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="id != null">
 | 
	
		
			
				|  |  | +				id_ = #{id},
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="subjectList != null">
 | 
	
		
			
				|  |  | +				subject_list_ = #{subjectList},
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="fileUrlList != null">
 | 
	
		
			
				|  |  | +				file_url_list_ = #{fileUrlList},
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="songAuthor != null">
 | 
	
		
			
				|  |  | +				song_author_ = #{songAuthor},
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="type != null">
 | 
	
		
			
				|  |  | +				type_ = #{type},
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="songName != null">
 | 
	
		
			
				|  |  | +				song_name_ = #{songName},
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="createTime != null">
 | 
	
		
			
				|  |  | +				create_time_ = #{createTime},
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			update_time_ = NOW()
 | 
	
		
			
				|  |  | +		</set> WHERE id_ = #{id}
 | 
	
		
			
				|  |  | +	</update>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 根据主键删除一条记录 -->
 | 
	
		
			
				|  |  | +	<delete id="delete" >
 | 
	
		
			
				|  |  | +		DELETE FROM exam_song WHERE id_ = #{id} 
 | 
	
		
			
				|  |  | +	</delete>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 分页查询 -->
 | 
	
		
			
				|  |  | +	<select id="queryPage" resultMap="ExamSong" parameterType="map">
 | 
	
		
			
				|  |  | +		SELECT * FROM exam_song ORDER BY id_ <include refid="global.limit"/>
 | 
	
		
			
				|  |  | +	</select>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 查询当前表的总记录数 -->
 | 
	
		
			
				|  |  | +	<select id="queryCount" resultType="int">
 | 
	
		
			
				|  |  | +		SELECT COUNT(*) FROM exam_song
 | 
	
		
			
				|  |  | +	</select>
 | 
	
		
			
				|  |  | +</mapper>
 |