关于自定义SQL中的变量赋值
最后更新:2023-10-18 20:51:44
|
状态:未完成
String sql = "SELECT * FROM CRM_USER WHERE CODE = :PARAM_CODE";
DataSet set = service.querys(sql, "PARAM_CODE:1");
//生成SQL SELECT * FROM CRM_USER WHERE CODE = 1
//特别注意这以下情况 CODE:1与SQL中的变量匹配不成功时,SQL会追加一个条件 WHERE CODE = 1
sql = "SELECT * FROM CRM_USER WHERE CODE = :PARAM_CODE";
set = service.querys(sql, "PARAM_CODE:1", "CODE:1");
//生成SQL SELECT * FROM CRM_USER WHERE CODE = 1 AND CODE = 1