Rev 1569 | Rev 1576 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1574 | jmachado | 1 | package pt.estgp.estgweb.services.questionarios.pedagogico.reportprocessors.queries; |
1567 | jmachado | 2 | |
3 | import jomm.dao.impl.AbstractDao; |
||
4 | import jomm.utils.MyCalendar; |
||
5 | import org.hibernate.Query; |
||
6 | import pt.estgp.estgweb.domain.OlapStarFactQuestionario; |
||
1568 | jmachado | 7 | import pt.estgp.estgweb.services.questionarios.PedagogicoAlunosProcessor; |
1574 | jmachado | 8 | import pt.estgp.estgweb.services.questionarios.pedagogico.reportprocessors.reportsdomain.EntityEvaluated; |
9 | import pt.estgp.estgweb.services.questionarios.pedagogico.reportprocessors.reportsdomain.QuestionariosAlunosReport; |
||
1567 | jmachado | 10 | import pt.estgp.estgweb.utils.DatesUtils; |
11 | |||
12 | import java.util.Calendar; |
||
1569 | jmachado | 13 | import java.util.List; |
1567 | jmachado | 14 | |
15 | /** |
||
16 | * Created by jorgemachado on 07/12/16. |
||
17 | */ |
||
18 | public class AlunosQueryDao |
||
19 | { |
||
1569 | jmachado | 20 | public static void countIdadesAlunosComRespostasAoDocente(1.5.0/docs/api/java/lang/String.html">String teacherCode, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) |
21 | { |
||
22 | countIdadesAlunosComRespostasGen(new 1.5.0/docs/api/java/lang/String.html">String[]{teacherCode},EntityEvaluated.DOCENTE,anoLectivo,docenteReport,periodos,degrees); |
||
23 | } |
||
1567 | jmachado | 24 | |
1569 | jmachado | 25 | public static void countIdadesAlunosComRespostasAoCurso(1.5.0/docs/api/java/lang/String.html">String courseCode, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) |
26 | { |
||
27 | countIdadesAlunosComRespostasGen(new 1.5.0/docs/api/java/lang/String.html">String[]{courseCode},EntityEvaluated.CURSO,anoLectivo,docenteReport,periodos,degrees); |
||
28 | } |
||
29 | public static void countIdadesAlunosComRespostasAoCursos(1.5.0/docs/api/java/lang/String.html">String[] courseCodes, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) |
||
30 | { |
||
31 | countIdadesAlunosComRespostasGen(courseCodes,EntityEvaluated.CURSOS,anoLectivo,docenteReport,periodos,degrees); |
||
32 | } |
||
33 | public static void countIdadesAlunosComRespostasAoCursos(List<String> courseCodes, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) |
||
34 | { |
||
35 | countIdadesAlunosComRespostasGen((1.5.0/docs/api/java/lang/String.html">String[]) courseCodes.toArray(),EntityEvaluated.CURSOS,anoLectivo,docenteReport,periodos,degrees); |
||
36 | } |
||
1567 | jmachado | 37 | |
1569 | jmachado | 38 | public static void countIdadesAlunosComRespostasGen(1.5.0/docs/api/java/lang/String.html">String[] codes,EntityEvaluated entityEvaluated, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport report, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) { |
39 | |||
1567 | jmachado | 40 | 1.5.0/docs/api/java/lang/String.html">String periodosQuery = QueryDaoUtils.createPeriodosQuery(periodos, "quest", true); |
41 | 1.5.0/docs/api/java/lang/String.html">String degreesQuery = QueryDaoUtils.createDegreesQuery(degrees, "curso", true); |
||
42 | 1.5.0/docs/api/javax/management/Query.html">Query query; |
||
43 | |||
1569 | jmachado | 44 | 1.5.0/docs/api/java/lang/String.html">String whereFragmentEntity = QuestionariosQueryDao.getWhereEntityCodesFragment(codes, entityEvaluated); |
45 | |||
1567 | jmachado | 46 | int secondYear = DatesUtils.getSecondFromImportYear(anoLectivo); |
47 | |||
48 | MyCalendar dataQuestionario17 = new MyCalendar(secondYear,9,1); |
||
49 | MyCalendar dataQuestionario22 = new MyCalendar(secondYear,9,1); |
||
50 | MyCalendar dataQuestionario25 = new MyCalendar(secondYear,9,1); |
||
51 | MyCalendar dataQuestionario30 = new MyCalendar(secondYear,9,1); |
||
52 | dataQuestionario17.add(1.5.0/docs/api/java/util/Calendar.html">Calendar.YEAR,-17); |
||
53 | dataQuestionario22.add(1.5.0/docs/api/java/util/Calendar.html">Calendar.YEAR,-22); |
||
54 | dataQuestionario25.add(1.5.0/docs/api/java/util/Calendar.html">Calendar.YEAR,-25); |
||
55 | dataQuestionario30.add(1.5.0/docs/api/java/util/Calendar.html">Calendar.YEAR,-30); |
||
56 | |||
57 | |||
58 | query = AbstractDao.getCurrentSession().createQuery( |
||
59 | "select " + |
||
60 | "count(distinct user.sigesCode) from " + OlapStarFactQuestionario.class.getName() + " fc " + |
||
61 | |||
62 | //"count(distinct case when user.birthDate <= :dateStart and user.birthDate > :dateEnd then user.sigesCode else NULL end) from " + OlapStarFactQuestionario.class.getName() + " fc " + |
||
63 | "JOIN fc.olapQuestionario quest " + |
||
64 | "JOIN fc.olapTipologia tipo " + |
||
65 | "JOIN fc.olapPerfilUser user " + |
||
66 | "JOIN fc.olapCurso curso " + |
||
1568 | jmachado | 67 | "JOIN fc.olapTimeLine timeLine " + |
1567 | jmachado | 68 | "where " + |
1568 | jmachado | 69 | "user.birthDate <= :dateStart " + |
70 | "and user.birthDate > :dateEnd " + |
||
71 | "and quest.ano = :ano " + |
||
1569 | jmachado | 72 | whereFragmentEntity + |
1568 | jmachado | 73 | "and fc.respondido = true " + |
74 | "and timeLine.nome = '" + PedagogicoAlunosProcessor.getHistoryDriveConstraintStatic() + "' " + |
||
1567 | jmachado | 75 | periodosQuery + |
76 | degreesQuery); |
||
77 | query.setDate("dateStart", dataQuestionario17.getTime()); |
||
78 | query.setDate("dateEnd",dataQuestionario22.getTime()); |
||
1569 | jmachado | 79 | //query.setString("codigoSiges",teacherCode); |
1567 | jmachado | 80 | query.setString("ano",anoLectivo); |
1569 | jmachado | 81 | report.idade17_22 = ((1.5.0/docs/api/java/lang/Long.html">Long) query.uniqueResult()).intValue(); |
82 | report.idade17_22Percent = (int)(((float)report.idade17_22) / ((float)report.inquiridosComResposta) * 100.0); |
||
1567 | jmachado | 83 | |
84 | query = AbstractDao.getCurrentSession().createQuery( |
||
85 | "select count(distinct user.sigesCode) from " + OlapStarFactQuestionario.class.getName() + " fc " + |
||
86 | "JOIN fc.olapQuestionario quest " + |
||
87 | "JOIN fc.olapTipologia tipo " + |
||
88 | "JOIN fc.olapPerfilUser user " + |
||
89 | "JOIN fc.olapCurso curso " + |
||
1568 | jmachado | 90 | "JOIN fc.olapTimeLine timeLine " + |
1567 | jmachado | 91 | "where " + |
1568 | jmachado | 92 | "user.birthDate <= :dateStart " + |
93 | "and user.birthDate > :dateEnd " + |
||
1569 | jmachado | 94 | "and quest.ano = :ano " + |
95 | whereFragmentEntity + |
||
96 | "and fc.respondido = true " + |
||
1568 | jmachado | 97 | "and timeLine.nome = '" + PedagogicoAlunosProcessor.getHistoryDriveConstraintStatic() + "' " + |
1567 | jmachado | 98 | periodosQuery + |
99 | degreesQuery); |
||
100 | query.setDate("dateStart",dataQuestionario22.getTime()); |
||
101 | query.setDate("dateEnd",dataQuestionario25.getTime()); |
||
1569 | jmachado | 102 | //query.setString("codigoSiges",teacherCode); |
1567 | jmachado | 103 | query.setString("ano",anoLectivo); |
104 | |||
1569 | jmachado | 105 | report.idade23_25 = ((1.5.0/docs/api/java/lang/Long.html">Long) query.uniqueResult()).intValue(); |
106 | report.idade23_25Percent = (int)(((float)report.idade23_25) / ((float)report.inquiridosComResposta) * 100.0); |
||
1567 | jmachado | 107 | |
108 | |||
109 | query = AbstractDao.getCurrentSession().createQuery( |
||
110 | "select count(distinct user.sigesCode) from " + OlapStarFactQuestionario.class.getName() + " fc " + |
||
111 | "JOIN fc.olapQuestionario quest " + |
||
112 | "JOIN fc.olapTipologia tipo " + |
||
113 | "JOIN fc.olapPerfilUser user " + |
||
114 | "JOIN fc.olapCurso curso " + |
||
1568 | jmachado | 115 | "JOIN fc.olapTimeLine timeLine " + |
1567 | jmachado | 116 | "where " + |
1568 | jmachado | 117 | "user.birthDate <= :dateStart " + |
118 | "and user.birthDate > :dateEnd " + |
||
1569 | jmachado | 119 | "and quest.ano = :ano " + |
120 | whereFragmentEntity + |
||
121 | "and fc.respondido = true " + |
||
1568 | jmachado | 122 | "and timeLine.nome = '" + PedagogicoAlunosProcessor.getHistoryDriveConstraintStatic() + "' " + |
1567 | jmachado | 123 | periodosQuery + |
124 | degreesQuery); |
||
125 | query.setDate("dateStart",dataQuestionario25.getTime()); |
||
126 | query.setDate("dateEnd",dataQuestionario30.getTime()); |
||
1569 | jmachado | 127 | //query.setString("codigoSiges",teacherCode); |
1567 | jmachado | 128 | query.setString("ano",anoLectivo); |
129 | |||
1569 | jmachado | 130 | report.idade26_30 = ((1.5.0/docs/api/java/lang/Long.html">Long) query.uniqueResult()).intValue(); |
131 | report.idade26_30Percent = (int)(((float)report.idade26_30) / ((float)report.inquiridosComResposta) * 100.0); |
||
1567 | jmachado | 132 | |
133 | |||
134 | query = AbstractDao.getCurrentSession().createQuery( |
||
135 | "select count(distinct user.sigesCode) from " + OlapStarFactQuestionario.class.getName() + " fc " + |
||
136 | "JOIN fc.olapQuestionario quest " + |
||
137 | "JOIN fc.olapTipologia tipo " + |
||
138 | "JOIN fc.olapPerfilUser user " + |
||
139 | "JOIN fc.olapCurso curso " + |
||
1568 | jmachado | 140 | "JOIN fc.olapTimeLine timeLine " + |
1567 | jmachado | 141 | "where " + |
1568 | jmachado | 142 | "user.birthDate <= :dateStart " + |
1569 | jmachado | 143 | "and quest.ano = :ano " + |
144 | whereFragmentEntity + |
||
145 | "and fc.respondido = true " + |
||
1568 | jmachado | 146 | "and timeLine.nome = '" + PedagogicoAlunosProcessor.getHistoryDriveConstraintStatic() + "' " + |
1567 | jmachado | 147 | periodosQuery + |
148 | degreesQuery); |
||
149 | query.setDate("dateStart",dataQuestionario30.getTime()); |
||
1569 | jmachado | 150 | //query.setString("codigoSiges",teacherCode); |
1567 | jmachado | 151 | query.setString("ano",anoLectivo); |
152 | |||
1569 | jmachado | 153 | report.idadeM30 = ((1.5.0/docs/api/java/lang/Long.html">Long) query.uniqueResult()).intValue(); |
154 | report.idadeM30Percent = (int)(((float)report.idadeM30) / ((float)report.inquiridosComResposta) * 100.0); |
||
1567 | jmachado | 155 | } |
156 | |||
157 | |||
1569 | jmachado | 158 | public static void countTiposAlunosComRespostasAoDocente(1.5.0/docs/api/java/lang/String.html">String teacherCode, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) |
159 | { |
||
160 | countTiposAlunosComRespostas(new 1.5.0/docs/api/java/lang/String.html">String[]{teacherCode},EntityEvaluated.DOCENTE,anoLectivo,docenteReport,periodos,degrees); |
||
161 | } |
||
162 | |||
163 | public static void countTiposAlunosComRespostasAoCurso(1.5.0/docs/api/java/lang/String.html">String courseCode, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) |
||
164 | { |
||
165 | countTiposAlunosComRespostas(new 1.5.0/docs/api/java/lang/String.html">String[]{courseCode},EntityEvaluated.CURSO,anoLectivo,docenteReport,periodos,degrees); |
||
166 | } |
||
167 | public static void countTiposAlunosComRespostasAoCursos(1.5.0/docs/api/java/lang/String.html">String[] courseCodes, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) |
||
168 | { |
||
169 | countTiposAlunosComRespostas(courseCodes,EntityEvaluated.CURSOS,anoLectivo,docenteReport,periodos,degrees); |
||
170 | } |
||
171 | public static void countTiposAlunosComRespostasAoCursos(List<String> courseCodes, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) |
||
172 | { |
||
173 | countTiposAlunosComRespostas((1.5.0/docs/api/java/lang/String.html">String[]) courseCodes.toArray(),EntityEvaluated.CURSOS,anoLectivo,docenteReport,periodos,degrees); |
||
174 | } |
||
175 | private static void countTiposAlunosComRespostas(1.5.0/docs/api/java/lang/String.html">String[] codes,EntityEvaluated entityEvaluated, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) { |
||
176 | |||
1567 | jmachado | 177 | 1.5.0/docs/api/java/lang/String.html">String periodosQuery = QueryDaoUtils.createPeriodosQuery(periodos, "quest", true); |
178 | 1.5.0/docs/api/java/lang/String.html">String degreesQuery = QueryDaoUtils.createDegreesQuery(degrees, "curso", true); |
||
179 | 1.5.0/docs/api/javax/management/Query.html">Query query; |
||
180 | 5+0%2Fdocs%2Fapi+Object">Object result; |
||
181 | |||
1569 | jmachado | 182 | 1.5.0/docs/api/java/lang/String.html">String whereFragmentEntity = QuestionariosQueryDao.getWhereEntityCodesFragment(codes, entityEvaluated); |
1567 | jmachado | 183 | |
184 | query = AbstractDao.getCurrentSession().createQuery("" + |
||
185 | "SELECT " + |
||
186 | "count(distinct user.sigesCode) " + |
||
187 | "FROM " + OlapStarFactQuestionario.class.getName() + " fc " + |
||
188 | "JOIN fc.olapQuestionario quest " + |
||
189 | "JOIN fc.olapTipologia tipo " + |
||
190 | "JOIN fc.olapPerfilUser user " + |
||
191 | "JOIN fc.olapCurso curso " + |
||
1568 | jmachado | 192 | "JOIN fc.olapTimeLine timeLine " + |
1569 | jmachado | 193 | "where quest.ano = :ano " + |
194 | whereFragmentEntity + |
||
195 | "and fc.respondido = true and user.tipoAlunoTrabalhadorEstudante = true " + |
||
1568 | jmachado | 196 | "and timeLine.nome = '" + PedagogicoAlunosProcessor.getHistoryDriveConstraintStatic() + "' " + |
1567 | jmachado | 197 | periodosQuery + |
198 | degreesQuery |
||
199 | ); |
||
1569 | jmachado | 200 | //query.setString("codigoSiges",teacherCode); |
1567 | jmachado | 201 | query.setString("ano",anoLectivo); |
202 | result = query.uniqueResult(); |
||
203 | docenteReport.tipoAlunosTrabalhadorEstudanteComResposta = ((1.5.0/docs/api/java/lang/Long.html">Long) result).intValue(); |
||
204 | |||
205 | query = AbstractDao.getCurrentSession().createQuery("" + |
||
206 | "SELECT " + |
||
207 | "count(distinct user.sigesCode) " + |
||
208 | "FROM " + OlapStarFactQuestionario.class.getName() + " fc " + |
||
209 | "JOIN fc.olapQuestionario quest " + |
||
210 | "JOIN fc.olapTipologia tipo " + |
||
211 | "JOIN fc.olapPerfilUser user " + |
||
212 | "JOIN fc.olapCurso curso " + |
||
1568 | jmachado | 213 | "JOIN fc.olapTimeLine timeLine " + |
1569 | jmachado | 214 | "where quest.ano = :ano " + |
215 | whereFragmentEntity + |
||
216 | "and fc.respondido = true and user.tipoAlunoErasmus = true " + |
||
1568 | jmachado | 217 | "and timeLine.nome = '" + PedagogicoAlunosProcessor.getHistoryDriveConstraintStatic() + "' " + |
1567 | jmachado | 218 | periodosQuery + |
219 | degreesQuery); |
||
1569 | jmachado | 220 | //query.setString("codigoSiges",teacherCode); |
1567 | jmachado | 221 | query.setString("ano",anoLectivo); |
222 | result = query.uniqueResult(); |
||
223 | docenteReport.tipoAlunosErasmusComResposta = ((1.5.0/docs/api/java/lang/Long.html">Long) result).intValue(); |
||
224 | |||
225 | docenteReport.tipoAlunosNormalComResposta = docenteReport.inquiridosComResposta - docenteReport.tipoAlunosErasmusComResposta - docenteReport.tipoAlunosTrabalhadorEstudanteComResposta; |
||
226 | |||
227 | docenteReport.tipoAlunosErasmusComRespostaPercent = (int)((((float)docenteReport.tipoAlunosErasmusComResposta) / ((float) docenteReport.inquiridosComResposta)) * 100.0); |
||
228 | docenteReport.tipoAlunosTrabalhadorEstudanteComRespostaPercent = (int)((((float)docenteReport.tipoAlunosTrabalhadorEstudanteComResposta) / ((float) docenteReport.inquiridosComResposta)) * 100.0); |
||
229 | docenteReport.tipoAlunosNormalComRespostaPercent = (int)((((float)docenteReport.tipoAlunosNormalComResposta) / ((float) docenteReport.inquiridosComResposta)) * 100.0); |
||
230 | } |
||
231 | |||
232 | |||
1569 | jmachado | 233 | public static void countAlunosQueResponderamAoDocente(1.5.0/docs/api/java/lang/String.html">String teacherCode, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) |
234 | { |
||
235 | countAlunosQueResponderamGen(new 1.5.0/docs/api/java/lang/String.html">String[]{teacherCode},EntityEvaluated.DOCENTE,anoLectivo,docenteReport,periodos,degrees); |
||
236 | } |
||
237 | public static void countAlunosQueResponderamAoCurso(1.5.0/docs/api/java/lang/String.html">String courseCode, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) |
||
238 | { |
||
239 | countAlunosQueResponderamGen(new 1.5.0/docs/api/java/lang/String.html">String[]{courseCode},EntityEvaluated.CURSO,anoLectivo,docenteReport,periodos,degrees); |
||
240 | } |
||
241 | public static void countAlunosQueResponderamAoCursos(1.5.0/docs/api/java/lang/String.html">String[] courseCodes, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) |
||
242 | { |
||
243 | countAlunosQueResponderamGen(courseCodes,EntityEvaluated.CURSOS,anoLectivo,docenteReport,periodos,degrees); |
||
244 | } |
||
245 | public static void countAlunosQueResponderamAoCursos(List<String> courseCodes, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) |
||
246 | { |
||
247 | countAlunosQueResponderamGen((1.5.0/docs/api/java/lang/String.html">String[]) courseCodes.toArray(),EntityEvaluated.CURSOS,anoLectivo,docenteReport,periodos,degrees); |
||
248 | } |
||
249 | |||
250 | public static void countAlunosQueResponderamGen(1.5.0/docs/api/java/lang/String.html">String[] codes,EntityEvaluated entityEvaluated, 1.5.0/docs/api/java/lang/String.html">String anoLectivo, QuestionariosAlunosReport docenteReport, 1.5.0/docs/api/java/lang/String.html">String[] periodos, 1.5.0/docs/api/java/lang/String.html">String[] degrees) { |
||
251 | |||
1567 | jmachado | 252 | 1.5.0/docs/api/java/lang/String.html">String periodosQuery = QueryDaoUtils.createPeriodosQuery(periodos, "quest", true); |
253 | 1.5.0/docs/api/java/lang/String.html">String degreesQuery = QueryDaoUtils.createDegreesQuery(degrees, "curso", true); |
||
254 | |||
1569 | jmachado | 255 | 1.5.0/docs/api/java/lang/String.html">String whereFragmentEntity = QuestionariosQueryDao.getWhereEntityCodesFragment(codes, entityEvaluated); |
256 | |||
1567 | jmachado | 257 | /***** HOMENS MULHERES QUE RESPONDERAM ********/ |
258 | 1.5.0/docs/api/javax/management/Query.html">Query query = AbstractDao.getCurrentSession().createQuery("" + |
||
259 | "SELECT " + |
||
260 | "count(distinct user.sigesCode) " + |
||
261 | "FROM " + OlapStarFactQuestionario.class.getName() + " fc " + |
||
262 | "JOIN fc.olapQuestionario quest " + |
||
263 | "JOIN fc.olapTipologia tipo " + |
||
264 | "JOIN fc.olapPerfilUser user " + |
||
265 | "JOIN fc.olapCurso curso " + |
||
1568 | jmachado | 266 | "JOIN fc.olapTimeLine timeLine " + |
1567 | jmachado | 267 | "where " + |
268 | "quest.ano = :ano " + |
||
1569 | jmachado | 269 | whereFragmentEntity + |
1567 | jmachado | 270 | "and fc.respondido = true " + |
1568 | jmachado | 271 | "and user.sex='M' " + |
272 | "and timeLine.nome = '" + PedagogicoAlunosProcessor.getHistoryDriveConstraintStatic() + "' " + |
||
1567 | jmachado | 273 | periodosQuery + |
274 | degreesQuery |
||
275 | ); |
||
276 | |||
1569 | jmachado | 277 | //query.setString("codigoSiges",code); |
1567 | jmachado | 278 | query.setString("ano",anoLectivo); |
279 | 5+0%2Fdocs%2Fapi+Object">Object result = query.uniqueResult(); |
||
280 | docenteReport.masculinoComResposta = ((1.5.0/docs/api/java/lang/Long.html">Long) result).intValue(); |
||
281 | |||
282 | query = AbstractDao.getCurrentSession().createQuery("" + |
||
283 | "SELECT " + |
||
284 | "count(distinct user.sigesCode) " + |
||
285 | "FROM " + OlapStarFactQuestionario.class.getName() + " fc " + |
||
286 | "JOIN fc.olapQuestionario quest " + |
||
287 | "JOIN fc.olapTipologia tipo " + |
||
288 | "JOIN fc.olapPerfilUser user " + |
||
289 | "JOIN fc.olapCurso curso " + |
||
1568 | jmachado | 290 | "JOIN fc.olapTimeLine timeLine " + |
1567 | jmachado | 291 | "where quest.ano = :ano " + |
1569 | jmachado | 292 | whereFragmentEntity + |
1567 | jmachado | 293 | "and fc.respondido = true " + |
1568 | jmachado | 294 | "and user.sex='F' " + |
295 | "and timeLine.nome = '" + PedagogicoAlunosProcessor.getHistoryDriveConstraintStatic() + "' " + |
||
1567 | jmachado | 296 | periodosQuery + |
297 | degreesQuery); |
||
1569 | jmachado | 298 | //query.setString("codigoSiges",code); |
1567 | jmachado | 299 | query.setString("ano",anoLectivo); |
300 | result = query.uniqueResult(); |
||
301 | docenteReport.femininoComResposta = ((1.5.0/docs/api/java/lang/Long.html">Long) result).intValue(); |
||
302 | |||
303 | //BASTA TER UMA RESPOSTA CONSIDERA-SE QUE RESPONDEU AOS QUESTIONARIOS |
||
304 | docenteReport.inquiridosComResposta = docenteReport.masculinoComResposta + docenteReport.femininoComResposta; |
||
305 | docenteReport.masculinoComRespostaPercent = (int)((((float)docenteReport.masculinoComResposta) / ((float) docenteReport.inquiridosComResposta)) * 100.0); |
||
306 | docenteReport.femininoComRespostaPercent = (int)((((float)docenteReport.femininoComResposta) / ((float) docenteReport.inquiridosComResposta)) * 100.0); |
||
307 | |||
308 | /*TAXA DE RESPOSTA NAO SE PODE RETIRAR OS ALUNOS SEM RESPOSTA PORQUE PODEM REPETIR NO CASO DE TEREM RESPONDIDO A UMAS E NAO A OUTRAS*/ |
||
309 | query = AbstractDao.getCurrentSession().createQuery("" + |
||
310 | "SELECT " + |
||
311 | "count(distinct user.sigesCode) " + |
||
312 | "FROM " + OlapStarFactQuestionario.class.getName() + " fc " + |
||
313 | "JOIN fc.olapQuestionario quest " + |
||
314 | "JOIN fc.olapTipologia tipo " + |
||
315 | "JOIN fc.olapPerfilUser user " + |
||
316 | "JOIN fc.olapCurso curso " + |
||
1568 | jmachado | 317 | "JOIN fc.olapTimeLine timeLine " + |
1567 | jmachado | 318 | "where quest.ano = :ano " + |
1569 | jmachado | 319 | whereFragmentEntity + |
1568 | jmachado | 320 | "and timeLine.nome = '" + PedagogicoAlunosProcessor.getHistoryDriveConstraintStatic() + "' " + |
1567 | jmachado | 321 | periodosQuery + |
322 | degreesQuery); |
||
1569 | jmachado | 323 | //query.setString("codigoSiges",code); |
1567 | jmachado | 324 | query.setString("ano",anoLectivo); |
325 | result = query.uniqueResult(); |
||
326 | docenteReport.inquiridosTotal = ((1.5.0/docs/api/java/lang/Long.html">Long) result).intValue(); |
||
327 | docenteReport.inquiridosNaoResponderam = docenteReport.inquiridosTotal - docenteReport.inquiridosComResposta; |
||
328 | } |
||
1569 | jmachado | 329 | |
330 | |||
1567 | jmachado | 331 | } |