关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、3102411850 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 9198|回复: 1

JeecgBoot 3.0 mapper不对map参数?

[复制链接]
发表于 2021-11-13 18:56:43 | 显示全部楼层 |阅读模式
JeecgBoot 3.0  是用mybatis-plus,应该能支持多参数?但3.0却不行,如下图:
/**
         * 多参数据 查系统字典
         * @param pageSize
         * @param pageNo
         * @return
         */
        IPage<SysDict> queryPageList(Map<String, Object> map, int pageSize, int pageNo);


mapper.xml写法:

<select id="queryPageList" parameterType="map"  resultType="org.jeecg.modules.system.entity.SysDict">
                 select s.dict_Name as "value",s.dict_code as "text" from sys_dict s
                <if test="dictName != null and dictName != ''">
                        s.dict_Name = #{dictName}
                </if>
                <if test="dictCode != null and dictCode != ''">
                        s.dict_code = #{dictCode}
                </if>
        </select>


报错信息:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'dictName' not found. Available parameters are [arg0, query, param1, param2]

 楼主| 发表于 2021-11-14 15:22:30 | 显示全部楼层
问题解决了,对于在Mapper.java中的方法如果返回的不是Ipage<>,则跟mybatis一样,可以随意用map,但如果返回的是是Ipage<>,则参数必须要写成 @Param("map")Map<String, Object> map 这样,而且在对应的xml中要用map.name完整判断,如<if test="map.name != null and map.name != ''">
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表