主题:变量未定义(VAR_NOT_DEFINED)

facer 2019年09月09日 31

List<YouqiangStationPojo> gasData = youqiangstationmapper.selectGasPrice(stationId);


报错

>>11:46:54:变量未定义(VAR_NOT_DEFINED):stationId 位于45行 资源:youqiangstationentity.selectGa 45|     select p.stationId,p.youqiangId,p.gasType,b.price from youqiangstationentity p,gasstationentity b where p.stationId=b.stationId and p.gasType=b.gasType and  p.stationId = #stationId# 46| 47| 2019-09-09 11:46:54,067 ERROR a.h.b.c.RequestHandlerProxy@[XNIO-1 task-16] - Server error encountered on handling request: [POST][表情]/unifiedOrder org.beetl.sql.core.BeetlSQLException: SQL Script Error:>>11:46:54:变量未定义(VAR_NOT_DEFINED):stationId 位于45行 资源:youqiangstationentity.selectGa         at org.beetl.sql.core.engine.BeetlSQLTemplateExceptionHandler.processExcption(BeetlSQLTemplateExceptionHandler.java:79)         at org.beetl.core.Template.renderTo(Template.java:170)         at org.beetl.core.Template.renderTo(Template.java:91)         at org.beetl.core.Template.render(Template.java:79)         at org.beetl.sql.core.SQLScript.run(SQLScript.java:88)         at org.beetl.sql.core.SQLScript.run(SQLScript.java:64)         at org.beetl.sql.core.SQLScript.select(SQLScript.java:324)

md文件:

sample===* 注释

   select #use("cols")# from youqiangstationentity  where  #use("condition")#

cols===   id,created,enabled,modified,stationId,youqiangId,gasTypeupdateSample===      id=#id#,created=#created#,enabled=#enabled#,modified=#modified#,stationId=#stationId#,youqiangId=#youqiangId#,gasType=#gasType#condition===   1 = 1     @if(!isEmpty(id)){    and id=#id#   @}   @if(!isEmpty(created)){    and created=#created#   @}   @if(!isEmpty(enabled)){    and enabled=#enabled#   @}   @if(!isEmpty(modified)){    and modified=#modified#   @}   @if(!isEmpty(stationId)){    and stationId=#stationId#   @}   @if(!isEmpty(youqiangId)){    and youqiangId=#youqiangId#   @}   @if(!isEmpty(gasType)){    and gasType=#gasType#   @}      selectGasPrice
===    
   select p.stationId,p.youqiangId,p.gasType,b.price from youqiangstationentity p,gasstationentity b where p.stationId=b.stationId and p.gasType=b.gasType and  p.stationId = #stationId#  
   
   
闲大赋 3天前

jdk8启用parameter参数或者使用@Param 注解