ActivityConfigurationMapper.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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.activity.mapper.ActivityConfigurationMapper">
  6. <resultMap type="com.zhongzheng.modules.activity.domain.ActivityConfiguration" id="ActivityConfigurationResult">
  7. <result property="id" column="id"/>
  8. <result property="activityName" column="activity_name"/>
  9. <result property="activityType" column="activity_type"/>
  10. <result property="description" column="description"/>
  11. <result property="startTime" column="start_time"/>
  12. <result property="endTime" column="end_time"/>
  13. <result property="price" column="price"/>
  14. <result property="quantity" column="quantity"/>
  15. <result property="validityTime" column="validity_time"/>
  16. <result property="discount" column="discount"/>
  17. <result property="liveContent" column="live_content"/>
  18. <result property="liveAdress" column="live_adress"/>
  19. <result property="createTime" column="create_time"/>
  20. <result property="updateTime" column="update_time"/>
  21. <result property="status" column="status"/>
  22. </resultMap>
  23. <resultMap type="com.zhongzheng.modules.activity.vo.ActivityConfigurationVo" id="ActivityConfigurationResultVO">
  24. <result property="id" column="id"/>
  25. <result property="activityName" column="activity_name"/>
  26. <result property="activityType" column="activity_type"/>
  27. <result property="description" column="description"/>
  28. <result property="startTime" column="start_time"/>
  29. <result property="endTime" column="end_time"/>
  30. <result property="price" column="price"/>
  31. <result property="quantity" column="quantity"/>
  32. <result property="validityTime" column="validity_time"/>
  33. <result property="discount" column="discount"/>
  34. <result property="liveContent" column="live_content"/>
  35. <result property="liveAdress" column="live_adress"/>
  36. <result property="createTime" column="create_time"/>
  37. <result property="updateTime" column="update_time"/>
  38. <result property="status" column="status"/>
  39. <collection property="courses" javaType="java.util.List" resultMap="CourseResult"/>
  40. </resultMap>
  41. <resultMap type="com.zhongzheng.modules.course.domain.Course" id="CourseResult">
  42. <result property="courseId" column="course_id"/>
  43. <result property="categoryId" column="category_id"/>
  44. <result property="price" column="price"/>
  45. <result property="duration" column="duration"/>
  46. <result property="startTime" column="start_time"/>
  47. <result property="endTime" column="end_time"/>
  48. <result property="coverUrl" column="cover_url"/>
  49. <result property="introduction" column="introduction"/>
  50. <result property="createTime" column="create_time"/>
  51. <result property="updateTime" column="update_time"/>
  52. <result property="status" column="status"/>
  53. <result property="teacherIds" column="teacher_ids"/>
  54. <result property="courseName" column="course_name"/>
  55. </resultMap>
  56. <select id="selectConfiguraList" parameterType="com.zhongzheng.modules.activity.bo.ActivityConfigurationQueryBo" resultMap="ActivityConfigurationResultVO">
  57. SELECT
  58. c.*,
  59. s.*
  60. FROM
  61. activity_configuration c
  62. LEFT JOIN activity_configuration_course f ON c.id = f.configuration_id
  63. LEFT JOIN course s ON f.configuration_id = s.course_id
  64. WHERE 1=1
  65. <if test="id != null" >
  66. and c.id = #{id,jdbcType=INTEGER}
  67. </if>
  68. <if test="activityName != null" >
  69. and c.activity_name = #{activityName,jdbcType=VARCHAR}
  70. </if>
  71. <if test="activityType != null" >
  72. and c.activity_type = #{activityType,jdbcType=VARCHAR}
  73. </if>
  74. <if test="description != null" >
  75. and c.description = #{description,jdbcType=VARCHAR}
  76. </if>
  77. <if test="startTime != null" >
  78. and c.start_time = #{startTime,jdbcType=INTEGER}
  79. </if>
  80. <if test="endTime != null" >
  81. and c.end_time = #{endTime,jdbcType=INTEGER}
  82. </if>
  83. <if test="price != null" >
  84. and c.price = #{price,jdbcType=DECIMAL}
  85. </if>
  86. <if test="quantity != null" >
  87. and c.quantity = #{quantity,jdbcType=INTEGER}
  88. </if>
  89. <if test="validityTime != null" >
  90. and c.validity_time = #{validityTime,jdbcType=INTEGER}
  91. </if>
  92. <if test="discount != null" >
  93. and c.discount = #{discount,jdbcType=VARCHAR}
  94. </if>
  95. <if test="liveContent != null" >
  96. and c.live_content = #{liveContent,jdbcType=VARCHAR}
  97. </if>
  98. <if test="liveAdress != null" >
  99. and c.live_adress = #{liveAdress,jdbcType=VARCHAR}
  100. </if>
  101. <if test="createTime != null" >
  102. and c.create_time = #{createTime,jdbcType=INTEGER}
  103. </if>
  104. <if test="updateTime != null" >
  105. and c.update_time = #{updateTime,jdbcType=INTEGER}
  106. </if>
  107. <choose>
  108. <when test="status !=null and status != ''">
  109. and c.status = #{status,jdbcType=TINYINT}
  110. </when>
  111. <otherwise>
  112. and c.status != 0
  113. </otherwise>
  114. </choose>
  115. </select>
  116. <select id="selectConfigures" parameterType="java.lang.Long" resultMap="ActivityConfigurationResultVO">
  117. SELECT
  118. c.*,
  119. s.*
  120. FROM
  121. activity_configuration c
  122. LEFT JOIN activity_configuration_course f ON c.id = f.configuration_id
  123. LEFT JOIN course s ON f.configuration_id = s.course_id
  124. WHERE 1=1
  125. <if test="id != null" >
  126. and c.id = #{id,jdbcType=INTEGER}
  127. </if>
  128. <if test="activityName != null" >
  129. and c.activity_name = #{activityName,jdbcType=VARCHAR}
  130. </if>
  131. <if test="activityType != null" >
  132. and c.activity_type = #{activityType,jdbcType=VARCHAR}
  133. </if>
  134. <if test="description != null" >
  135. and c.description = #{description,jdbcType=VARCHAR}
  136. </if>
  137. <if test="startTime != null" >
  138. and c.start_time = #{startTime,jdbcType=INTEGER}
  139. </if>
  140. <if test="endTime != null" >
  141. and c.end_time = #{endTime,jdbcType=INTEGER}
  142. </if>
  143. <if test="price != null" >
  144. and c.price = #{price,jdbcType=DECIMAL}
  145. </if>
  146. <if test="quantity != null" >
  147. and c.quantity = #{quantity,jdbcType=INTEGER}
  148. </if>
  149. <if test="validityTime != null" >
  150. and c.validity_time = #{validityTime,jdbcType=INTEGER}
  151. </if>
  152. <if test="discount != null" >
  153. and c.discount = #{discount,jdbcType=VARCHAR}
  154. </if>
  155. <if test="liveContent != null" >
  156. and c.live_content = #{liveContent,jdbcType=VARCHAR}
  157. </if>
  158. <if test="liveAdress != null" >
  159. and c.live_adress = #{liveAdress,jdbcType=VARCHAR}
  160. </if>
  161. <if test="createTime != null" >
  162. and c.create_time = #{createTime,jdbcType=INTEGER}
  163. </if>
  164. <if test="updateTime != null" >
  165. and c.update_time = #{updateTime,jdbcType=INTEGER}
  166. </if>
  167. <choose>
  168. <when test="status !=null and status != ''">
  169. and c.status = #{status,jdbcType=TINYINT}
  170. </when>
  171. <otherwise>
  172. and c.status != 0
  173. </otherwise>
  174. </choose>
  175. </select>
  176. </mapper>