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
| <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muchlab.dao.BookMapper"> <insert id="addBook" parameterType="Books"> insert into ssmbuild.books (bookName, bookCounts, detail) values (#{bookName}, #{bookCounts}, #{detail}); </insert> <delete id="deleteBookById" parameterType="int"> delete from ssmbuild.books where bookID = #{bookID} </delete> <update id="updateBook" parameterType="Books"> update ssmbuild.books set bookName=#{bookName}, bookCounts=#{bookCounts}, detail=#{detail} where bookID=#{bookID}; </update> <select id="queryBookById" resultType="Books"> select * from ssmbuild.books where bookID = #{bookID}; </select> <select id="queryAllBook" resultType="Books"> select * from ssmbuild.books; </select> <select id="queryBookByName" resultType="Books"> select * from ssmbuild.books where bookName like "%"#{bookName}"%"; </select> </mapper>
|