添加两个控件‘年’‘月’ 只选年筛选的是整年数据,选‘月’对应第一个‘年’控件的月份,这样的SQL怎么写啊,现在的问题是选月的时候怎么关联‘年’控件
select * from 表名称
where 1=1
${if(len(year_code)=0,"","and 年字段 ='"+ year_code + "'")}
${if(len(month_code)=0,"","and 月字段 ='"+ month_code + "'")}
参考这个看看
动态切换年月日查询报表-https://help.fanruan.com/finereport/doc-view-408.html