如何通过车货总重控件传入的值查出整个sql,并且在赋值到表单里面

还需要一个时间控件 和车货总重 textEditor0_c 名字为

select bb.ENFORCEUNIT,count(bb.pid) as num ,sum(bb.totalWeightGoods) as totalWeightGoods ,sum(bb.aftertotalMass) as aftertotalMass

from  bwsn_basicinfo bb

left join s_project sp on bb.pid =sp.id

left join s_unit su on bb.enforceUnitId =su.id

where (sp.status !='撤销' or sp.status is null) and caseType='联合治超'  

and  su.CATALOGROUTE like '%${pid}%'

GROUP BY bb.enforceUnitId,bb.ENFORCEUNIT 

HAVING sum(bb.totalWeightGoods)>="${textEditor0_c}" 

image.png

FineReport sw0414 发布于 2021-4-29 18:22 (编辑于 2021-4-29 18:23)
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
0
axingLv6专家互助
发布于2021-4-29 18:27

select bb.ENFORCEUNIT,count(bb.pid) as num ,sum(bb.totalWeightGoods) as totalWeightGoods ,sum(bb.aftertotalMass) as aftertotalMass

from  bwsn_basicinfo bb

left join s_project sp on bb.pid =sp.id

left join s_unit su on bb.enforceUnitId =su.id

where (sp.status !='撤销' or sp.status is null) and caseType='联合治超'  

and  su.CATALOGROUTE like '%${pid}%'

and 时间字段 between '${dateStart_c}' and '${dateEnd_c}'

GROUP BY bb.enforceUnitId,bb.ENFORCEUNIT 

HAVING sum(bb.totalWeightGoods)>='${textEditor0_c}'

sql的字符串要用单引号,不能用双引号,还有一个时间字段帮你加了进来,改成你的实际字段名就好了

image.png

  • 2关注人数
  • 315浏览人数
  • 最后回答于:2021-4-29 18:27
    请选择关闭问题的原因
    确定 取消
    返回顶部