mybatis执行sql失败,数据库客户端执行成功
今天遇到一个问题mybatis执行sql失败,数据库客户端(mysql)执行成功,找不到原因,哪位大神给看看,sql如下updatebiz_workordertsett....
今天遇到一个问题 mybatis执行sql失败,数据库客户端(mysql)执行成功,找不到原因,哪位大神给看看,sql如下
update biz_workorder t
set t.woSecondType_id = ''
where t.cisWoid = '170415464567';
update biz_workorder t
set t.woSecondType_id = (
select id
from biz_workordertypedetail
where ownership like CONCAT('0185', '%')
and enesyscode = '220519'
)
where t.cisWoid = '170416465163';
update biz_workorder t
set t.finish_time = '2017-04-17', t.woSecondType_id = (
select id
from biz_workordertypedetail
where ownership like CONCAT('0185', '%')
and enesyscode = '220519'
)
where t.cisWoid = '170417466373'
mybatisxml里如下
<update id="sysWOSecondTypeAndFinishTime" parameterType="java.util.List">
<foreach collection="list" item="item" index="index"
separator=" ">
UPDATE biz_workorder t
SET
<if test="item.finishTime!=null and item.finishTime!=''">
t.finish_time =#{item.finishTime},
</if>
t.woSecondType_id =
<choose>
<when test="item.enesyscode!=null and item.enesyscode!=''">
(SELECT id
FROM
biz_workordertypedetail
WHERE
ownership LIKE CONCAT(#{item.ownership},'%')
AND enesyscode =#{item.enesyscode})
</when>
<otherwise>
''
</otherwise>
</choose>
where t.cisWoid = #{item.cisWoid}
</foreach>
</update> 展开
update biz_workorder t
set t.woSecondType_id = ''
where t.cisWoid = '170415464567';
update biz_workorder t
set t.woSecondType_id = (
select id
from biz_workordertypedetail
where ownership like CONCAT('0185', '%')
and enesyscode = '220519'
)
where t.cisWoid = '170416465163';
update biz_workorder t
set t.finish_time = '2017-04-17', t.woSecondType_id = (
select id
from biz_workordertypedetail
where ownership like CONCAT('0185', '%')
and enesyscode = '220519'
)
where t.cisWoid = '170417466373'
mybatisxml里如下
<update id="sysWOSecondTypeAndFinishTime" parameterType="java.util.List">
<foreach collection="list" item="item" index="index"
separator=" ">
UPDATE biz_workorder t
SET
<if test="item.finishTime!=null and item.finishTime!=''">
t.finish_time =#{item.finishTime},
</if>
t.woSecondType_id =
<choose>
<when test="item.enesyscode!=null and item.enesyscode!=''">
(SELECT id
FROM
biz_workordertypedetail
WHERE
ownership LIKE CONCAT(#{item.ownership},'%')
AND enesyscode =#{item.enesyscode})
</when>
<otherwise>
''
</otherwise>
</choose>
where t.cisWoid = #{item.cisWoid}
</foreach>
</update> 展开
展开全部
c.content content,
c.commentDate commentDate,
c.article_id articleId,
c.visitor_id visitorId,
v.nickname nickname,
v.email email,
v.sex sex,
(case
length(queryCommentWithAmout(c.id))-length(replace(queryCommentWithAmout(c.id),',',''))
when
0
then
0
else
length(queryCommentWithAmout(c.id))
c.commentDate commentDate,
c.article_id articleId,
c.visitor_id visitorId,
v.nickname nickname,
v.email email,
v.sex sex,
(case
length(queryCommentWithAmout(c.id))-length(replace(queryCommentWithAmout(c.id),',',''))
when
0
then
0
else
length(queryCommentWithAmout(c.id))
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询