當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
ssm(Spring+Spring mvc+mybatis)Dao层配置sql的文件——DeptDaoMapper.xml
生活随笔
收集整理的這篇文章主要介紹了
ssm(Spring+Spring mvc+mybatis)Dao层配置sql的文件——DeptDaoMapper.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"><!-- namespace:接口的全路徑名 -->
<mapper namespace="org.dao.IDeptDao"> <!-- 查詢全部數據 --><select id="getDeptAll" resultType="org.entity.Dept">select * from dept</select><!-- 添加部門 --><insert id="saveEntity" parameterType="org.entity.Dept">insert into dept (id,name,loc) values(#{id},#{name},#{loc})</insert><!-- 修改部門 --><update id="updateEntity" parameterType="org.entity.Dept">update dept set name=#{name},loc=#{loc} where id=#{id}</update><!-- 刪除部門 --><delete id="delEntity" parameterType="org.entity.Dept">delete from dept where id = #{id}</delete><!-- 根據編號查詢 --><select id="getDeptById" resultType="org.entity.Dept" parameterType="int">select * from dept where id = #{id}</select>
</mapper>
總結
以上是生活随笔為你收集整理的ssm(Spring+Spring mvc+mybatis)Dao层配置sql的文件——DeptDaoMapper.xml的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2021液晶电视CPU怎么选?
- 下一篇: cod8mw3最低配置?