|
@@ -15,6 +15,7 @@
|
|
|
<result column="cover_img_" property="coverImg" />
|
|
|
<result column="operator_id_" property="operatorId" />
|
|
|
<result column="order_" property="order" />
|
|
|
+ <result column="organ_name_" property="organNames" />
|
|
|
<result column="create_time_" property="createTime" />
|
|
|
<result column="update_time_" property="updateTime" />
|
|
|
</resultMap>
|
|
@@ -94,6 +95,9 @@
|
|
|
</set> WHERE id_ = #{bean.id}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
+ <update id="enable">
|
|
|
+ UPDATE sys_music_score_categories SET enable_ = #{enable} WHERE FIND_IN_SET(id_,#{categoriesIds})
|
|
|
+ </update>
|
|
|
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
|
<delete id="delete" >
|
|
@@ -105,13 +109,37 @@
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="SysMusicScoreCategories" parameterType="map">
|
|
|
- SELECT * FROM sys_music_score_categories ORDER BY id_
|
|
|
+ SELECT sm.*,GROUP_CONCAT(o.name_) organ_name_ FROM sys_music_score_categories sm
|
|
|
+ LEFT JOIN organization o ON FIND_IN_SET(o.id_,sm.organ_id_)
|
|
|
+ <where>
|
|
|
+ <if test="parentId != null">
|
|
|
+ sm.parent_id_ = #{parentId}
|
|
|
+ </if>
|
|
|
+ <if test="enable != null">
|
|
|
+ AND sm.enable_ = 1
|
|
|
+ </if>
|
|
|
+ <if test="search != null and search != ''">
|
|
|
+ AND (sm.id_ = #{search} OR sm.name_ LIKE CONCAT('%',#{search},'%'))
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ GROUP BY sm.id_
|
|
|
<include refid="global.limit"/>
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*) FROM sys_music_score_categories
|
|
|
+ SELECT COUNT(sm.id_) FROM sys_music_score_categories sm
|
|
|
+ <where>
|
|
|
+ <if test="parentId != null">
|
|
|
+ sm.parent_id_ = #{parentId}
|
|
|
+ </if>
|
|
|
+ <if test="enable != null">
|
|
|
+ AND sm.enable_ = 1
|
|
|
+ </if>
|
|
|
+ <if test="search != null and search != ''">
|
|
|
+ AND sm.id_ = #{search} OR sm.name_ LIKE CONCAT('%',#{search},'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
<select id="findByParentId" resultMap="SysMusicScoreCategories">
|
|
|
SELECT sm.* FROM sys_music_score_categories sm
|