HQL与SQL查询条数不一致问题 你这两个表不一致啦!from PublicAbroadInfo from intg_abroad 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你这两个表不一致啦! from PublicAbroadInfo from intg_abroad String hsql=" from ServiceInstanceVO a,ServiceInstancePrintVO b where (1=1)"; StringBuffer buffer = new StringBuffer(hsql); if(vol.getService_orgId()!=0) buffer.append(" and a.service_orgId=?"); // 部门 if(vol.getService_userId()!=0) buffer.append(" and a.service_userId=?"); // 受理人 if(vol.getService_name()!=null && vol.getService_name().trim().length()!=0) buffer.append(" and a.service_name like ?"); // 事项名称 if(vol.getService_number()!=null && vol.getService_number().trim().length()!=0) buffer.append(" and a.service_number like ?"); // 事项号 if(vol.getService_instNumber()!=null && vol.getService_instNumber().trim().length()!=0) buffer.append(" and a.service_instNumber like ?"); // 办件号 if(vol.getService_declarerName()!=null && vol.getService_declarerName().trim().length()!=0) buffer.append(" and a.service_declarerName like ?"); // 申请人 if(vo.getService_instPT()!=null) buffer.append(" and b.service_instPT>=?"); //打印时间开始 if(vo.getService_instPTVO()!=null) buffer.append(" and b.service_instPT<=?"); //打印时间结束 buffer.append(" and a.id=b.service_InstanceId"); buffer.append(" and service_state!=?"); // buffer.append(" order by b.service_instPT desc"); // Query query = arg0.createQuery(buffer.toString()); // Query query=arg0.createQuery(hsql); int index=0; if(vol.getService_orgId()!=0) query.setInteger(index++, vol.getService_orgId()); if(vol.getService_userId()!=0) query.setInteger(index++, vol.getService_userId()); if(vol.getService_name()!=null && vol.getService_name().trim().length()!=0) query.setString(index++, "%"+vol.getService_name()+"%"); if(vol.getService_number()!=null && vol.getService_number().trim().length()!=0) query.setString(index++, "%"+vol.getService_number()+"%"); if(vol.getService_instNumber()!=null && vol.getService_instNumber().trim().length()!=0) query.setString(index++, vol.getService_instNumber()); if(vol.getService_declarerName()!=null && vol.getService_declarerName().trim().length()!=0) query.setString(index++, "%"+vol.getService_declarerName()+"%"); if(vo.getService_instPT()!=null) query.setTimestamp(index++, vo.getService_instPT()); if(vo.getService_instPTVO()!=null) query.setTimestamp(index++, vo.getService_instPTVO()); 楼主要搞清楚hibernate操作的是对象 19G的文本文件如何打开?各位大侠支支招,多谢了 jsp发送的请求 为何servlet没有处理 3DES加密字符串,参数不变,为什么经过程序后每次加密后的值都不同呢? 只想求个弹出窗口,难道没人会? castor、xsd生成序列化java,为什么会生成出extends本类??? 根据条件判断checkbox提交下拉列表框数据 JSP 的问题(在线等) JSP下拉框联动如何实现 急聘!Java开发工程师(天津) 求助hibreanate的MANY TO MANY怎么级联保存啊。???? 在eclipse中运行tomact不这样的提示,不知道是什么原因 求助!!!!!
from PublicAbroadInfo
from intg_abroad
String hsql=" from ServiceInstanceVO a,ServiceInstancePrintVO b where (1=1)";
StringBuffer buffer = new StringBuffer(hsql);
if(vol.getService_orgId()!=0) buffer.append(" and a.service_orgId=?"); // 部门
if(vol.getService_userId()!=0) buffer.append(" and a.service_userId=?"); // 受理人
if(vol.getService_name()!=null && vol.getService_name().trim().length()!=0) buffer.append(" and a.service_name like ?"); // 事项名称
if(vol.getService_number()!=null && vol.getService_number().trim().length()!=0) buffer.append(" and a.service_number like ?"); // 事项号
if(vol.getService_instNumber()!=null && vol.getService_instNumber().trim().length()!=0) buffer.append(" and a.service_instNumber like ?"); // 办件号
if(vol.getService_declarerName()!=null && vol.getService_declarerName().trim().length()!=0) buffer.append(" and a.service_declarerName like ?"); // 申请人
if(vo.getService_instPT()!=null) buffer.append(" and b.service_instPT>=?"); //打印时间开始
if(vo.getService_instPTVO()!=null) buffer.append(" and b.service_instPT<=?"); //打印时间结束
buffer.append(" and a.id=b.service_InstanceId");
buffer.append(" and service_state!=?"); //
buffer.append(" order by b.service_instPT desc"); // Query query = arg0.createQuery(buffer.toString());
// Query query=arg0.createQuery(hsql);
int index=0;
if(vol.getService_orgId()!=0) query.setInteger(index++, vol.getService_orgId());
if(vol.getService_userId()!=0) query.setInteger(index++, vol.getService_userId());
if(vol.getService_name()!=null && vol.getService_name().trim().length()!=0) query.setString(index++, "%"+vol.getService_name()+"%");
if(vol.getService_number()!=null && vol.getService_number().trim().length()!=0) query.setString(index++, "%"+vol.getService_number()+"%");
if(vol.getService_instNumber()!=null && vol.getService_instNumber().trim().length()!=0) query.setString(index++, vol.getService_instNumber());
if(vol.getService_declarerName()!=null && vol.getService_declarerName().trim().length()!=0) query.setString(index++, "%"+vol.getService_declarerName()+"%");
if(vo.getService_instPT()!=null) query.setTimestamp(index++, vo.getService_instPT());
if(vo.getService_instPTVO()!=null) query.setTimestamp(index++, vo.getService_instPTVO());