在DL/SQL可以运行,但是加了时间控件后搜不到数据,SALE_TIME字段是nverchar2类型SQL如下:SELECT r.DEALER_CODE,r.DEALER_NAME,d.SKU_ID,d.SKU_NAME,DECODE(s.SALESTATUS,'1','商务审核','2','备货','3','发货中','4','部分到货','5','全部到货','6','订单取消','7','商务拒绝','8','已评价') SALESTATUS,to_char(TO_DATE(s.SALE_TIME,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm')MONTH,to_char(TO_DATE(s.SALE_TIME,'yyyy-mm-dd hh24:mi:ss'),'dd')DAY,d.TRANSFER_PRICE,d.SALES_PRICEFROM b2bs_salesorder_detail dLEFT JOIN b2bs_salesorder sON s.SALESORDER_ID=d.SALESORDER_IDLEFT JOIN b2bs_dealer rON r.DEALER_ID=s.DEALER_IDwhere 1=1 and s.SALE_TIME>='${开始日期}' and s.SALE_TIME<'${结束日期}'${if(len(经销商)==0,"","and r.DEALER_NAME='" + 经销商 + "'")} ${if(len(状态)==0,"","and SALESTATUS='" + 状态 + "'")}