qq_37990007 2021-06-10 12:29 采纳率: 100%
浏览 353
已采纳

Mybatis连接查询查询不到数据,但是把参数和语句写在SQlServer中能查到

控制台输出的是==>  Preparing: select count(*) as count from( select * from ( select d.order_id,d.agent,d.order_number,d.model,d.order_quantity,d.nocheduled_quantity ,d.acceptance_date,d.delivery_date,d.norder_number,d.shipserver,d.dischargeserver,d.navigationarea,d.state,d.order_remarks, e.progress_id,e.machine_number,e.task_number,e.progress_state,e.progress_investment,e.progress_online,e.progress_offline,e.progress_testrun,e.progress_finished, e.progress_shipment,e.progress_remarks from order1 d left join (select * from progress) e on d.order_id=e.order_id )f where 1=1 and progress_investment >= ? )g
==> Parameters: 2021-06-01(String)
<==    Columns: count
<==        Row: 0
<==      Total: 1
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5c9d1904]
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@44b11bf6] was not registered for synchronization because synchronization is not active
JDBC Connection [HikariProxyConnection@1996920418 wrapping ConnectionID:1 ClientConnectionId: 2aaaf779-5d90-42e8-975f-89ff90b131e4] will not be managed by Spring
==>  Preparing: select * from( select top 0 * from( select top 0* FROM (select * from (select d.order_id,d.agent,d.order_number,d.model,d.order_quantity,d.nocheduled_quantity ,d.acceptance_date,d.delivery_date,d.norder_number,d.shipserver,d.dischargeserver,d.navigationarea,d.state,d.order_remarks, e.progress_id,e.machine_number,e.task_number,e.progress_state,e.progress_investment,e.progress_online,e.progress_offline,e.progress_testrun,e.progress_finished, e.progress_shipment,e.progress_remarks from order1 d left join (select * from progress) e on d.order_id=e.order_id)d where 1=1 and progress_investment >= ? )a order by order_id desc )b order by order_id asc )c order by order_id desc
==> Parameters: 2021-06-01(String)
<==      Total: 0

但是在sqlserver中使用相同的语句,和参数能查询到数据,能帮我看看这是什么问题,应该怎么解决呢?(datetime类型的日期查询查询不到,其它参数能查到)

  • 写回答

4条回答 默认 最新

  • CSDN专家-sinJack 2021-06-10 12:37
    关注

    不加条件的情况下,能不能查询到。检查一下mapper.xml中返回的类型。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥50 adb连接不到手机是怎么回事?
  • ¥15 vs2022无法联网
  • ¥15 TCP的客户端和服务器的互联
  • ¥15 VB.NET操作免驱摄像头
  • ¥15 笔记本上移动热点开关状态查询
  • ¥85 类鸟群Boids——仿真鸟群避障的相关问题
  • ¥15 CFEDEM自带算例错误,如何解决?
  • ¥15 有没有会使用flac3d软件的家人
  • ¥20 360摄像头无法解绑使用,请教解绑当前账号绑定问题,
  • ¥15 docker实践项目