在sql语句里加了if判断为啥不执行啊

qq_45526255 2019-08-14 03:19:29
<!-- 状态查询 -->
<select id="selectorderDetail" resultType="orderr">

select orderr.*,users.name from users inner join orderr on orderr.usId = users.usId

<if test="state!=null and state!=''">
and state = #{state}
</if>
</select>
...全文
259 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Hello World, 2019-08-14
  • 打赏
  • 举报
回复

连where也没加,
参考这个:Mybatis中动态sql(多条件查询)
Hello World, 2019-08-14
  • 打赏
  • 举报
回复
Java Mybatis,应该到java版去问吧
二月十六 2019-08-14
  • 打赏
  • 举报
回复
楼主这个是什么程序,什么框架?

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧