xorm
xorm copied to clipboard
请教下使用批量sql,为什么一直报Params type error错误?参数不是这样传的嘛?
sql := "select.order.stpl"
parmas := map[string]interface{}{"id": 1}
results, _, err := tx.Session().SqlTemplatesClient(sql, &parmas).Execute()
if err != nil {
fmt.Println(err)
tx.RollbackTrans()
return
}
请提供下你的SqlTemplates文件看看
select.order.stpl
SELECT id,doctor_user_id,patient_user_id,accompanist_user_id,amount,
status
FROMorder
where is_delete=0 {% if id>0 %} and id=?id {% endif %}