zoukankan      html  css  js  c++  java
  • IBatisNet系列执行存储过程

    映射xml文件书写如下
    <?xml version="1.0" encoding="utf-8" ?>

    <sqlMap namespace="Member" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SqlMap.xsd">
        <resultMaps>
            <resultMap id="SelectResult" class="PlatAdmin.Model.Member">
                <result property="Id" column="id" />
                <result property="Identityno" column="identityno" />
                <result property="Telephone" column="telephone" />
                <result property="Email" column="email" />
                <result property="Linktel" column="linktel" />
                <result property="Address" column="address" /> 字串1
                <result property="Content" column="content" />
                <result property="Username" column="username" />
                <result property="Password" column="password" />
                <result property="Truename" column="truename" />
                <result property="Enable" column="enable" />
                <result property="Regdate" column="regdate" />
            </resultMap>
        </resultMaps>
           
        <parameterMaps>
            <parameterMap id="swapParas" class="PlatAdmin.Model.Member">


                <parameter property="querystr" column="" />
                <parameter property="keyfield" column="" />
                <parameter property="pagesize" column="" />
                <parameter property="pagenumber" column="" />
            </parameterMap>
        </parameterMaps>
       
        <statements>
            <procedure id="GetMemberList" parameterMap="swapParas" resultMap="SelectResult">
                usp_GetRecordset
            </procedure>

           
        </statements>
    </sqlMap>
     程序代码如下:

     


    public IList GetMemberList(string querystr,int pageNo)
            {
                Hashtable ht = new Hashtable();
                ht.Add("querystr",querystr);
                ht.Add("keyfield","id");
                ht.Add("pagesize",2);
                ht.Add("pagenumber",pageNo);

     

                SqlMapper sqlMap = IBatisNet.DataMapper.Mapper.Instance(); 字串2

                try
                {
                    return sqlMap.QueryForList("GetMemberList",ht);
                }
                catch(Exception e)
                {
                    throw new IBatisNetException(e.Message,e);
                }
            }

  • 相关阅读:
    Json操作(汇总)
    Jersey实现Client端:GET/PUT/POST/DELETE
    tomcat配置文件server.xml详解
    DB2 Catalog浅析&学习笔记
    《学习笔记》Maven
    【58沈剑架构系列】单点系统架构的可用性与性能优化
    JavaScript(获取或设置html元素的宽,高,坐标),确定和判断鼠标是否在元素内部,二级导航菜单鼠标离开样式问题解决
    纯CSS绘制三角形(各种角度)
    css3 box-sizing属性值详解
    css字体图标的使用方法
  • 原文地址:https://www.cnblogs.com/yyilin/p/1126508.html
Copyright © 2011-2022 走看看