开发者社区> 问答> 正文

被这句话吓到了,怎么理解这段代码? 400 报错

被这句话吓到了,怎么理解这段代码? 400 报错 public DataPackage<Template> getUntransmitTemplates(int pageNo, int pageSize)
throws Exception {
StringBuffer hql = new StringBuffer("FROM Template t where status_Id=");
hql.append(Constant.FlowStatus.Audited.getValue());
hql.append(" and transmitState in(").append(
Constant.TransmitState.Untransmit.getValue());
hql.append(",").append(Constant.TransmitState.Fault.getValue()).append(
")");
hql.append(" and transmitFaultTime<").append(Constant.FAULT_TIME);
// 默认失败次数小于3,需要优化
hql.append(" and state=" + Constant.VALID + " order by templateId");
return queryPagination(hql.toString(), pageNo, pageSize);
}

展开
收起
爱吃鱼的程序员 2020-06-01 11:22:12 499 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    LZ淡定,菜鸟拼拼sql而已.######

    本不想回答,忍不住要回答

    字符串拼接很正常

    ######回复 @thomas2 : select * from template t where status_id = ? and transmitState in ("?,?") and transmitFaultTime < ? and state = ? order by templateId######我之前的公司不会这样拼接,字符串的,怎么还原正常的sql
    2020-06-01 11:22:14
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
《0代码搭应用》 立即下载
不止代码 立即下载
低代码开发师(初级)实战教程 立即下载