select s.*,to_date(s.sxcu1m02,'yyyy/mm/dd'),to_date(s.sxcu1m26,'yyyy/mm/dd'),to_date(s.sxcu1m27,'yyyy/mm/dd'),d.name,e.cnname from sxcu1m s,yc_dx_department d,yc_dx_employees e where s.sxcu1m05=d.code(+) and s.sxcu1m06=e.code(+) and 1=1 ${if (len(建档人员)==0,"","and sxcu1m03='"+建档人员+"'")} ${if (len(使用部门)==0,"","and sxcu1m05='"+使用部门+"'")} ${if (len(保管人)==0,"","and sxcu1m06='"+保管人+"'")} ${if (len(电脑名称)==0,"","and sxcu1m01='"+电脑名称+"'")} ${if (len(耐用年)==0,"","and sxcu1m24='"+耐用年+"'")} --${if (len(耐用年)==0,"","and cnname='"+耐用年+"'")} --${if (len(建档日期)==0,"","and s.sxcu1m02>='"+建档日期+"'")} AND sxcu1m04 >=to_date('${建档日期}','yyyy/MM/dd') and sxcu1m26 >=to_char('${起算日}','yyyy/MM/dd') and sxcu1m27 >=to_char('${耐用年限}','yyyy/MM/dd') --${if (len(起算日)==0,"","and s.sxcu1m26>='"+起算日+"'")} --and --to_date(s.sxcu1m02,'yyyy/mm/dd') >=to_date('${建档日期}','yyyy/mm/dd') --and 1=1 and to_date(s.sxcu1m26,'yyyy/mm/dd')>=to_date('${起算日}','yyyy/mm/dd') ----to_date(s.sxcu1m27,'yyyy/mm/dd')>=to_date('${耐用年限}','yyyy/mm/dd') and ----to_date(s.sxcu1m02,'yyyy/mm/dd')>=to_date('${建档日期}','yyyy/mm/dd') order by s.sxcu1m04 日期查询不起作用,加上这几个,一条数据都查不出来 其中sxcu1m04是日期类型,其他的都是字符串类型的 |