|
@@ -11,6 +11,7 @@
|
|
<result column="song_name_" property="songName" />
|
|
<result column="song_name_" property="songName" />
|
|
<result column="song_author_" property="songAuthor" />
|
|
<result column="song_author_" property="songAuthor" />
|
|
<result column="subject_list_" property="subjectList" />
|
|
<result column="subject_list_" property="subjectList" />
|
|
|
|
+ <result column="subject_names_" property="subjectNames" />
|
|
<result column="level_list_" property="levelList" />
|
|
<result column="level_list_" property="levelList" />
|
|
<result column="type_" property="type" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
|
|
<result column="type_" property="type" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
|
|
<result column="file_url_list_" property="fileUrlList" />
|
|
<result column="file_url_list_" property="fileUrlList" />
|
|
@@ -80,27 +81,29 @@
|
|
|
|
|
|
<sql id="queryCondition">
|
|
<sql id="queryCondition">
|
|
<where>
|
|
<where>
|
|
- del_flag_=0 AND tenant_id_ = #{tenantId}
|
|
|
|
|
|
+ es.del_flag_=0 AND es.tenant_id_ = #{tenantId}
|
|
<if test="subjectList!=null">
|
|
<if test="subjectList!=null">
|
|
- AND FIND_IN_SET(#{subjectList}, subject_list_)
|
|
|
|
|
|
+ AND FIND_IN_SET(#{subjectList}, es.subject_list_)
|
|
</if>
|
|
</if>
|
|
<if test="search!=null">
|
|
<if test="search!=null">
|
|
- AND (id_=#{search} OR song_name_ LIKE CONCAT('%', #{search}, '%'))
|
|
|
|
|
|
+ AND (es.id_=#{search} OR es.song_name_ LIKE CONCAT('%', #{search}, '%'))
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
<!-- 分页查询 -->
|
|
<select id="queryPage" resultMap="ExamSong" parameterType="map">
|
|
<select id="queryPage" resultMap="ExamSong" parameterType="map">
|
|
- SELECT * FROM exam_song
|
|
|
|
|
|
+ SELECT es.*,GROUP_CONCAT(s.name_) subject_names_ FROM exam_song es
|
|
|
|
+ LEFT JOIN subject s ON FIND_IN_SET(s.id_, es.subject_list_)
|
|
<include refid="queryCondition"/>
|
|
<include refid="queryCondition"/>
|
|
|
|
+ GROUP BY es.id_
|
|
ORDER BY id_
|
|
ORDER BY id_
|
|
<include refid="global.limit"/>
|
|
<include refid="global.limit"/>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
<!-- 查询当前表的总记录数 -->
|
|
<select id="queryCount" resultType="int">
|
|
<select id="queryCount" resultType="int">
|
|
- SELECT COUNT(*) FROM exam_song
|
|
|
|
|
|
+ SELECT COUNT(*) FROM exam_song es
|
|
<include refid="queryCondition"/>
|
|
<include refid="queryCondition"/>
|
|
</select>
|
|
</select>
|
|
<select id="getExamSongs" resultMap="ExamSong">
|
|
<select id="getExamSongs" resultMap="ExamSong">
|