|
@@ -10,6 +10,7 @@
|
|
|
<result column="id_" property="id" />
|
|
|
<result column="extracurricular_exercises_id_" property="extracurricularExercisesId" />
|
|
|
<result column="user_id_" property="userId" />
|
|
|
+ <result column="username_" property="user.username" />
|
|
|
<result column="attachments_" property="attachments" />
|
|
|
<result column="create_time_" property="createTime" />
|
|
|
<result column="update_time_" property="updateTime" />
|
|
@@ -27,6 +28,26 @@
|
|
|
<result column="content_" property="content"/>
|
|
|
<result column="expire_date_" property="expireDate"/>
|
|
|
</resultMap>
|
|
|
+
|
|
|
+ <sql id="queryPageCondition">
|
|
|
+ <where>
|
|
|
+ <if test="teacherId != null">
|
|
|
+ teacher_id_ = #{teacherId}
|
|
|
+ </if>
|
|
|
+ <if test="studentId != null">
|
|
|
+ user_id_ = #{studentId}
|
|
|
+ </if>
|
|
|
+ <if test="title != null">
|
|
|
+ title_ = #{title}
|
|
|
+ </if>
|
|
|
+ <if test="submitStartTime != null">
|
|
|
+ AND eer.create_time_ >= #{submitStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="submitEndTime != null">
|
|
|
+ AND eer.create_time_ <= #{submitEndTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<select id="get" resultMap="ExtracurricularExercisesReply" >
|
|
@@ -97,13 +118,18 @@
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="ExtracurricularExercisesReply" parameterType="map">
|
|
|
- SELECT * FROM extracurricular_exercises_reply ORDER BY id_ <include refid="global.limit"/>
|
|
|
+ SELECT eer.*,u.username_ FROM extracurricular_exercises_reply eer left join extracurricular_exercises ee on eer.extracurricular_exercises_id_ = ee.id_
|
|
|
+ left join sys_user u on eer.user_id_ = u.id_
|
|
|
+ <include refid="queryPageCondition"/>
|
|
|
+ ORDER BY eer.id_ <include refid="global.limit"/>
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*) FROM extracurricular_exercises_reply
|
|
|
+ SELECT COUNT(eer.id_) FROM extracurricular_exercises_reply eer left join extracurricular_exercises ee on eer.extracurricular_exercises_id_ = ee.id_
|
|
|
+ <include refid="queryPageCondition"/>
|
|
|
</select>
|
|
|
+
|
|
|
<select id="findExtraExerciseStudents" resultMap="ExtraExerciseStudentsDto">
|
|
|
SELECT
|
|
|
eer.*,
|