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

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

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

查看: 6336|回复: 1

SQL语句中怎么拼接 in 条件

[复制链接]
发表于 2018-5-23 11:29:47 | 显示全部楼层 |阅读模式
AND rwc.item_code in (
<#assign x >
        <#list itemCodes as itemCode>
             ${itemCode}
             <#if itemCode_has_next>,</#if>
        </#list>
</#assign>
${x}
)

这样出来的数据为 AND rwc.item_code in ('a,b'),查询不出数据
如果修改为’${itemCode}' 之后 AND rwc.item_code in ('’a‘,’b‘'),请问怎么去掉最外面的'' 单引号呀!
 楼主| 发表于 2018-5-23 13:31:58 | 显示全部楼层
不好意思,是我传参时添加了单引号,
AND rwc.item_code IN (
<#list itemCodes as itemCode>
        '${itemCode}'
        <#if itemCode_has_next>,</#if>
</#list>
)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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