|
@@ -371,7 +371,7 @@
|
|
a.grade,
|
|
a.grade,
|
|
a.league_name,
|
|
a.league_name,
|
|
a.school,
|
|
a.school,
|
|
- count( 1 ) AS pictureCount,
|
|
|
|
|
|
+ count( if(a.id is not null,true,null) ) AS pictureCount,
|
|
group_concat( a.file_key ) AS file_keys,
|
|
group_concat( a.file_key ) AS file_keys,
|
|
a.create_time,
|
|
a.create_time,
|
|
a.`subject`,
|
|
a.`subject`,
|
|
@@ -391,30 +391,34 @@
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
- t11.vip_id,
|
|
|
|
- t.id,
|
|
|
|
|
|
+ t12.id as vip_id,
|
|
|
|
+ t11.id,
|
|
t12.child_name,
|
|
t12.child_name,
|
|
t12.grade,
|
|
t12.grade,
|
|
t13.league_name,
|
|
t13.league_name,
|
|
t12.school,
|
|
t12.school,
|
|
- t11.file_key,
|
|
|
|
- DATE_FORMAT( t11.create_time, '%Y-%m-%d' ) AS create_time,
|
|
|
|
- t.`subject`,
|
|
|
|
- t11.corrected_picture_url
|
|
|
|
|
|
+ t11.`subject`,
|
|
|
|
+ t11.create_time,
|
|
|
|
+ t11.corrected_picture_url,
|
|
|
|
+ t11.file_key
|
|
FROM
|
|
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
|
|
|
|
|
|
+ tb_lib_vip t12
|
|
|
|
+ left join
|
|
|
|
+ (
|
|
|
|
+ SELECT DATE_FORMAT( t11.create_time, '%Y-%m-%d' ) AS create_time, t11.corrected_picture_url, t11.file_key,t.id,t11.vip_id,t.`subject`
|
|
|
|
+ from scon_homework_picture t11
|
|
|
|
+ LEFT JOIN scon_homework t ON t.id = t11.homework_id
|
|
|
|
+ where t11.is_delete = 0
|
|
<if test="queryDate !=null and queryDate!=''">
|
|
<if test="queryDate !=null and queryDate!=''">
|
|
- AND to_days(t11.create_time) >= TO_DAYS(#{queryDate})
|
|
|
|
|
|
+ AND to_days(t11.create_time) >= TO_DAYS(#{queryDate})
|
|
</if>
|
|
</if>
|
|
<if test="queryEndDate !=null and queryEndDate!=''">
|
|
<if test="queryEndDate !=null and queryEndDate!=''">
|
|
- AND to_days( #{queryEndDate} ) >= to_days( t11.create_time )
|
|
|
|
|
|
+ AND to_days( #{queryEndDate} ) >= to_days( t11.create_time )
|
|
</if>
|
|
</if>
|
|
|
|
+ )t11 on t12.id = t11.vip_id
|
|
|
|
+ LEFT JOIN tb_lib_join t13 ON t12.lib_id = t13.id
|
|
|
|
+ WHERE
|
|
|
|
+ t12.lib_id = #{libId}
|
|
<if test="searchValue != '' ">
|
|
<if test="searchValue != '' ">
|
|
and t12.child_name regexp #{searchValue}
|
|
and t12.child_name regexp #{searchValue}
|
|
</if>
|
|
</if>
|
|
@@ -424,8 +428,8 @@
|
|
a.vip_id
|
|
a.vip_id
|
|
ORDER BY
|
|
ORDER BY
|
|
a.vip_id,
|
|
a.vip_id,
|
|
- a.SUBJECT,
|
|
|
|
- a.create_time DESC
|
|
|
|
|
|
+ a.create_time DESC,
|
|
|
|
+ a.SUBJECT
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="findPageStudentList" resultType="java.util.Map">
|
|
<select id="findPageStudentList" resultType="java.util.Map">
|