Commit befd8efc authored by didonet's avatar didonet

Modified query to check for duplicated sections.

parent 243c4191
......@@ -102,10 +102,11 @@ public class Configuration {
"( a1.situation = '"+SituationTranscript.Aprovado+"' or a1.situation is null or a1.situation = '"+SituationTranscript.Nulo+"')"+
" and a1.transcript_section = b1.id and b1.course = c1.id and a1.student = d1.id and d1.student = e1.id " +
"and d1.reg_status='Ativa' and " +
"exists ( select e.name, c.code from transcript a, section_pos b, course c, registration d, person e " +
"where a.transcript_section = b.id and b.course = c.id and a.student = d.id and d.student = " +
"e.id and d.reg_status='Ativa' group by c.code, e.name having count(*) > 1 and" +
" c1.code=c.code and e1.name = e.name) " +
"exists ( select e.name, c.code, a.situation from transcript a, section_pos b, course c, registration d, person e " +
"where a.transcript_section = b.id and b.course = c.id and a.student = d.id and d.student = e.id " +
" and d.reg_status='Ativa' group by c.code, e.name, a.situation having count(*) > 1 " +
" and a.situation <> '"+SituationTranscript.Reprovado+"'" +
" and c1.code=c.code and e1.name = e.name) " +
"and c1.code not in ("+ "'"+
findConfigValueByName(Configuration.ALLOWED_DUPLICATE_COURSE_CODE).replaceAll(" ","").replaceAll(",","','")+"'"+") " +
" order by e1.name, c1.code ",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment