|
@@ -99,6 +99,8 @@
|
|
|
LEFT JOIN organization o ON o.id_ = cdr.organ_id_
|
|
|
<include refid="queryChildrenStatisticsSql"/>
|
|
|
GROUP BY cdr.music_group_id_
|
|
|
+ ORDER BY cdr.id_ DESC
|
|
|
+ <include refid="global.limit"/>
|
|
|
</select>
|
|
|
<select id="countChildrenStatistics" resultType="java.lang.Integer">
|
|
|
SELECT COUNT(cdr.id_)
|
|
@@ -125,4 +127,34 @@
|
|
|
FROM children_day_reserve
|
|
|
WHERE user_id_ = #{userId}
|
|
|
</select>
|
|
|
+
|
|
|
+ <resultMap id="ChildrenStatisticsDetailDtoMap" type="com.ym.mec.biz.dal.dto.ChildrenStatisticsDetailDto">
|
|
|
+ <result property="username" column="username_"/>
|
|
|
+ <result property="userId" column="user_id_"/>
|
|
|
+ <result property="isReserve" column="is_reserve_"/>
|
|
|
+ <result property="phone" column="phone_"/>
|
|
|
+ </resultMap>
|
|
|
+ <select id="countChildrenStatisticsDetail" resultType="java.lang.Integer">
|
|
|
+ SELECT COUNT(cdr.id_) FROM children_day_reserve cdr
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = cdr.user_id_
|
|
|
+ <include refid="queryChildrenStatisticsDetailSql"/>
|
|
|
+ </select>
|
|
|
+ <select id="queryChildrenStatisticsDetail" resultMap="ChildrenStatisticsDetailDtoMap">
|
|
|
+ SELECT su.username_,su.phone_,cdr.user_id_,cdr.is_reserve_
|
|
|
+ FROM children_day_reserve cdr
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = cdr.user_id_
|
|
|
+ <include refid="queryChildrenStatisticsDetailSql"/>
|
|
|
+ ORDER BY cdr.create_time_ DESC
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+ <sql id="queryChildrenStatisticsDetailSql">
|
|
|
+ <where>
|
|
|
+ <if test="search != null and search != ''">
|
|
|
+ AND (cdr.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="isReserve != null">
|
|
|
+ AND cdr.is_reserve_ = #{isReserve}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
</mapper>
|