|
@@ -364,27 +364,67 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="homeworkIndex" resultType="java.util.Map">
|
|
|
- select t11.vip_id,t.id,t12.child_name,t12.grade,t13.league_name,t12.school,count(1) as pictureCount,group_concat(t11.file_key) as file_keys,t11.create_time,t.`subject`
|
|
|
- ,count(IF(t11.corrected_picture_url is not null,true,null)) as correctedCount,group_concat(t11.corrected_picture_url) as corrected_keys
|
|
|
- ,count(IF(t.subject='语文',true,null)) as count1,count(IF(t.subject='数学',true,null)) as count2,count(IF(t.subject='英语',true,null)) as count3
|
|
|
- from scon_homework t
|
|
|
- left join scon_homework_picture t11 on t.id = t11.homework_id
|
|
|
- left join tb_lib_vip t12 on t11.vip_id = t12.id
|
|
|
- left join tb_lib_join t13 on t12.lib_id = t13.id
|
|
|
- where
|
|
|
- t12.lib_id=#{libId} and t11.is_delete = 0
|
|
|
- <if test="queryDate !=null and queryDate!=''">
|
|
|
- and t11.create_time >= #{queryDate}
|
|
|
- </if>
|
|
|
- <if test="queryEndDate !=null and queryEndDate!=''">
|
|
|
- and #{queryEndDate} >=t11.create_time
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="searchValue != '' ">
|
|
|
- and t12.child_name regexp #{searchValue}
|
|
|
- </if>
|
|
|
- group by t11.vip_id
|
|
|
- order by t.subject,t11.create_time desc
|
|
|
+ SELECT
|
|
|
+ a.vip_id,
|
|
|
+ a.id,
|
|
|
+ a.child_name,
|
|
|
+ a.grade,
|
|
|
+ a.league_name,
|
|
|
+ a.school,
|
|
|
+ count( 1 ) AS pictureCount,
|
|
|
+ group_concat( a.file_key ) AS file_keys,
|
|
|
+ a.create_time,
|
|
|
+ a.`subject`,
|
|
|
+ count(
|
|
|
+ IF
|
|
|
+ ( a.corrected_picture_url IS NOT NULL, TRUE, NULL )) AS correctedCount,
|
|
|
+ group_concat( a.corrected_picture_url ) AS corrected_keys,
|
|
|
+ count(
|
|
|
+ IF
|
|
|
+ ( a.SUBJECT = '语文', TRUE, NULL )) AS count1,
|
|
|
+ count(
|
|
|
+ IF
|
|
|
+ ( a.SUBJECT = '数学', TRUE, NULL )) AS count2,
|
|
|
+ count(
|
|
|
+ IF
|
|
|
+ ( a.SUBJECT = '英语', TRUE, NULL )) AS count3
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ t11.vip_id,
|
|
|
+ t.id,
|
|
|
+ t12.child_name,
|
|
|
+ t12.grade,
|
|
|
+ t13.league_name,
|
|
|
+ t12.school,
|
|
|
+ t11.file_key,
|
|
|
+ DATE_FORMAT( t11.create_time, '%Y-%m-%d' ) AS create_time,
|
|
|
+ t.`subject`,
|
|
|
+ t11.corrected_picture_url
|
|
|
+ FROM
|
|
|
+ scon_homework t
|
|
|
+ LEFT JOIN scon_homework_picture t11 ON t.id = t11.homework_id
|
|
|
+ LEFT JOIN tb_lib_vip t12 ON t11.vip_id = t12.id
|
|
|
+ LEFT JOIN tb_lib_join t13 ON t12.lib_id = t13.id
|
|
|
+ WHERE
|
|
|
+ t12.lib_id = #{libId}
|
|
|
+ AND t11.is_delete = 0
|
|
|
+ <if test="queryDate !=null and queryDate!=''">
|
|
|
+ AND to_days(t11.create_time) >= TO_DAYS(#{queryDate})
|
|
|
+ </if>
|
|
|
+ <if test="queryEndDate !=null and queryEndDate!=''">
|
|
|
+ AND to_days( #{queryEndDate} ) >= to_days( t11.create_time )
|
|
|
+ </if>
|
|
|
+ <if test="searchValue != '' ">
|
|
|
+ and t12.child_name regexp #{searchValue}
|
|
|
+ </if>
|
|
|
+ ) a
|
|
|
+ GROUP BY
|
|
|
+ a.create_time,
|
|
|
+ a.vip_id
|
|
|
+ ORDER BY
|
|
|
+ a.SUBJECT,
|
|
|
+ a.create_time DESC
|
|
|
</select>
|
|
|
|
|
|
<select id="findPageStudentList" resultType="java.util.Map">
|