mybatis 之 resultType="Integer"
public class EcPromoteRuleAdditionalNew extends BaseBO {
private String[] promoteRuleIds;
public String[] getPromoteRuleIds() {
return promoteRuleIds;
}
public void setPromoteRuleIds(String[] promoteRuleIds) {
this.promoteRuleIds = promoteRuleIds;
}
}
if (!allUsedPromoteRuleIds.equals("")) {
allUsedPromoteRuleIds = allUsedPromoteRuleIds.substring(0,
allUsedPromoteRuleIds.lastIndexOf(","));
}
// 根据促销规则查询是否不支持货到付款
if (allUsedPromoteRuleIds != null
&& !allUsedPromoteRuleIds.equals("")) {
EcPromoteRuleAdditionalNew promoteRuleAdditional = new EcPromoteRuleAdditionalNew();
promoteRuleAdditional.setPromoteRuleIds(allUsedPromoteRuleIds
.split(","));
Integer count = myecService
.getAdditionalKDFHCount(promoteRuleAdditional);
<!-- 根据促销规则查询附加优惠是否支持货到付款 -->
<select id="getAdditionalKDFHCount" resultType="Integer" parameterType="EcPromoteRuleAdditionalNew">
)
from ec_promote_rule_new pr,
ec_promote_rule_ADDITIONAL_NEW pra
where pr.promote_rule_id = pra.promote_rule_id
and pra.additional_type = 'FKFS'
and pra.additional_value = 'KDFH'
<if test="promoteRuleIds != null">
and pra.PROMOTE_RULE_ID in
<foreach collection="promoteRuleIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
mybatis 之 resultType="Integer"的更多相关文章
- 问题-MyBatis不识别Integer值为0的数据
问题-MyBatis不识别Integer值为0的数据 问题:使用MyBatis的过程中,发现一个值为0的数据,Mybatis所识别,最后定位才发现,是自己的写法有问题, <if test=&qu ...
- MyBatis有关resultType和resultMap差异
MyBatis有关resultType和resultMap差异 MyBatis中在查询进行select映射的时候,返回类型能够用resultType,也能够用resultMap.resultTyp ...
- mybatis中resultType和resultMap的联系
在使用mybatis进行数据库连接操作时对于SQL语句返回结果的处理通常有两种方式,一种就是resultType另一种就是resultMap,下面说下我对这两者的认识和理解 比如,我们平时使用的单表查 ...
- Mybatis的resultType
使用mybatis去查询数据时,没有指定resultType,mybatis无法返回正常结果,当然在web中并没有出现报错,所以有点坑自己了,所以需要使用如下配置: <select id=&qu ...
- mybatis中使用Integer类型的参数<if>判断问题
mybatis对传入参数进行判断时,会使用if标签, 一般是判断不为null和'', 如下: <if test="name != null and 那么 != ''"> ...
- MyBatis中resultType和resultMap的区别
resultType和resultMap功能类似 ,都是返回对象信息 ,但是resultMap要更强大一些 ,可自定义.因为resultMap要配置一下,表和类的一一对应关系,所以说就算你的字段名 ...
- [转]MyBatis中resultType与resultMap区别
MyBatis中关于resultType和resultMap的具体区别如下: MyBatis中在查询进行select映射的时候,返回类型可以用resultType,也可以用resultMap.resu ...
- Mybatis中resultType和resultMap
一.概述MyBatis中在查询进行select映射的时候,返回类型可以用resultType,也可以用resultMap,resultType是直接表示返回类型的,而resultMap则是对外部Res ...
- MyBatis参数为Integer型并赋值为0时判断失误的问题解决
mybatis.xml中有if判断条件判断参数不为空时,赋值为0的Integer参数被MyBatis判断为空,因此不执行<if test="param != null and para ...
随机推荐
- Axiom3D写游戏:第一个窗口
Axiom主要的代码大致翻看了下,就想到了自己来模拟一下游戏开发. 这章主要包括创建窗口及3D渲染的一些基本元素,并添加一个第三人称的骨骼动画作主角,加上前文中修改过后的地形组件,能用鼠标和键盘进行漫 ...
- Deep Residual Learning for Image Recognition这篇文章
作者:何凯明等,来自微软亚洲研究院: 这篇文章为CVPR的最佳论文奖:(conference on computer vision and pattern recognition) 在神经网络中,常遇 ...
- Java如何使用线程异常?
在Java编程中,如何使用线程异常? 此示例显示如何在处理线程时处理异常. package com.yiibai; class MyThread extends Thread { public voi ...
- IDEA VS 快捷键 大全
[参考]IntelliJ IDEA 常用 黄金 快捷键 总结 不断更新 一.VS常用快捷键 (01).快速插入foreach.try等循环:Tab + Tab; (02).回到光标前一位置: ...
- Redis系列-php怎么通过redis扩展使用redis
From: http://blog.csdn.net/love__coder/article/details/8691679 通过前面几篇blog,我们应该对redis有个大致的认识,这里再讲解下,p ...
- php 获取某文件内容
获取某文件下 的文件夹和文件 public function dirRead($dir=''){ //$dir = './upload/images'; $result = ''; if (is_di ...
- MyEclipse如何恢复删掉的文件
今天一不小心删了项目里的两个包,心里那个痛啊,一想MyEclipse这么强大,应该会有恢复文件的功能吧,要不就太坑了啊. 果不其然让我找到了方法: 如图:右击项目选择 然后在弹出的页面勾选需要恢复的文 ...
- 升级到yosemite后homebrew报错的解决
报错会如下: /usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Ve ...
- Android 布局学习之——Layout(布局)详解二(常见布局和布局参数)
[Android布局学习系列] 1.Android 布局学习之——Layout(布局)详解一 2.Android 布局学习之——Layout(布局)详解二(常见布局和布局参数) 3.And ...
- windows server 2003R2\2008R2\2012\2016 安装【故障转移群集】cluster
温故而知新! 靠,突然觉得it技能只要一年的时间就能忘记! virtualbox虚拟机安装群集,注意点: clone的虚拟机,sid问题.sysprep太慢了,不如重新安装快! 虚拟机增强组件,会影响 ...