IEquipmentDao.xml 910 Bytes
Newer Older
1 2 3 4
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="dao.IEquipmentDao">
5
    <insert id="insertEquipment" useGeneratedKeys="true" keyProperty="id">
6 7 8 9 10 11
        insert into equipment(name,price) values(#{name},#{price})
    </insert>
    <select id="selectByName" resultType="beans.Equipment">
        select * from equipment where name=#{name}
    </select>
    <update id="updateEquipment">
12
        update equipment set price=#{price},name=#{name} where id=#{id}
13
    </update>
14 15 16
    <select id="selectAll" resultType="beans.Equipment">
        select * from equipment
    </select>
17 18 19
    <select id="selectById" resultType="beans.Equipment">
        select * from equipment where id=#{id}
    </select>
20 21 22
    <delete id="deleteEquipment">
        delete from equipment where id=#{id}
    </delete>
23
</mapper>