/* 60: */ /* 61: */ public QueryResult<Personnel> getPersonnelInquiry( String firstName, String lastName, String personCode, String nationalCode, String jobTitle, String approvedPostTitle, String approvedOrganizationStructureTitle, Integer degreeId, Integer positionId, SearchOption searchOption) /* 62: */ { /* 63: 66 */ Map<String, Object> param = new HashMap(); /* 64: 67 */ List<RowFilter> filters = new ArrayList(); /* 65: */ /* 66: 69 */ RowFilter filterPower = new RowFilter(); /* 67: 70 */ filterPower.setFilterName("orgStructureAuthorize"); /* 68: 71 */ param.put("userId", SecurityUtility.getAuthenticatedUserId()); /* 69: 72 */ filterPower.setFilterValues(param); /* 70: 73 */ filters.add(filterPower); /* 71: */ /* 72: 75 */ RowFilter filterDegree = new RowFilter(); /* 73: 76 */ filterDegree.setFilterName("degreeAuthorize"); /* 74: 77 */ param.put("userId", SecurityUtility.getAuthenticatedUserId()); /* 75: 78 */ filterDegree.setFilterValues(param); /* 76: 79 */ filters.add(filterDegree); /* 77: */ /* 78: 81 */ RowFilter filterPosition = new RowFilter(); /* 79: 82 */ filterPosition.setFilterName("positionAuthorize"); /* 80: 83 */ param.put("userId", SecurityUtility.getAuthenticatedUserId()); /* 81: 84 */ filterPosition.setFilterValues(param); /* 82: 85 */ filters.add(filterPosition); /* 83: */ /* 84: 87 */ String hql = "from " + this.domainClass.getName() + " e where 1<>2 "; /* 85: 88 */ HashMap<String, Object> params = new HashMap(); /* 86: 90 */ if ((firstName != null) && (!firstName.trim().isEmpty())) /* 87: */ { /* 88: 91 */ hql = hql + " and e.person.firstName like :firstName"; /* 89: 92 */ params.put("firstName", "%" + firstName + "%"); /* 90: */ } /* 91: 94 */ if ((lastName != null) && (!lastName.trim().isEmpty())) /* 92: */ { /* 93: 95 */ hql = hql + " and e.person.lastName like :lastName"; /* 94: 96 */ params.put("lastName", "%" + lastName + "%"); /* 95: */ } /* 96: 98 */ if ((personCode != null) && (!personCode.trim().isEmpty())) /* 97: */ { /* 98: 99 */ hql = hql + " and e.person.personCode like :personCode"; /* 99:100 */ params.put("personCode", "%" + personCode + "%"); /* 100: */ } /* 101:102 */ if ((nationalCode != null) && (!nationalCode.trim().isEmpty())) /* 102: */ { /* 103:103 */ hql = hql + " and e.person.nationalCode like :nationalCode"; /* 104:104 */ params.put("nationalCode", "%" + nationalCode + "%"); /* 105: */ } /* 106:106 */ if ((jobTitle != null) && (!jobTitle.trim().isEmpty())) /* 107: */ { /* 108:107 */ hql = hql + " and e.job.title like :jobTitle"; /* 109:108 */ params.put("jobTitle", "%" + jobTitle + "%"); /* 110: */ } /* 111:110 */ if ((approvedPostTitle != null) && (!approvedPostTitle.trim().isEmpty())) /* 112: */ { /* 113:111 */ hql = hql + " and e.approvedPost.title like :approvedPostTitle"; /* 114:112 */ params.put("approvedPostTitle", "%" + approvedPostTitle + "%"); /* 115: */ } /* 116:114 */ if ((approvedOrganizationStructureTitle != null) && (!approvedOrganizationStructureTitle.trim().isEmpty())) /* 117: */ { /* 118:115 */ hql = hql + " and e.approvedOrganizationStructure.title like :approvedOrganizationStructureTitle"; /* 119:116 */ params.put( "approvedOrganizationStructureTitle", "%" + approvedOrganizationStructureTitle + "%"); /* 120: */ } /* 121:118 */ if ((degreeId != null) && (degreeId.intValue() > 0)) /* 122: */ { /* 123:119 */ hql = hql + " and e.approvedDegree.id = :degreeId"; /* 124:120 */ params.put("degreeId", degreeId); /* 125: */ } /* 126:122 */ if ((positionId != null) && (positionId.intValue() > 0)) /* 127: */ { /* 128:123 */ hql = hql + " and e.position.id = :positionId"; /* 129:124 */ params.put("positionId", positionId); /* 130: */ } /* 131:126 */ return getAllGrid(hql, params, searchOption, null, filters); /* 132: */ }
/* 133: */ /* 134: */ public QueryResult<PersonnelDto> getPerson( String firstName, String lastName, String personCode, String nationalCode, String jobTitle, String approvedPostTitle, String approvedOrganizationStructureTitle, Integer degreeId, Integer positionId, SearchOption searchOption) /* 135: */ { /* 136:134 */ Map<String, Object> param = new HashMap(); /* 137:135 */ List<RowFilter> filters = new ArrayList(); /* 138: */ /* 139:137 */ RowFilter filterPower = new RowFilter(); /* 140:138 */ filterPower.setFilterName("orgStructureAuthorize"); /* 141:139 */ param.put("userId", SecurityUtility.getAuthenticatedUserId()); /* 142:140 */ filterPower.setFilterValues(param); /* 143:141 */ filters.add(filterPower); /* 144: */ /* 145:143 */ RowFilter filterDegree = new RowFilter(); /* 146:144 */ filterDegree.setFilterName("degreeAuthorize"); /* 147:145 */ param.put("userId", SecurityUtility.getAuthenticatedUserId()); /* 148:146 */ filterDegree.setFilterValues(param); /* 149:147 */ filters.add(filterDegree); /* 150: */ /* 151:149 */ RowFilter filterPosition = new RowFilter(); /* 152:150 */ filterPosition.setFilterName("positionAuthorize"); /* 153:151 */ param.put("userId", SecurityUtility.getAuthenticatedUserId()); /* 154:152 */ filterPosition.setFilterValues(param); /* 155:153 */ filters.add(filterPosition); /* 156: */ /* 157:155 */ String hql = "\tselect \tp.id as id,\t\t\tp.personelImageCode as personImageCode, \t\t\tp.personCode as personCode,\t\t\tp.firstName as firstName, \t\t\tp.lastName as lastName,\t\t\tp.nationalCode as nationalCode, \t\t\taos.code as organizationStructureCode, \t\t\taos.title as organizationStructureTitle, \t\t\tap.code as postCode, \t\t\tap.title as postTitle,\t\t\tpj.code as jobCode, \t\t\tpj.title as jobTitle, \t\t\tad.topic as degreeTopic, \t\t\tpep.topic as positionTopic, \t\t\tcast(p.membershipStatus as integer) as membershipStatus\tfrom Personnel pe \tright outer join pe.person p \tleft join pe.approvedPost ap \tleft join pe.approvedOrganizationStructure aos \tleft join pe.approvedDegree ad \tleft join pe.position pep \tleft join pe.job pj \twhere 1<>2 "; /* 158: */ /* 159: */ /* 160: */ /* 161: */ /* 162: */ /* 163: */ /* 164: */ /* 165: */ /* 166: */ /* 167: */ /* 168: */ /* 169: */ /* 170: */ /* 171: */ /* 172: */ /* 173: */ /* 174: */ /* 175: */ /* 176: */ /* 177: */ /* 178: */ /* 179: */ /* 180: */ /* 181:179 */ HashMap<String, Object> params = new HashMap(); /* 182:181 */ if ((firstName != null) && (!firstName.trim().isEmpty())) /* 183: */ { /* 184:182 */ hql = hql + " and p.firstName like :firstName"; /* 185:183 */ params.put("firstName", "%" + firstName + "%"); /* 186: */ } /* 187:185 */ if ((lastName != null) && (!lastName.trim().isEmpty())) /* 188: */ { /* 189:186 */ hql = hql + " and p.lastName like :lastName"; /* 190:187 */ params.put("lastName", "%" + lastName + "%"); /* 191: */ } /* 192:189 */ if ((personCode != null) && (!personCode.trim().isEmpty())) /* 193: */ { /* 194:190 */ hql = hql + " and p.personCode like :personCode"; /* 195:191 */ params.put("personCode", "%" + personCode + "%"); /* 196: */ } /* 197:193 */ if ((nationalCode != null) && (!nationalCode.trim().isEmpty())) /* 198: */ { /* 199:194 */ hql = hql + " and p.nationalCode like :nationalCode"; /* 200:195 */ params.put("nationalCode", "%" + nationalCode + "%"); /* 201: */ } /* 202:197 */ if ((jobTitle != null) && (!jobTitle.trim().isEmpty())) /* 203: */ { /* 204:198 */ hql = hql + " and pj.title like :jobTitle"; /* 205:199 */ params.put("jobTitle", "%" + jobTitle + "%"); /* 206: */ } /* 207:201 */ if ((approvedPostTitle != null) && (!approvedPostTitle.trim().isEmpty())) /* 208: */ { /* 209:202 */ hql = hql + " and ap.title like :approvedPostTitle"; /* 210:203 */ params.put("approvedPostTitle", "%" + approvedPostTitle + "%"); /* 211: */ } /* 212:205 */ if ((approvedOrganizationStructureTitle != null) && (!approvedOrganizationStructureTitle.trim().isEmpty())) /* 213: */ { /* 214:206 */ hql = hql + " and aos.title like :approvedOrganizationStructureTitle"; /* 215:207 */ params.put( "approvedOrganizationStructureTitle", "%" + approvedOrganizationStructureTitle + "%"); /* 216: */ } /* 217:209 */ if ((degreeId != null) && (degreeId.intValue() > 0)) /* 218: */ { /* 219:210 */ hql = hql + " and ad.id = :degreeId"; /* 220:211 */ params.put("degreeId", degreeId); /* 221: */ } /* 222:213 */ if ((positionId != null) && (positionId.intValue() > 0)) /* 223: */ { /* 224:214 */ hql = hql + " and pep.id = :positionId"; /* 225:215 */ params.put("positionId", positionId); /* 226: */ } /* 227:217 */ return getAllGrid(hql, params, searchOption, PersonnelDto.class, filters); /* 228: */ }