sqlite
select * from message where flag=0 or ( (dealno=6 or (removeno in (select removeno from message where removedate >= ‘2017-12-25 09:00:00‘ )) ) and ( (senddate >= ‘2017-12-25 09:00:00‘ or dealdate >= ‘2017-12-25 09:00:00‘ or removedate >= ‘2017-12-25 09:00:00‘ ) and senddate <=‘2017-12-25 24:00:00‘ ) ) order by senddate
mybatis
select * from message where flag=0 or ((dealno=#{dealno} or (removeno in (select removeno from message where removedate >= #{removedate}))) and ((senddate >= #{senddate} or dealdate >= #{dealdate} or removedate >= #{removedate}) and senddate <=#{senddate2})) order by senddate
注意点:
1.时间
2.mybatis映射文件参数和字段要一一对应,可以采取赋值转变