parameterClass 是参数类。指定了参数的完整类名(包括包路径)。可通过别名避免每次重复书写冗长的类名。

resultClass 是结果类,

二、resultClass取值

1.resultClass="Integer"//基本类型,或者是java.lang.Integer

2.resultClass="com.sfbest.product.bean.ProductPicture"//Model对象

3.resultClass="string"//基本类型,java.lang.String

4.resultClass="long"//基本类型,java.lang.long

5.resultClass="java.util.HashMap"//map集合

//resultClass的用法如下:

<select id="getCount" parameterClass="OrderManualItem" resultClass="java.lang.Integer">
select count(*) from order_manual_item omi
where omi.is_delete='N'
</select>

resultMap 是结果映射,需结合resultMap节点对映射关系加以定义。

resultType   返回值类型,不需要映射直接使用

<!-- 处方药催单SQL LYD -->
<select id="selectUnTcPaidMobilesNew" parameterType="map" resultType="java.util.HashMap">
select m.mobile as mobile,o.order_id as orderid
from order_info o,member m
where o.member_id=m.member_id and m.mobile is not null and o.payment_mode = 'KDFH'
and o.is_paid != 'Y'
and o.is_tc = 'Y'
and o.order_state != (select code_id from sys_code
where code_type_no = 'order_state'
and code_no = 'cancel')
and o.is_delete = 'N'
and round(to_number(sysdate -to_date(o.commit_time, 'YYYY-MM-DD hh24:mi:ss')) * 24) &gt;= 12
and round(to_number(sysdate -to_date(o.commit_time, 'YYYY-MM-DD hh24:mi:ss')) * 24) &lt;36
</select>

//注意:

mybatis中,patamaterType 省略不写的时候,mybatis可以自动识别,

patamaterType="int",

patamaterType="String",//或者是patamaterType="string",

ibatis中的resultClass,parameterClass,resultMap,resultType的使用与区别的更多相关文章

  1. ibatis中resultClass与resultMap 的区别

    ibatis的resultClass与resultMap还是有很大的区别.以下是我碰到的一个问题. 配置文件写法如下: 1 sqlMap2 typeAlias alias="notice&q ...

  2. ibatis的resultClass与resultMap 的区别

    ibatis的resultClass与resultMap还是有很大的区别.以下是我碰到的一个问题. 配置文件写法如下: 1 sqlMap2 typeAlias alias="notice&q ...

  3. ibatis 中isNull, isNotNull与isEmpty, isNotEmpty区别

    在iBATIS中isNull用于判断参数是否为Null,isNotNull相反 isEmpty判断参数是否为Null或者空,满足其中一个条件则其true isNotEmpty相反,当参数既不为Null ...

  4. IBATIS中‘$’与‘#’使用

    IBATIS中关于iterate和‘$’与‘#’的应用 一个包含List元素的HashMap参数赋给sqlMap  public int getCountById(String id, String ...

  5. ibatis中使用List作为传入参数的使用方法及 CDATA使用

    ibatis中list做回参很简单,resultClass设为list中元素类型,dao层调用: (List)getSqlMapClientTemplate().queryForList(" ...

  6. 【转】ibatis 中使用select top #pagesize# * from tablename

    ibatis中使用select top #num# * from tableName出现错误.由于初次用ibatis还不知道在它里边拼写SQL语句的一些规则,导致一些自认为很平常的SQL语句,在它这里 ...

  7. ibatis中的$和#的区别

    介绍 在Ibatis中我们使用SqlMap进行Sql查询时需要引用参数,在参数引用中遇到的符号#和$之间的区分为,#可以进行与编译,进行类型匹配,而$不进行数据类型匹配,例如: select * fr ...

  8. SSM-MyBatis-11:Mybatis中查询全部用resultmap

    ------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥------------- 实体类很普通,四个字段,编号,名字,作者名,价格 在接口中的方法声明如下 //查全部 public List& ...

  9. ibatis中使用缓存

    简单在ibatis中使用cache 首先设置SqlMapConfig.xml中<settings/>节点的属性cacheModelsEnabled="true"     ...

随机推荐

  1. DELL磁盘阵列控制卡(RAID卡)MegaCli常用管理命令汇总

    新版本的 MegaCli-1.01.24-0.i386.rpm (下载地址:http://www.lsi.com/downloads/Public/MegaRAID Common Files/8.02 ...

  2. HashMap的扩容机制, ConcurrentHashMap和Hashtable主要区别

    源代码查看,有三个常量, static final int DEFAULT_INITIAL_CAPACITY = 16; static final int MAXIMUM_CAPACITY = 1 & ...

  3. JavaScript--基本包装类型+Math对象

    1. 基本包装类型 1)为了便于操作基本类型值,ECMAScript提供了3个特殊的引用类Boolean, Number, String       每当读取一个基本类型值的时候,后台就会创建一个对应 ...

  4. [欢度国庆]为什么我们今天还要学习和使用C++?(转载)

    在各种新的开发语言层出不穷的今天,在Java和C#大行其道今天,我们为什么还要学习和使用C++?现在学习C++将来有用吗?学习C++要花费那么多时间和精力,这一切都值得吗?现在学习C++有钱途吗? 这 ...

  5. 2013多校联合2 I Warm up 2(hdu 4619)

    Warm up 2 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total ...

  6. jQuery1.9(辅助函数)学习之——.serializeArray();

    .serializeArray();返回一个Array 描述: 将用作提交的表单元素的值编译成拥有name和value对象组成的数组.例如[ { name: a value: 1 }, { name: ...

  7. addChildViewController 用法

    // // SCMyOrderViewController.m // SmartCommunity // // Created by chenhuan on 15/9/7. // Copyright ...

  8. Android应用----如何让应用全屏

    一般Android的应用启动时都有欢迎界面,类似QQHD启动那样.比较大方绚丽.心动不如行动,有时间自己也来实现类似的效果,嘿嘿.    观察发现QQHD的欢迎界面是全屏的,这个好办.下面就Andro ...

  9. Centos 6.5 搭建php环境(nginx+mariadb+php7)

    1.mariaDb vim /etc/yum.repos.d/MariaDB.repo [mariadb] name = MariaDB baseurl = http://yum.mariadb.or ...

  10. phpcms插件开发初步规范

    phpcms公用库函数原型 (一)./include/global.php 中的函数可在phpcms的任何一个程序中调用,下面是各函数的原型及用法. message($alert,$goback='' ...