在mybatisplus 中查到数据,复制到MySQL中却查不到 我怀疑是 mybatisplus 的bug
版本是
MPJLambdaWrapper<BroadcastSchedule> wrapper = new MPJLambdaWrapper();
wrapper.nested(qw -> qw.eq(BroadcastSchedule::getIsDel,0));
wrapper.nested(qw ->qw.eq(BroadcastSchedule::getWorkplace,broadcastSchedule.getWorkplace()));
if(broadcastSchedule.getId()!=null && !broadcastSchedule.getId().isEmpty()){
wrapper.nested(qw->qw.ne(BroadcastSchedule::getId,broadcastSchedule.getId()));
}
wrapper.nested(qw -> qw.between(BroadcastSchedule::getRecordingTime,broadcastSchedule.getRecordingTime(),broadcastSchedule.getEndTime())
.and(qw2 -> qw2.le(BroadcastSchedule::getEndTime,broadcastSchedule.getEndTime()))
);
if (broadcastSchedule.getSceneryTime()!=null && !broadcastSchedule.getSceneryTime().equals("")){
wrapper.or(qw -> qw.between(BroadcastSchedule::getSceneryTime,broadcastSchedule.getSceneryTime(),broadcastSchedule.getEndTime())
.and(qw2 -> qw2.le(BroadcastSchedule::getEndTime,broadcastSchedule.getEndTime())));
}
if (broadcastSchedule.getRehearsalTime()!=null && !broadcastSchedule.getRehearsalTime().equals("")){
wrapper.or(qw -> qw.between(BroadcastSchedule::getRehearsalTime,broadcastSchedule.getRehearsalTime(),broadcastSchedule.getEndTime())
.and(qw2 -> qw2.le(BroadcastSchedule::getEndTime,broadcastSchedule.getEndTime())));
}
if(broadcastSchedule.getDressRehearsalTime()!=null && !broadcastSchedule.getDressRehearsalTime().equals("")){
wrapper.or(qw -> qw.between(BroadcastSchedule::getDressRehearsalTime,broadcastSchedule.getDressRehearsalTime(),broadcastSchedule.getEndTime())
.and(qw2 -> qw2.le(BroadcastSchedule::getEndTime,broadcastSchedule.getEndTime())));
}
List<BroadcastSchedule> broadcastSchedules = broadcastScheduleDao.selectJoinList(BroadcastSchedule.class, wrapper);
if(broadcastSchedules.size()!=0){
return true;
}
return false;
它生成的sql语句和查询数据
、

1是sql语句
2是参数
3是字段
4是数据
我把它复制出来替换参数,然后放到 数据库里面执行,查不到数据,理论上查不到才是正确的
SELECT
t.id,
t.department_id,
t.program_name,
t.contact_phone,
t.contact_name,
t.production_form,
t.tv_platform,
t.online_platform,
t.workplace,
t.workplace_name,
t.second_workplace,
t.departure_time,
t.scenery_time,
t.recording_time,
t.rehearsal_time,
t.end_time,
t.dress_rehearsal_time,
t.vehicle_used,
t.recording_format,
t.equipment,
t.communication_channels,
t.review_status,
t.applicant_user_id,
t.broadcast_platform,
t.SECURITY,
t.signalling_mode,
t.attendances,
t.json_expands,
t.created_at,
t.updated_at,
t.is_del,
t1.department_id AS joina_department_id,
t1.department_name,
t1.created_at AS joina_created_at,
t1.updated_at AS joina_updated_at,
t2.user_id,
t2.username,
t2.PASSWORD,
t2.phone,
t2.department_id AS joinb_department_id,
t2.role_id,
t2.created_at AS joinb_created_at,
t2.updated_at AS joinb_updated_at,
t3.id AS joina_id,
t3.location_name,
t3.color,
t3.remake1,
t3.remake2,
t3.remake3,
t3.remake4,
t3.remake5,
t3.created_at AS joinc_created_at,
t3.updated_at AS joinc_updated_at
FROM
broadcast_schedule t
LEFT JOIN departments t1 ON ( t1.department_id = t.department_id )
LEFT JOIN users t2 ON ( t2.user_id = t.applicant_user_id )
LEFT JOIN workplace t3 ON ( t3.id = t.workplace )
WHERE
((
t.is_del = 0
)
AND ( t.workplace = '20231128134155629' )
AND ( t.id <> '20240524151327449' ) --这里已经排除了当前id,是查不到的
AND (
t.recording_time BETWEEN '2024-07-01 18:30:00.0'
AND '2024-07-01 19:00:00.0'
AND ( t.end_time <= '2024-07-01 19:00:00.0' ))
OR (
t.scenery_time BETWEEN '2024-07-01 16:00:00.0'
AND '2024-07-01 19:00:00.0'
AND ( t.end_time <= '2024-07-01 19:00:00.0' ))
OR (
t.rehearsal_time BETWEEN '2024-07-01 17:00:00.0'
AND '2024-07-01 19:00:00.0'
AND ( t.end_time <= ' 2024-07-01 19:00:00.0' ))
OR (
t.dress_rehearsal_time BETWEEN '2024-07-01 18:00:00.0'
AND '2024-07-01 19:00:00.0'
AND ( t.end_time <= '2024-07-01 19:00:00.0' )))