|
@@ -69,25 +69,22 @@
|
|
|
|
|
|
<select id="listScanStat" resultType="com.qmth.paper.library.business.bean.result.ScanStatResult">
|
|
|
SELECT
|
|
|
- concat( u.login_name, '(', u.real_name, ')' ) scanner,
|
|
|
+ concat( su.login_name, '(', su.real_name, ')' ) scanner,
|
|
|
p.create_id createId,
|
|
|
p.create_date scanDateStr,
|
|
|
- count( 1 ) pictureCount
|
|
|
+ count( 1 ) pictureCount,
|
|
|
+ COUNT( DISTINCT p.student_id ) studentCount
|
|
|
FROM
|
|
|
- paper_library p,
|
|
|
- sys_user u
|
|
|
- WHERE
|
|
|
- p.school_id = #{schoolId}
|
|
|
- AND p.create_id = u.id
|
|
|
- <if test="userId != null">
|
|
|
- and u.id=#{userId}
|
|
|
- </if>
|
|
|
- <if test="scanDate != null and scanDate != ''">
|
|
|
- and p.create_date=#{scanDate}
|
|
|
- </if>
|
|
|
+ paper_library p left join sys_user su on p.create_id = su.id
|
|
|
+ where p.school_id = #{schoolId}
|
|
|
+ <if test="userId != null">
|
|
|
+ and p.create_id=#{userId}
|
|
|
+ </if>
|
|
|
+ <if test="scanDate != null and scanDate != ''">
|
|
|
+ and p.create_date=#{scanDate}
|
|
|
+ </if>
|
|
|
GROUP BY
|
|
|
- u.login_name,
|
|
|
- p.create_id,
|
|
|
+ p.create_id,
|
|
|
p.create_date
|
|
|
ORDER BY
|
|
|
p.create_date
|