PbVXsxxsfytbMapper.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.xjrsoft.module.student.mapper.PbVXsxxsfytbMapper">
  6. <select id="getClassQfCount" resultType="com.xjrsoft.module.student.vo.BaseClassQfCountVo">
  7. select id, (
  8. select count(*) from xjr_user t1
  9. inner join base_student_school_roll t2 on t1.id = t2.user_id
  10. inner join pb_v_xsxxsfytb t3 on t1.credential_number = t3.Studentcode
  11. where t3.qfje > 0 and t2.class_id = base_class.id
  12. ) as count
  13. from base_class where delete_mark = 0
  14. </select>
  15. <select id="getList" parameterType="com.xjrsoft.module.student.dto.PbVXsxxsfytbDto" resultType="com.xjrsoft.module.student.vo.PbVXsxxsfytbVo">
  16. SELECT * FROM pb_v_xsxxsfytb WHERE 1 = 1
  17. <if test="dto.studentCodes != null and dto.studentCodes.size() > 0">
  18. and Studentcode IN
  19. <foreach item="studentcode" index="index" collection="dto.studentCodes" open="(" close=")" separator=",">
  20. #{studentcode}
  21. </foreach>
  22. </if>
  23. AND beltcode = #{dto.beltcode} and feeitemcode in (103042766003001, 999010604, 999010603)
  24. </select>
  25. <select id="getSpecnameCount" parameterType="com.xjrsoft.module.student.dto.EnrollmentStatisticsInfoDto" resultType="com.xjrsoft.module.student.vo.PbVXsxxsfytbSpecnameCountVo">
  26. SELECT specname,COUNT(DISTINCT(Studentcode)) as student_count FROM pb_v_xsxxsfytb WHERE jfzt = '已缴费' AND enteryear = #{dto.year} GROUP BY specname
  27. </select>
  28. <select id="getStudentFeeInfo" parameterType="com.xjrsoft.module.student.dto.BaseStudentInfoDetailDto" resultType="com.xjrsoft.module.student.vo.PbVXsxxsfytbFeeitemVo">
  29. SELECT replace(IFNULL((SELECT jfzt FROM pb_v_xsxxsfytb WHERE Studentcode = #{dto.credentialNumber} AND feeitemcode LIKE '999010604%' AND beltcode = #{dto.beltcode}),'欠费'),'未缴费','欠费') AS jxf,
  30. replace(IFNULL((SELECT jfzt FROM pb_v_xsxxsfytb WHERE Studentcode = #{dto.credentialNumber} AND feeitemcode LIKE '999010603%' AND beltcode = #{dto.beltcode}),'欠费'),'未缴费','欠费') AS jcf,
  31. replace(IFNULL((SELECT jfzt FROM pb_v_xsxxsfytb WHERE Studentcode = #{dto.credentialNumber} AND feeitemcode = 103042766003001 AND beltcode = #{dto.beltcode}),'欠费'),'未缴费','欠费') AS ssf
  32. </select>
  33. <select id="getFeeDetail" resultType="com.xjrsoft.module.student.vo.FeeDetailListVo">
  34. SELECT t4.shortname,t3.name AS semester_name,REPLACE(t1.jfzt,'未缴费','欠费') AS jfzt,t1.factrecarmny,t1.factar FROM pb_v_xsxxsfytb t1
  35. LEFT JOIN pb_semester_config t2 ON t1.beltcode = t2.beltcode
  36. LEFT JOIN base_semester t3 ON t2.base_semester_id = t3.id
  37. LEFT JOIN pb_cse_feeitem2 t4 ON t1.feeitemcode = t4.feeitemcode
  38. WHERE t1.Studentcode = #{studentcode}
  39. <if test="beltcode != null and beltcode != ''">
  40. and t1.beltcode = #{beltcode}
  41. </if>
  42. </select>
  43. <select id="studentCategoryStat" parameterType="com.xjrsoft.module.student.dto.PbVXsxxsfytbStatDto" resultType="com.xjrsoft.module.student.vo.StringCountVo">
  44. SELECT t1.resourcename as name,COUNT(t1.studentcode) as count FROM pb_cse_feeobjupdate t1
  45. INNER JOIN xjr_user t2 ON t1.studentcode = t2.credential_number
  46. INNER JOIN base_student_school_roll t3 ON t2.id = t3.user_id
  47. WHERE t2.delete_mark = 0 AND t3.delete_mark = 0
  48. <if test="dto.gradeId != null">
  49. and t3.grade_id = #{dto.gradeId}
  50. </if>
  51. GROUP BY t1.resourcename
  52. </select>
  53. <select id="stduyStatusStat" parameterType="com.xjrsoft.module.student.dto.PbVXsxxsfytbStatDto" resultType="com.xjrsoft.module.student.vo.StringCountVo">
  54. SELECT t1.quartername as name,COUNT(t1.studentcode) as count FROM pb_cse_feeobjupdate t1
  55. INNER JOIN xjr_user t2 ON t1.studentcode = t2.credential_number
  56. INNER JOIN base_student_school_roll t3 ON t2.id = t3.user_id
  57. WHERE t2.delete_mark = 0 AND t3.delete_mark = 0
  58. <if test="dto.gradeId != null">
  59. and t3.grade_id = #{dto.gradeId}
  60. </if>
  61. GROUP BY t1.quartername
  62. </select>
  63. <select id="stduyStatusStat" parameterType="com.xjrsoft.module.student.dto.PbVXsxxsfytbStatDto" resultType="com.xjrsoft.module.student.vo.StringCountVo">
  64. SELECT t1.quartername as name,COUNT(t1.studentcode) as count FROM pb_cse_feeobjupdate t1
  65. INNER JOIN xjr_user t2 ON t1.studentcode = t2.credential_number
  66. INNER JOIN base_student_school_roll t3 ON t2.id = t3.user_id
  67. WHERE t2.delete_mark = 0 AND t3.delete_mark = 0
  68. <if test="dto.gradeId != null">
  69. and t3.grade_id = #{dto.gradeId}
  70. </if>
  71. GROUP BY t1.quartername
  72. </select>
  73. <select id="getClassQfPage" parameterType="com.xjrsoft.module.student.dto.PbVXsxxsfytbStatDto" resultType="com.xjrsoft.module.student.vo.ClassQfPageVo">
  74. SELECT t1.id, t2.name AS grade_name,t2.name AS class_name,t3.name AS teacher_name,
  75. (
  76. SELECT SUM(qfje) FROM pb_v_xsxxsfytb a1
  77. INNER JOIN xjr_user a2 ON a1.studentcode = a2.credential_number
  78. INNER JOIN base_student_school_roll a3 ON a2.id = a3.user_id
  79. WHERE a2.delete_mark = 0 AND a3.delete_mark = 0 AND a3.class_id = t1.id
  80. ) AS qfzje FROM base_class t1
  81. INNER JOIN base_grade t2 ON t1.grade_id = t2.id
  82. LEFT JOIN xjr_user t3 ON t1.teacher_id = t3.id
  83. WHERE t1.delete_mark = 0
  84. <if test="dto.gradeId != null">
  85. and t1.grade_id = #{dto.gradeId}
  86. </if>
  87. ORDER BY qfzje DESC
  88. </select>
  89. <select id="feeitemStat" parameterType="com.xjrsoft.module.student.dto.PbVXsxxsfytbStatDto" resultType="com.xjrsoft.module.student.vo.NameFee2Vo">
  90. SELECT t4.shortname as fee_name,SUM(factar) as money1,SUM(qfje) as money2 FROM pb_v_xsxxsfytb t1
  91. INNER JOIN pb_cse_feeitem2 t4 ON t4.feeitemcode = t1.feeitemcode
  92. INNER JOIN xjr_user t2 ON t1.Studentcode = t2.credential_number
  93. INNER JOIN base_student_school_roll t3 ON t3.user_id = t2.id
  94. WHERE t3.delete_mark = 0 AND t2.delete_mark = 0
  95. AND t1.feeitemcode IN ('999010604','103042766003001','999010603')
  96. <if test="dto.gradeId != null">
  97. and t3.grade_id = #{dto.gradeId}
  98. </if>
  99. GROUP BY t4.shortname
  100. </select>
  101. </mapper>