文件上傳的XML文件

<?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.bootdo.nsmp.dao.MaterialDao">

	<select id="list" resultType="com.bootdo.nsmp.domain.Material">
		select * from material
		<if test="offset != null and limit != null">
			limit ${offset}, ${limit}
		</if>
	</select>

	<select id="count" resultType="int">
		select count(*) from material
	</select>

	<insert id="save" parameterType="com.bootdo.nsmp.domain.Material"
			useGeneratedKeys="true" keyProperty="id">
		insert into material
		(
		`structure`,
		`stru_file`,
		`stru_file_url`,
		`safe`,
		`safe_file`,
		`safe_file_url`,
		`protect`,
		`pro_file`,
		`pro_file_url`,
		`list`,
		`list_file`,
		`list_file_url`,
		`clazz`,
		`clazz_file`,
		`clazz_file_url`,
		`judge`,
		`judge_file`,
		`judge_file_url`,
		`gover`,
		`gover_file`,
		`gover_file_url`
		)
		values
		(
		#{structure},
		#{struFile},
		#{struFileUrl},
		#{safe},
		#{safeFile},
		#{safeFileUrl},
		#{protect},
		#{proFile},
		#{proFileUrl},
		#{list},
		#{listFile},
		#{listFileUrl},
		#{clazz},
		#{clazzFile},
		#{clazzFileUrl},
		#{judge},
		#{judgeFile},
		#{judgeFileUrl},
		#{gover},
		#{goverFile},
		#{goverFileUrl}

		)
	</insert>

	<!--get-->
	<select id="get" resultType="com.bootdo.nsmp.domain.Material">
		select
		`id`,
		`structure`,
		`stru_file`,
		`stru_file_url`,
		`safe`,
		`safe_file`,
		`safe_file_url`,
		`protect`,
		`pro_file`,
		`pro_file_url`,
		`list`,
		`list_file`,
		`list_file_url`,
		`clazz`,
		`clazz_file`,
		`clazz_file_url`,
		`judge`,
		`judge_file`,
		`judge_file_url`,
		`gover`,
		`gover_file`,
		`gover_file_url`
		from material where id = #{value}
	</select>

	<!--update-->
	<update id="update" parameterType="com.bootdo.nsmp.domain.Material">
		update material
		<set>
			`structure` = #{structure},
			`stru_file` = #{struFile},
			`stru_file_url` = #{struFileUrl},
			`safe` = #{safe},
			`safe_file` = #{safeFile},
			`safe_file_url` = #{safeFileUrl},
			`protect` = #{protect},
			`pro_file` = #{proFile},
			`pro_file_url` = #{proFileUrl},
			`list` = #{list},
			`list_file` = #{listFile},
			`list_file_url` = #{listFileUrl},
			`clazz` = #{clazz},
			`clazz_file` = #{clazzFile},
			`clazz_file_url` = #{clazzFileUrl},
			`judge` = #{judge},
			`judge_file` = #{judgeFile},
			`judge_file_url` = #{judgeFileUrl},
			`gover` = #{gover},
			`gover_file` = #{goverFile},
			`gover_file_url` = #{goverFileUrl}
		</set>
		where id = #{id}
	</update>

	<!--remove-->
	<delete id="remove">
		delete from material where id = #{value}
	</delete>

	<!--batchRemove-->
	<delete id="batchRemove">
		delete from material where id in
		<foreach item="id" collection="array" open="(" separator=","
				 close=")">
			#{id}
		</foreach>
	</delete>

</mapper>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章