Beispiel #1
0
  // 员工管理
  @Override
  public List<Object[]> ygglfindygglByCondition(Employee Employee, Integer start, Integer limit) {
    String strHql =
        "select t.employee_id,t.yggl_djrq ,t.employee_no,t.yggl_rybhbj,t.employee_name,t.yggl_ywxm,t1.organization_id,t1.organization_no,t1.organization_name, t2.xbsd_id,t2.xbsd_bh,t2.xbsd_mc ,t.yggl_sfzh,t3.jzzt_id,t3.jzzt_bh,t3.jzzt_mc,t.yggl_csrq,t4.hyzk_id,t4.hyzk_bh,t4.hyzk_mc,t5.xxsd_id,t5.xxsd_bh, t5.xxsd_mc ,t6.jgsd_id,t6.jgsd_bh,t6.jgsd_mc ,t7.gjsd_id,t7.gjsd_bh,t7.gjsd_mc ,t8.mzsd_id,t8.mzsd_bh,t8.mzsd_mc, t9.sdzw_id,t9.sdzw_bh,t9.sdzw_mc, t10.xsl_id,t10.xsl_bh,t10.xsl_mc,t.yggl_zzmm,t.yggl_rzrq,t.yggl_zzrq,t.yggl_syqc,t.yggl_lzrq,t11.jszc_id,t11.jszc_bh,t11.jszc_mc,t12.sdgw_id,t12.sdgw_bh, t12.sdgw_mc,t.yggl_dzyj,t.yggl_hjdh,t.yggl_hjyb,t.yggl_hjdz,t.yggl_jtdh,t.yggl_jtyb,t.yggl_jtzz,t.yggl_xdh,t.yggl_xyb,t.yggl_xzz,t.yggl_jjlxr, t.yggl_jjlxyb,t.yggl_jjlxdh,t.yggl_jjlxrdz,t13.xlsd_id,t13.xlsd_bh,t13.xlsd_mc ,t.yggl_xw,t.yggl_byyx,t.yggl_sxzy,t.yggl_wysp,t.yggl_tjrq,t.yggl_dqrq,  t.yggl_rjrq,t.yggl_hzhm,t.yggl_htqs,t.yggl_htjs,t.yggl_htqc,t.yggl_gzfa,t.yggl_jbxz,t.yggl_fxfs,t.yggl_yhkh,t.yggl_sdsksfs,t.yggl_bz  "
            + "from T_EMPLOYEE t ,t_organization t1 ,t_xbsd t2 ,t_jzzt t3 ,t_hyzk t4 , t_xxsd t5 ,t_jgsd t6 ,t_gjsd t7 ,t_mzsd t8 ,t_sdzw t9,  t_xsl t10 ,t_jszc t11 ,t_sdgw t12 ,t_xlsd  t13 where t.organization_id=t1.organization_id and  t.xbsd_id =t2.xbsd_id and   t.xbsd_id=t2.xbsd_id and  t.jzzt_id =t3.jzzt_id and t.hyzk_id=t4.hyzk_id and t.xxsd_id=t5.xxsd_id and  t.jgsd_id=t6.jgsd_id   and t.gjsd_id=t7.gjsd_id  and  t.mzsd_id=t8.mzsd_id and  t.sdzw_id=t9.sdzw_id and  t.xsl_id=t10.xsl_id and t.jszc_id=t11.jszc_id  and  t.sdgw_id=t12.sdgw_id and  t.xlsd_id =t13.xlsd_id";
    // 人员姓名
    if (null != Employee.getEmployeeName() && !"".equals(Employee.getEmployeeName().trim())) {
      strHql += " and t.employee_name LIKE('%" + Employee.getEmployeeName().trim() + "%')";
    }
    // 所属部门
    if (null != Employee.getYgglbz() && !"".equals(Employee.getYgglbz())) {
      strHql += " and t1.organization_name LIKE('%" + Employee.getYgglbz() + "%')";
    }
    if (SearchUntil.search_strHql != null) {
      strHql += SearchUntil.search_strHql;
      SearchUntil.search_strHql = "";
    }

    strHql += "  ORDER BY t.employee_id  desc";
    Query query = entityManager.createNativeQuery(strHql);

    if (null != start && null != limit) {
      if (0 == start) start = 1;
      query.setFirstResult((start.intValue() - 1) * limit);
      query.setMaxResults(limit.intValue());
    }
    List<Object[]> lstO = query.getResultList();
    return lstO;
  }
Beispiel #2
0
 @Override
 public Long countygglByCondition(Employee Employee) {
   String strHql =
       "select count(t.employee_id)  from T_employee t ,t_organization t1 ,t_xbsd t2 ,t_jzzt t3 ,t_hyzk t4 , t_xxsd t5 ,t_jgsd t6 ,t_gjsd t7 ,t_mzsd t8 ,t_sdzw t9,  t_xsl t10 ,t_jszc t11 ,t_sdgw t12 ,t_xlsd  t13 where t.organization_id=t1.organization_id and  t.xbsd_id =t2.xbsd_id and   t.xbsd_id=t2.xbsd_id and  t.jzzt_id =t3.jzzt_id and t.hyzk_id=t4.hyzk_id and t.xxsd_id=t5.xxsd_id and  t.jgsd_id=t6.jgsd_id   and t.gjsd_id=t7.gjsd_id  and  t.mzsd_id=t8.mzsd_id and  t.sdzw_id=t9.sdzw_id and  t.xsl_id=t10.xsl_id and t.jszc_id=t11.jszc_id  and  t.sdgw_id=t12.sdgw_id and  t.xlsd_id =t13.xlsd_id";
   // 人员姓名
   if (null != Employee.getEmployeeName() && !"".equals(Employee.getEmployeeName().trim())) {
     strHql += " and t.employee_name LIKE('%" + Employee.getEmployeeName().trim() + "%')";
   }
   // 所属部门
   if (null != Employee.getYgglbz() && !"".equals(Employee.getYgglbz())) {
     strHql += " and t1.organization_name LIKE('%" + Employee.getYgglbz() + "%')";
   }
   strHql += "  ";
   Query query = entityManager.createNativeQuery(strHql);
   return Long.parseLong(query.getSingleResult().toString());
 }