Open zouhuigang opened 5 years ago
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 FROM order where is_delete=0 {% if id>0 %} and id=?id {% endif %}
status
order