DictionaryCQuery.xml 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.bowintek.smartsearch.mapper.cquery.DictionaryCQuery">
  4. <select id="selectCollegeList" resultType="com.bowintek.smartsearch.vo.system.dictionary.DicCollegeModel">
  5. select collegeID,code,name,recordStatus from cf_college
  6. order by code
  7. </select>
  8. <select id="selectMajorGradeList" resultType="com.bowintek.smartsearch.vo.system.dictionary.DicMajorGradeModel">
  9. select g.majorGradeID,g.code,g.name,g.schoolYearID,g.majorID
  10. from cf_major_grade g
  11. inner join cf_major m on g.MajorID = m.MajorID
  12. inner join cf_college cl on m.CollegeID = cl.CollegeID
  13. inner join cf_schoolyear s on g.schoolYearID = s.schoolYearID
  14. <where>
  15. <if test="schoolYearID!='' and schoolYearID!=null">
  16. and g.schoolYearID = #{schoolYearID}
  17. </if>
  18. <if test="collegeID!='' and collegeID!=null">
  19. and cl.collegeID = #{collegeID}
  20. </if>
  21. <if test="majorID!='' and majorID!=null">
  22. and m.MajorID = #{majorID}
  23. </if>
  24. </where>
  25. order by s.StartYear asc,g.Name desc
  26. </select>
  27. <select id="selectMajorClassList" resultType="com.bowintek.smartsearch.vo.system.dictionary.DicMajorClassModel">
  28. select cs.majorClassID,cs.majorGradeID,cs.code,cs.name
  29. from cf_major_class cs
  30. inner join cf_major_grade g on cs.majorGradeID = g.majorGradeID
  31. inner join cf_major m on g.MajorID = m.MajorID
  32. inner join cf_college cl on m.CollegeID = cl.CollegeID
  33. <where>
  34. <if test="schoolYearID!='' and schoolYearID!=null">
  35. and g.schoolYearID = #{schoolYearID}
  36. </if>
  37. <if test="collegeID!='' and collegeID!=null">
  38. and cl.collegeID = #{collegeID}
  39. </if>
  40. <if test="majorGradeID!='' and majorGradeID!=null">
  41. and g.majorGradeID = #{majorGradeID}
  42. </if>
  43. </where>
  44. order by cs.code
  45. </select>
  46. <select id="selectMajorList" resultType="com.bowintek.smartsearch.vo.system.dictionary.DicMajorModel">
  47. select cm.CollegeID,cm.MajorID,cm.code,cm.name
  48. from cf_major cm inner join cf_college cc
  49. on cm.CollegeID = cc.CollegeID
  50. <where>
  51. <if test="collegeID!='' and collegeID!=null">
  52. and cm.collegeID = #{collegeID}
  53. </if>
  54. <if test="code!='' and code!=null">
  55. and cm.code = #{code}
  56. </if>
  57. <if test="name!='' and name!=null">
  58. and cm.name = #{name}
  59. </if>
  60. </where>
  61. order by cm.code
  62. </select>
  63. <select id="selectPositionByMajorGradeIDList" resultType="com.bowintek.smartsearch.model.CfPosition">
  64. select distinct p.positionID,p.name
  65. from cf_position p
  66. left join (
  67. select positionID,sum(useQty) useQty from (select positionID,count(1) as useQty from pm_practice_task_student group by positionID
  68. union select NextPositionID PositionID,count(1) as useQty from pm_practice_position_change pc where RecordStatus=1
  69. group by pc.NextPositionID) pu group by pu.PositionID
  70. ) as pUse on p.positionID = pUse.positionID
  71. where p.Qty>ifnull(pUse.useQty,0) and p.MajorGradeID = #{majorGradeID}
  72. <if test="schoolYearID!='' and schoolYearID!=null">
  73. and p.schoolYearID = #{schoolYearID}
  74. </if>
  75. <if test="practiceBaseID!='' and practiceBaseID!=null">
  76. and p.practiceBaseID = #{practiceBaseID}
  77. </if>
  78. order by p.name
  79. </select>
  80. </mapper>