2019-11-02 14:48
@JFinal 可以了,我把动态sql模板贴出来
#sql("getPetCommunity")
select * from p_pet_community
#for(x : cond)
#(for.first ? "where": "and")
#for(y : x.value)
#(for.first ? "(": ",")#para(y.value)
#end
)
#end
#end
可以实现
select * from p_pet_community
where bodySize in ("小型犬" ,"大型犬")
and type in ('狩猎犬','家庭犬')
这种sql的动态传参
2019-11-01 19:18
Sql: select * from p_pet_community
where type=?
JFinal action report -------- 2019-11-01 19:17:56 ------------------------------
Url : POST /api/wx/pet/getPetCommunity
Controller : com.superpet.weixin.api.pet.PetController.(PetController.java:1)
Method : getPetCommunity
Parameter : type='狩猎犬'or'家庭犬' accessToken=kF4vFUGHz5CvOGwxiyFeLoWZe5wM-YtPXrxo4v5H0vek7HSYNhUQKmatonJlzZH4
--------------------------------------------------------------------------------
2019-11-01 19:13
@JFinal 先这样单个参数调试哈:只传一个type
#sql("getPetCommunity1")
select * from p_pet_community
where type=#para(0)
#end