|
最佳回答 |
0
|
CD20160914Lv8专家互助发布于2023-2-1 16:38
|
where 1=1 ${if(typedate="0"," and left(d.end_date,10) >='"+ P1 +"'"+" and left(d.end_date,10)<='"+ P2+"'", if(typedate="1"," and left(a.submit_date,10)>='"+ P3+"'"+" and left(a.submit_date,10)<='"+ P4+"'",""))}
|
|
|
|
最佳回答 |
0
|
luojian0323Lv7资深互助发布于2023-2-1 16:36(编辑于 2023-2-1 16:37)
|
看下是不是数据类型等号两边不匹配 把参数值带入,直接执行后半句过滤条件试试。
|
|
|
|
最佳回答 |
0
|
胖哒哒君Lv5见习互助发布于2023-2-1 16:41
|
where 1=1 ${if(typedate="0"," and left(d.end_date,10) >='"+ P1 +"' and left(d.end_date,10)<='"+ P2+"'", if(typedate="1"," and left(a.submit_date,10)>='"+ P3 +"' and left(a.submit_date,10)<='"+ P4+"'",""))}
|
|
|
|
最佳回答 |
0
|
其实我是宁采臣Lv4见习互助发布于2023-2-1 17:16
|
|
|
|
|
最佳回答 |
0
|
ln2481Lv5初级互助发布于2023-2-1 17:30
|
|
|
|
|
最佳回答 |
0
|
ln2481Lv5初级互助发布于2023-2-1 17:31
|
第二个IF缺少else的情况 where 1=1 ${if(typedate=="0"," and left(d.end_date,10) >='"+ P1 +"'"+" and left(d.end_date,10)<='"+ P2+"'", if(typedate=="1"," and left(a.submit_date,10)>='"+ P3+"'"+" and left(a.submit_date,10)<='"+ P4+"'","") )}
|
|
|