如下代码可实现按日、月、年查询,如何增加同时按cyks字段查询?求问,注:cyks使用下拉复选框可多选。 select top 100 * from CSZX_SYJBK where 1=1 ${ if( type_name="日", "and cyrq>='"+sj1+"' and cyrq<='"+sj2+"'", if(type_name="月", " and SUBSTRING(cyrq,1,7)>='"+m_1+"' and SUBSTRING(cyrq,1,7)<='"+m_2+"'", " and SUBSTRING(cyrq,1,4)>='"+y_1+"' and SUBSTRING(cyrq,1,4)<='"+y_2+"'" ) ) } |