<?xml version="1.0" encoding="utf-8" ?><sqlMap namespace="Product" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><alias><!--商品别名--><typeAlias alias="Product" type="OMS.DTL.Entities.Product,OMS.DTL" /><!--商品部分属性别名--><typeAlias alias="ProductPartial" type="OMS.DTL.Entities.ProductPartial,OMS.DTL"/><!--商品查询条件别名--><typeAlias alias="ProductQueryCondition" type="OMS.DTL.Entities.ProductQueryCondition,OMS.DTL"/></alias><!--结果映射--><resultMaps><resultMap id="ProductPartial" class="ProductPartial"><result property="ProductID" column="ProductID"/><result property="ProductName" column="ProductName"/><result property="QuantityPerUnit" column="QuantityPerUnit"/><result property="UnitPrice" column="UnitPrice" /><result property="UnitsInStock" column="UnitsInStock"/></resultMap></resultMaps><statements><!--查询所有商品--><select id="SelectAllProduct" resultClass="Product">SELECT [ProductID],[ProductName],[SupplierID],[CategoryID],[QuantityPerUnit],[UnitPrice],[UnitsInStock],[UnitsOnOrder],[ReorderLevel],[Discontinued]FROM [Products]</select><!--根据商品ID查询商品--><select id="SelectProductByProductID" parameterClass="int" resultClass="Product" extends="SelectAllProduct">WHERE ProductID=#PorductID#</select><!--获取所有产品的部分信息--><select id="SelectAllProductPartial" resultMap="ProductPartial">SELECT [ProductID],[ProductName],[SupplierID],[CategoryID],[QuantityPerUnit],[UnitPrice],[UnitsInStock],[UnitsOnOrder],[ReorderLevel],[Discontinued]FROM [Products]</select><!--通过两个条件或的关系查找--><!--通过字典传值--><select id="SelectProductByIDOrName" parameterClass="System.Collections.IDictionary" resultClass="Product" extends="SelectAllProduct">WHERE ProductID=#ProductID# OR ProductName=#ProductName#      </select><!--通过类传值--><select id="SelectProductBySupplierIDOrCategoryID" parameterClass="ProductQueryCondition" resultClass="Product" extends="SelectAllProduct">WHERE SupplierID=#SupplierID# OR CategoryID=#CategoryID#</select><!--插入操作--><insert id="Insert" parameterClass="Product">INSERT INTO [Products]([ProductName],[SupplierID],[CategoryID],[QuantityPerUnit],[UnitPrice],[UnitsInStock],[UnitsOnOrder],[ReorderLevel],[Discontinued])VALUES(#ProductName#,#SupplierID#,#CategoryID#,#QuantityPerUnit#,#UnitPrice#,#UnitsInStock#,#UnitsOnOrder#,#ReorderLevel#,#Discontinued#)<!--获取自增列ID--><selectKey resultClass="int" type="post" property="ProductID" >select @@IDENTITY as value</selectKey></insert><!--更新操作--><update id="Update" parameterClass="System.Collections.IDictionary">update Productsset ProductName = #ProductName#where ProductID = #ProductID#</update><!--删除操作--><delete id="Delete" parameterClass="int">Delete From ProductsWhere ProductID=#ProductID#</delete></statements></sqlMap>

转载于:https://www.cnblogs.com/wjchang/archive/2013/01/24/3671548.html

IBastis配置实例相关推荐

  1. log4j2配置实例[按小时记录日志文件]

    log4j2.xml文件配置实例:<?xml version="1.0" encoding="UTF-8"?> <configuration ...

  2. 地址设置nginx负载均衡_nginx负载均衡配置实例

    什么是负载均衡? 负载均衡主要通过专门的硬件设备或者通过软件算法实现.通过硬件设备实现的负载均衡效果好.效率高.性能稳定,但是成本比较高.通过软件实现的负载均衡主要依赖于均衡算法的选择和程序的健壮性. ...

  3. 多 LDAP 目录服务器的 FileNet P8 系统介绍和配置实例

    摘抄笔记:http://www.ibm.com/developerworks/cn/data/library/techarticle/dm-1312multipldap/ 多 LDAP 目录服务器的 ...

  4. proftpd的安装配置实例

    为什么80%的码农都做不了架构师?>>>    一个proftpd的安装配置实例. 目的:  安装配置一个proftpd,达到以下要求  1  不允许匿名访问.  2  开放一个帐号 ...

  5. Cisco pix515配置实例

    一.引言 硬件防火墙的应用,现在是越来越多,产品也很丰富.一般国产的防火墙多带有中文的说明和一些相应的配置实例,但国外的产品几乎都没有中文的说明书,这对一个初学者来说,尤其是中国的用户,是很不方便的, ...

  6. 命名式ACL配置实例

    命名式ACL配置实例 稍微大一些的企业在网络管理中就要经常用到命名式的ACL配置.由于企业部门的分化,不同的部门需要不同ACL规则.其实配置ACL非常简单,首先命名一个ACL,然后进入将你所需要的AC ...

  7. nginx---ngix虚拟主机配置实例

    2019独角兽企业重金招聘Python工程师标准>>> ngix虚拟主机配置实例 http://www.cnblogs.com/eoiioe/archive/2009/05/09/1 ...

  8. Nginx-07:Nginx配置实例之动静分离

    Nginx配置实例之动静分离 1.动静分离概念 2.准备工作 image和www放静态资源. 3.具体配置 (1)在nginx的config中配置 autoindex on:列出当前文件夹中的文件 4 ...

  9. Nginx-06:Nginx配置实例之负载均衡

    Nginx配置实例之负载均衡 目的:访问http://192.168.17.129/edu/a.html时平均的分配到8080和8081端口,即实现负载均衡的效果. 1.准备工作 (1)准备两台tom ...

最新文章

  1. Codeforces 336C 0-1背包
  2. 使用 yolov3训练 voc2012
  3. C++Adaline自适应线性神经网络算法(附完整源码)
  4. 苹果电脑无法用普通域用户加入域,用域管理员却可以,怎么破!?
  5. 【Spring 基础篇三】属性注入与属性编辑器
  6. 在linux下配置java,在Linux下配置Java开发环境
  7. 信息竞赛进阶指南--单调栈(模板)
  8. 实用的编程网站—良好的开端
  9. python多进程编程_python并发编程中的多进程(代码实现)
  10. solrcloud配置中文分词器ik
  11. MFC的HTML View在初始化时如何打开指定网页?
  12. html背景位置渐变,CSS3(背景和渐变)
  13. DOS的net命令详解
  14. ElasticSearch创建索引映射文档+IK分词器
  15. jq 清除ajax缓存,js清除浏览器缓存的几种方法
  16. 强烈推荐的程序员键盘--红轴手感好按键压力小写代码更轻松
  17. python训练Word2Vec词向量
  18. C# 操作MongoDB时间 时差问题
  19. Android 关于RemoteViews的理解(一)
  20. 个性化广告推荐系统(实战)-1-协同过滤篇

热门文章

  1. android 勿扰模式代码,android Lollipop勿扰模式
  2. Java循环添加文件_java – 使用jGit循环提交文件
  3. java数组的api_java程序员常用的11个API,赶紧收藏
  4. matlab匿名函数求导,Matlab中的匿名函数的使用
  5. 开启mapper接口扫描,添加分页插件
  6. MySQL单列索引与复合索引选择
  7. Nginx的index指令
  8. Spring 工厂的相关的方法
  9. linux的TCP连接数量最大不能超过65535个,那服务器是如何应对百万千万的并发的?
  10. Eureka、Zookeeper和Consul 的区别