1,按时间段查询 issueDate ( 起始日期) issueTwoDate (结束日期)
if (StringUtils.isNotEmpty(issueDate) && StringUtils.isNotEmpty(issueTwoDate)){ sql.append(" and to_date(to_char(s.issueDate,'yyyy-mm-dd'),'yyyy-mm-dd') >= to_date(:issueDate,'yyyy-mm-dd') "); params.put("issueDate",issueDate); sql.append(" and to_date(to_char(s.issueDate,'yyyy-mm-dd') <= to_date(:issueTwoDate,'yyyy-mm-dd') "); params.put("issueTwoDate",issueTwoDate); }else{ if(StringUtils.isNotEmpty(issueDate)){ sql.append(" and to_char(s.issueDate,'yyyy-mm-dd') = to_char(to_date(:issueDate,'yyyy-mm-dd') "); params.put("issueDate",issueDate); } if(StringUtils.isNotEmpty(issueTwoDate)){ sql.append(" and to_char(s.issueDate,'yyyy-mm-dd') = to_char(to_date(:issueTwoDate,'yyyy-mm-dd') "); params.put("issueTwoDate",issueTwoDate); } }