你这两个表不一致啦!
from  PublicAbroadInfo  
from intg_abroad 

解决方案 »

  1.   

    你这两个表不一致啦! 
    from  PublicAbroadInfo  
    from intg_abroad 
      

  2.   

      
                      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());  
      

  3.   

    楼主要搞清楚hibernate操作的是对象