ExamMapper.xml 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.zhongzheng.modules.bank.mapper.ExamMapper">
  6. <resultMap type="com.zhongzheng.modules.bank.domain.Exam" id="ExamResult">
  7. <result property="examId" column="exam_id"/>
  8. <result property="status" column="status"/>
  9. <result property="createTime" column="create_time"/>
  10. <result property="updateTime" column="update_time"/>
  11. <result property="prefixName" column="prefix_name"/>
  12. <result property="code" column="code"/>
  13. <result property="examName" column="exam_name"/>
  14. <result property="publishStatus" column="publish_status"/>
  15. <result property="year" column="year"/>
  16. <result property="cityId" column="city_id"/>
  17. <result property="provinceId" column="province_id"/>
  18. <result property="examPaperId" column="exam_paper_id"/>
  19. <result property="answerTime" column="answer_time"/>
  20. <result property="examPaperId" column="exam_paper_id"/>
  21. <result property="answerNum" column="answer_num"/>
  22. <result property="sort" column="sort"/>
  23. </resultMap>
  24. <resultMap type="com.zhongzheng.modules.bank.vo.ExamVo" id="ExamVoResult">
  25. <result property="examId" column="exam_id"/>
  26. <result property="status" column="status"/>
  27. <result property="createTime" column="create_time"/>
  28. <result property="updateTime" column="update_time"/>
  29. <result property="prefixName" column="prefix_name"/>
  30. <result property="code" column="code"/>
  31. <result property="examName" column="exam_name"/>
  32. <result property="publishStatus" column="publish_status"/>
  33. <result property="year" column="year"/>
  34. <result property="cityId" column="city_id"/>
  35. <result property="provinceId" column="province_id"/>
  36. <result property="examPaperId" column="exam_paper_id"/>
  37. <result property="answerTime" column="answer_time"/>
  38. <result property="examPaperId" column="exam_paper_id"/>
  39. <result property="answerNum" column="answer_num"/>
  40. <result property="sort" column="sort"/>
  41. <result property="educationName" column="education_name"/>
  42. <result property="projectName" column="project_name"/>
  43. <result property="businessName" column="business_name"/>
  44. <result property="educationTypeId" column="education_type_id"/>
  45. <result property="businessId" column="business_id"/>
  46. <result property="subjectId" column="subject_id"/>
  47. <result property="projectId" column="project_id"/>
  48. <result property="subjectName" column="subject_name"/>
  49. </resultMap>
  50. <select id="getList" parameterType="com.zhongzheng.modules.bank.bo.ExamQueryBo" resultMap="ExamVoResult">
  51. SELECT
  52. e.*,
  53. qb.education_type_id,
  54. qb.business_id,
  55. qb.project_id,
  56. qb.subject_id,
  57. cet.education_name,
  58. cpt.project_name,
  59. cb.business_name,
  60. cs.subject_name
  61. FROM
  62. exam e
  63. LEFT JOIN question_business qb ON e.exam_id = qb.major_id
  64. AND qb.type = 2
  65. LEFT JOIN course_education_type cet ON qb.education_type_id = cet.id
  66. LEFT JOIN course_project_type cpt ON qb.project_id = cpt.id
  67. LEFT JOIN course_business cb ON qb.business_id = cb.id
  68. LEFT JOIN course_subject cs ON cs.id = qb.subject_id
  69. <if test="educationTypeId != null and educationTypeId != ''">
  70. AND cet.education_type_id = #{educationTypeId}
  71. </if>
  72. <if test="subjectId != null and subjectId != ''">
  73. AND cs.subject_id = #{subjectId}
  74. </if>
  75. <if test="businessId != null and businessId != ''">
  76. AND cb.business_id = #{businessId}
  77. </if>
  78. <if test="projectId != null and projectId != ''">
  79. AND cpt.project_id = #{projectId}
  80. </if>
  81. <if test="examPaperId != null and examPaperId != ''">
  82. AND e.exam_paper_id = #{examPaperId}
  83. </if>
  84. <if test="publishStatus != null and publishStatus != ''">
  85. AND e.publish_status = #{publishStatus}
  86. </if>
  87. <if test="examName != null and examName != ''">
  88. AND e.exam_name = like concat('%', #{examName}, '%')
  89. </if>
  90. <if test="prefixName != null and prefixName != ''">
  91. AND e.prefix_name = like concat('%', #{prefixName}, '%')
  92. </if>
  93. ORDER BY e.exam_id DESC
  94. </select>
  95. </mapper>