|
@@ -15,6 +15,12 @@
|
|
|
<result column="pay_time_" property="payTime" />
|
|
|
<result column="update_time_" property="updateTime" />
|
|
|
<result column="create_time_" property="createTime" />
|
|
|
+ <association property="sysUser" javaType="com.ym.mec.auth.api.entity.SysUser">
|
|
|
+ <result column="username_" property="username" />
|
|
|
+ </association>
|
|
|
+ <association property="student" javaType="com.ym.mec.biz.dal.entity.Student">
|
|
|
+ <result column="subject_names_" property="subjectNames" />
|
|
|
+ </association>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -85,6 +91,38 @@
|
|
|
</set>
|
|
|
WHERE id_ = #{id}
|
|
|
</update>
|
|
|
+ <update id="batchUpdate">
|
|
|
+ <foreach collection="calenderDetails" item="item" index="index" open="" close="" separator=";">
|
|
|
+ UPDATE music_group_payment_calender_detail
|
|
|
+ <set>
|
|
|
+ <if test="item.userId != null">
|
|
|
+ user_id_ = #{item.userId},
|
|
|
+ </if>
|
|
|
+ <if test="item.userStatus != null">
|
|
|
+ user_status_ = #{item.userStatus},
|
|
|
+ </if>
|
|
|
+ <if test="item.paymentStatus != null">
|
|
|
+ payment_status_ = #{item.paymentStatus},
|
|
|
+ </if>
|
|
|
+ <if test="item.expectAmount != null">
|
|
|
+ expect_amount_ = #{item.expectAmount},
|
|
|
+ </if>
|
|
|
+ <if test="item.updateTime != null">
|
|
|
+ update_time_ = #{item.updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="item.musicGroupPaymentCalenderId != null">
|
|
|
+ music_group_payment_calender_id_ = #{item.musicGroupPaymentCalenderId},
|
|
|
+ </if>
|
|
|
+ <if test="item.actualAmount != null">
|
|
|
+ actual_amount_ = #{item.actualAmount},
|
|
|
+ </if>
|
|
|
+ <if test="item.payTime != null">
|
|
|
+ pay_time_ = #{item.payTime}
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ WHERE id_ = #{item.id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
|
<delete id="delete">
|
|
@@ -94,30 +132,47 @@
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="MusicGroupPaymentCalenderDetail"
|
|
|
parameterType="map">
|
|
|
- SELECT * FROM music_group_payment_calender_detail
|
|
|
+ SELECT mgpc.*,su.username_,GROUP_CONCAT(DISTINCT st.name_) subject_names_
|
|
|
+ FROM music_group_payment_calender_detail mgpc
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = mgpc.user_id_
|
|
|
+ LEFT JOIN student s ON s.user_id_ = mgpc.user_id_
|
|
|
+ LEFT JOIN `subject` st ON FIND_IN_SET(st.id_,s.subject_id_list_)
|
|
|
<where>
|
|
|
<if test="userId != null">
|
|
|
- user_id_ = #{userId}
|
|
|
+ mgpc.user_id_ = #{userId}
|
|
|
</if>
|
|
|
<if test="paymentStatus != null">
|
|
|
- payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
+ mgpc.payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
+ </if>
|
|
|
+ <if test="subjectId != null">
|
|
|
+ FIND_IN_SET(#{subjectId},s.subject_id_list_)
|
|
|
</if>
|
|
|
</where>
|
|
|
- ORDER BY create_time_
|
|
|
+ GROUP BY mgpc.id_
|
|
|
+ ORDER BY mgpc.create_time_
|
|
|
<include refid="global.limit" />
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*) FROM music_group_payment_calender_detail
|
|
|
+ SELECT COUNT(mgpc.id_) FROM music_group_payment_calender_detail mgpc
|
|
|
+ LEFT JOIN student s ON s.user_id_ = mgpc.user_id_
|
|
|
+ LEFT JOIN `subject` st ON FIND_IN_SET(st.id_,s.subject_id_list_)
|
|
|
<where>
|
|
|
<if test="userId != null">
|
|
|
user_id_ = #{userId}
|
|
|
</if>
|
|
|
+ <if test="subjectId != null">
|
|
|
+ FIND_IN_SET(#{subjectId},s.subject_id_list_)
|
|
|
+ </if>
|
|
|
<if test="paymentStatus != null">
|
|
|
payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
</if>
|
|
|
</where>
|
|
|
+ GROUP BY mgpc.id_
|
|
|
+ </select>
|
|
|
+ <select id="queryListByIds" resultMap="MusicGroupPaymentCalenderDetail">
|
|
|
+ SELECT * FROM music_group_payment_calender_detail WHERE FIND_IN_SET(id_,#{ids})
|
|
|
</select>
|
|
|
|
|
|
<select id="queryByCalenderId" resultMap="MusicGroupPaymentCalenderDetail">
|