NutzCN Logo
问答 id in如果直接传数组不行吗 还是其他原因的错误呢
发布于 2703天前 作者 Hamming 1706 次浏览 复制 上一个帖子 下一个帖子
标签:

select count(1) from (SELECT o.id, o.ordUserId, o.checkStyle, o.orderState, o.jfLimit, o.userIntegral, o.saleContent, o.transPrice,
o.totalPrice, o.addrContent, o.revName, o.revPhone, o.transName, o.transCode, o.shoppingTime, o.receivTime,
u.id as uid, u.loginname
FROM app_order AS o
INNER JOIN app_user AS u
ON o.ordUserId= u.id
WHERE o.delFlag=0and o.id in '["36181fa3c647442d99a683f136df1807", "63f39559c9d44f22b04549606c468037", "b34c4b274ce54f1fafe76a906ae64fc2", "231874f5f24b4163823a346206333718", "231874f5f24b4163823a346206333718", "231874f5f24b4163823a346206333718", "78cd8c9acc6247e3b5a1ed963ed78723", "dc54bec6858a471f9de073287244d0f0", "65cea399fe994f2cada46e15491691b6", "d476823663774fa289c4f4f1d921da09", "890a7bdccdd8458198a5e2e71b55386f", "890a7bdccdd8458198a5e2e71b55386f", "6a483a13d38b4b109cc8a762cfcc78bc", "360389565a244b9fb58486d1c1b96965", "360389565a244b9fb58486d1c1b96965", "360389565a244b9fb58486d1c1b96965", "e9d58858a43e4810a397ef14f9a156e1", "c700c16205c94d6a945dba306d0d3935", "c700c16205c94d6a945dba306d0d3935", "c700c16205c94d6a945dba306d0d3935", "44004269309f43ce83e0befe0b2fa64c", "974bcaa20caa49cfbb76a83d7910c690", "39dead309e624c48a20a14c7a60b1d5c"]')as _nutz_tmp_u25f6mrh0aj3lq2456nogai56a'
CaseMessage=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'o.id in '["36181fa3c647442d99a683f136df1807", "63f39559c9d44f22b04549606c468037"' at line 7

6 回复

目测传的是字符串

@wendal sql.params().set("oid", ids);酱紫赋值的

ids的值是什么,ids这变量的类型是什么

@wendal List ids = new ArrayList<>();

	List<String> ids = new ArrayList<>();

目测是老版本,那就用老写法

sql.params().set("oid", ids.toArray(new String[ids.size()]));

添加回复
请先登陆
回到顶部