NutzCN Logo
问答 [疑似 bug]Mysql Date类型查询返回为空
发布于 45天前 作者 wx_5j78h4fq1p0uinec65vj 350 次浏览 复制 上一个帖子 下一个帖子
标签:

查询语句:

LSLLV2TermScanHistoryRecord historyRecord = null;
            historyRecord = xLSLLV2TermScanHistoryRecordService.fetch(CndUtil.whereEnabled()
                                                                              .and("dealerId", "=", dealerId)
                                                                              .and("type", "=", scanTypeIsTermIn == 1 ? XLSLLV2TermScanHistoryRecord.SCAN_TYPE_IN : XLSLLV2TermScanHistoryRecord.SCAN_TYPE_OUT)
                                                                              .and("scanDate", "=", beginDate));

这里historyRecord为 null。
Log:

[DEBUG] [03-13 15:31:48] [TraceUser:] [TraceId:] [NutzFwWebJobScheduler_Worker-3] o.n.d.i.s.r.NutDaoExecutor:?  - SELECT * FROM xws_term_scan_history_LL_V2_XLS_record  WHERE delFlag=? AND dealerId=? AND type=? AND scanDate=? LIMIT 0, 1 
    | 1 |    2 |  3 |                   4 |
    |---|------|----|---------------------|
    | 0 | 3057 | IN | 2023-11-28 00:00:00 |
  For example:> "SELECT * FROM xws_term_scan_history_LL_V2_XLS_record  WHERE delFlag=0 AND dealerId=3057 AND type='IN' AND scanDate='2023-11-28 00:00:00' LIMIT 0, 1 "

在 idea 中使用“ For example: ”直接查询:
可以查询到数据,不会贴图。但是确实查到了

nutz_demo2_product> SELECT * FROM xws_term_scan_history_LL_V2_XLS_record  WHERE delFlag=0 AND dealerId=3057 AND type='IN' AND scanDate='2023-11-30 00:00:00' LIMIT 0, 1
[2024-03-13 15:48:54] 1 row retrieved starting from 1 in 35 ms (execution: 5 ms, fetching: 30 ms)
1 回复

table 定义

create table xws_term_scan_history_LL_V2_XLS_record
(
    uuid          varchar(32)             not null comment '主键'
        primary key,
    dealerId      int(32)                 null,
    type          varchar(128)            null,
    succ          tinyint(1)              null,
    scanDate      datetime                null,
    remarkOp      varchar(128)            null,
    opBy          varchar(32)             null comment '创建人ID',
    opAt          timestamp               null comment '创建时间',
    lastUpdatedAt timestamp               null,
    opByDesc      varchar(200)            null comment '创建人',
    delFlag       mediumint(16) default 0 null comment '删除标记'
)
添加回复
请先登陆
回到顶部