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

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条)

报告相同问题?

悬赏问题

  • ¥15 一个识别内容的自动化脚本程序
  • ¥15 anaconda虚拟python环境部署langchain-chatchat报错
  • ¥20 matlab有约束条件下的多元函数求最小值
  • ¥50 如何隐藏网页弹出框的url地址栏
  • ¥20 metropolis算法模拟二维ising模型来计算磁化强度,fortran
  • ¥15 uniapp-typescript-vue报错
  • ¥15 oracle强制关机以后报错01033
  • ¥15 给Chat with RTX添加语言模型时遇到问题
  • ¥15 oracle修复,怎么根据日志修复呀?
  • ¥15 使用Stable Diffusion时出现错误