zoukankan      html  css  js  c++  java
  • 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>
    
  • 相关阅读:
    hdu 3342 Legal or Not 拓排序
    hdu 1596 find the safest road Dijkstra
    hdu 1874 畅通工程续 Dijkstra
    poj 2676 sudoku dfs
    poj 2251 BFS
    poj Prime Path BFS
    poj 3278 BFS
    poj 2387 Dijkstra 模板
    poj 3083 DFS 和BFS
    poj 1062 昂贵的聘礼 dijkstra
  • 原文地址:https://www.cnblogs.com/a1111/p/12816083.html
Copyright © 2011-2022 走看看