PbVXssfdetailMapper.xml 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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.PbVXssfdetailMapper">
  6. <select id="getPage" parameterType="com.xjrsoft.module.student.dto.PbVXssfdetailPageDto" resultType="com.xjrsoft.module.student.vo.PbVXssfdetailPageVo">
  7. SELECT t2.user_id,t2.student_id,t1.name,t4.name AS gender_cn,t6.name AS semester_name,t3.feeitemname,t3.paytype,t3.paydate,t3.payorder,t3.mny, t8.state FROM xjr_user t1
  8. INNER JOIN base_student t2 ON t1.id = t2.user_id
  9. INNER JOIN pb_v_xssfdetail t3 ON t1.credential_number = t3.personalid
  10. LEFT JOIN xjr_dictionary_detail t4 ON t1.gender = t4.code AND t4.item_id = 2023000000000000004
  11. LEFT JOIN pb_semester_config t5 ON t3.beltcode = t5.beltcode AND t5.delete_mark = 0
  12. LEFT JOIN base_semester t6 ON t6.id = t5.base_semester_id
  13. LEFT JOIN base_student_school_roll t7 ON t7.user_id = t1.id
  14. LEFT join pb_cse_feeobjupdate t8 on t8.studentcode = t2.student_id
  15. WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
  16. <if test="dto.name != null and dto.name != ''">
  17. and t1.name like concat('%', #{dto.name},'%')
  18. </if>
  19. <if test="dto.semesterId != null">
  20. and t6.id = #{dto.semesterId}
  21. </if>
  22. <if test="dto.feeitemname != null and dto.feeitemname != ''">
  23. and t3.feeitemname like concat('%', #{dto.feeitemname},'%')
  24. </if>
  25. <if test="dto.studentId != null and dto.studentId != ''">
  26. and t2.student_id like concat('%', #{dto.studentId},'%')
  27. </if>
  28. <if test="dto.payorder != null and dto.payorder != ''">
  29. and t3.payorder like concat('%', #{dto.payorder},'%')
  30. </if>
  31. <if test="dto.startDate != null and dto.startDate != '' and dto.endDate != null and dto.endDate != ''">
  32. and t3.paydate between #{dto.startDate} and #{dto.endDate}
  33. </if>
  34. <if test="dto.category != null">
  35. <if test="dto.category == 1">
  36. and t3.mny > 0
  37. </if>
  38. <if test="dto.category == -1">
  39. and 0 > t3.mny
  40. </if>
  41. </if>
  42. <if test="dto.classIdList != null and !dto.classIdList.isEmpty()">
  43. and t7.class_id in
  44. <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")" separator=",">
  45. #{classId}
  46. </foreach>
  47. </if>
  48. </select>
  49. <select id="getList" parameterType="com.xjrsoft.module.student.dto.PbVXssfdetailExcelDto" resultType="com.xjrsoft.module.student.vo.PbVXssfdetailExcelVo">
  50. SELECT t2.user_id,t2.student_id,t1.name,t4.name AS gender_cn,t6.name AS semester_name,t3.feeitemname,t3.paytype,t3.paydate,t3.payorder,t3.mny FROM xjr_user t1
  51. INNER JOIN base_student t2 ON t1.id = t2.user_id
  52. INNER JOIN pb_v_xssfdetail t3 ON t1.credential_number = t3.personalid
  53. LEFT JOIN xjr_dictionary_detail t4 ON t1.gender = t4.code AND t4.item_id = 2023000000000000004
  54. LEFT JOIN pb_semester_config t5 ON t3.beltcode = t5.beltcode AND t5.delete_mark = 0
  55. LEFT JOIN base_semester t6 ON t6.id = t5.base_semester_id
  56. WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
  57. <if test="dto.payorders == null">
  58. <if test="dto.name != null and dto.name != ''">
  59. and t1.name like concat('%', #{dto.name},'%')
  60. </if>
  61. <if test="dto.semesterId != null">
  62. and t6.id = #{dto.semesterId}
  63. </if>
  64. <if test="dto.feeitemname != null and dto.feeitemname != ''">
  65. and t3.feeitemname like concat('%', #{dto.feeitemname},'%')
  66. </if>
  67. <if test="dto.studentId != null and dto.studentId != ''">
  68. and t2.student_id like concat('%', #{dto.studentId},'%')
  69. </if>
  70. <if test="dto.payorder != null and dto.payorder != ''">
  71. and t3.payorder like concat('%', #{dto.payorder},'%')
  72. </if>
  73. <if test="dto.startDate != null and dto.startDate != '' and dto.endDate != null and dto.endDate != ''">
  74. and t3.paydate between #{dto.startDate} and #{dto.endDate}
  75. </if>
  76. <if test="dto.category != null">
  77. <if test="dto.category == 1">
  78. and t3.mny > 0
  79. </if>
  80. <if test="dto.category == -1">
  81. and 0 > t3.mny
  82. </if>
  83. </if>
  84. </if>
  85. <if test="dto.payorders != null">
  86. and t3.payorder in
  87. <foreach item="payorder" index="index" collection="dto.payorders" open="(" close=")" separator=",">
  88. #{payorder}
  89. </foreach>
  90. </if>
  91. </select>
  92. </mapper>