mybatis 参数为String,if test读取该参数
2015-07-24 11:23
246 查看
错误:There is no getter for property named 'userId' in 'class java.lang.String'
错误写法:
<select id="selectFlowTxInfoDO" resultType="int" parameterType="java.lang.String"> select count(1) from first_flow_tx_info fcpi where 1=1 <if test="userId != null" > and user_id = #{userId,jdbcType=VARCHAR} and fcpi.tx_status NOT IN (10,00,30,50) </if> </select>
正确
<select id="getMaxDepartId" parameterType="java.lang.String" resultType="java.lang.String">
select
count(1)
from first_flow_tx_info fcpi
where 1=1
<if test="_parameter != null" >
and user_id = #{userId,jdbcType=VARCHAR} and fcpi.tx_status NOT IN (10,00,30,50)
</if>
</select>
相关文章推荐
- 写一篇日志
- Deep Learning in NLP (一)词向量和语言模型
- Android架构实战(三)—— Retrofit
- hdu 1142 A Walk Through the Forest
- 关于:Java 类文件的内部情况课程详析
- 朴素贝叶斯方法(Naive Bayes Method)
- NSFileManager
- 数电模电基础(1)分压电路
- Leetcode Q4:Median of Two Sorted Arrays
- HDU 1850 Being a Good Boy in Spring Festival(Nim博弈)
- Activity生命周期-Android
- 多播包的发送与接收
- 数据库题——高于部门平均工资查询问题
- 时间处理
- Elevator
- vc6.0下,GDI+的配置
- 利用response和HttP中的Content-Disposition: attachment; filename=aaa.zip响应头,实现简单的文件下载
- 瑞年平年
- kindeditor 几个属性filterMode resizeType pasteType
- 搭建高可用MongoDB集群(四):分片-----个人记录