|
@@ -17,6 +17,8 @@
|
|
|
<result column="update_time_" property="updateTime" />
|
|
|
<result column="vip_group_category_id_list_" property="vipGroupCategoryIdList" />
|
|
|
<result column="teacher_id_" property="teacherId" />
|
|
|
+ <result column="subject_id_" property="subjectIds" />
|
|
|
+ <result column="subject_name_" property="subjectName" />
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -35,9 +37,9 @@
|
|
|
<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
|
|
|
AS ID FROM DUAL </selectKey> -->
|
|
|
INSERT INTO course_schedule_rewards_rules
|
|
|
- (id_,name_,course_schedule_type_,reward_mode_,organ_id_,rewards_rules_json_,create_time_,update_time_,vip_group_category_id_list_,teacher_id_)
|
|
|
+ (id_,name_,course_schedule_type_,reward_mode_,organ_id_,rewards_rules_json_,create_time_,update_time_,vip_group_category_id_list_,teacher_id_,subject_id_)
|
|
|
VALUES(#{id},#{name},#{courseScheduleType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- #{rewardMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{organId},#{rewardsRulesJson},now(),now(),#{vipGroupCategoryIdList},#{teacherId})
|
|
|
+ #{rewardMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{organId},#{rewardsRulesJson},now(),now(),#{vipGroupCategoryIdList},#{teacherId},#{subjectIds})
|
|
|
</insert>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -58,8 +60,8 @@
|
|
|
<if test="teacherId != null">
|
|
|
teacher_id_ = #{teacherId},
|
|
|
</if>
|
|
|
- <if test="id != null">
|
|
|
- id_ = #{id},
|
|
|
+ <if test="subjectIds != null">
|
|
|
+ subject_id_ = #{subjectIds},
|
|
|
</if>
|
|
|
<if test="updateTime != null">
|
|
|
update_time_ = now(),
|
|
@@ -73,9 +75,6 @@
|
|
|
<if test="rewardsRulesJson != null">
|
|
|
rewards_rules_json_ = #{rewardsRulesJson},
|
|
|
</if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time_ = #{createTime},
|
|
|
- </if>
|
|
|
</set>
|
|
|
WHERE id_ = #{id}
|
|
|
</update>
|
|
@@ -98,7 +97,8 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="query" resultType="map">
|
|
|
- SELECT * FROM course_schedule_rewards_rules where find_in_set(#{organId},organ_id_) and course_schedule_type_ = #{courseScheduleType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} order by update_time_ desc
|
|
|
+ SELECT * FROM course_schedule_rewards_rules WHERE find_in_set(#{organId},organ_id_)
|
|
|
+ AND course_schedule_type_ = #{courseScheduleType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} ORDER BY update_time_ DESC
|
|
|
</select>
|
|
|
|
|
|
<select id="queryOrganIdList" resultType="java.lang.String">
|
|
@@ -108,12 +108,14 @@
|
|
|
SELECT * FROM course_schedule_rewards_rules csrr
|
|
|
WHERE INTE_ARRAY(csrr.vip_group_category_id_list_,#{vipGroupCategoryIdList})
|
|
|
AND INTE_ARRAY(csrr.teacher_id_,#{teacherId})
|
|
|
+ AND INTE_ARRAY(csrr.subject_id_,#{subjectIds})
|
|
|
</select>
|
|
|
|
|
|
<select id="queryDetailPage" resultMap="CourseScheduleRewardsRules">
|
|
|
- SELECT * FROM course_schedule_rewards_rules csrr
|
|
|
+ SELECT GROUP_CONCAT(s.name_) subject_name_,csrr.* FROM course_schedule_rewards_rules csrr
|
|
|
+ LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,csrr.subject_id_)
|
|
|
<include refid="findDetailPageSql"/>
|
|
|
- ORDER BY id_ DESC
|
|
|
+ GROUP BY csrr.id_ ORDER BY csrr.id_ DESC
|
|
|
<include refid="global.limit" />
|
|
|
</select>
|
|
|
<select id="findDetailPage" resultType="java.lang.Integer">
|
|
@@ -163,6 +165,9 @@
|
|
|
<if test="teacherId">
|
|
|
AND FIND_IN_SET(#{teacherId},csrr.teacher_id_)
|
|
|
</if>
|
|
|
+ <if test="subjectId">
|
|
|
+ AND FIND_IN_SET(#{subjectId},csrr.subject_id_)
|
|
|
+ </if>
|
|
|
<if test="search">
|
|
|
AND csrr.name_ LIKE CONCAT('%',#{search},'%')
|
|
|
</if>
|