|
|
@@ -885,19 +885,29 @@ and
|
|
|
</select>
|
|
|
<select id="getLibrary" resultType="java.util.Map">
|
|
|
SELECT
|
|
|
- COUNT( a.business_library_type ) AS total,
|
|
|
- IFNULL( sum( IF ( a.business_library_type = 1, 1, 0 )), 0 ) AS one,
|
|
|
- IFNULL( SUM( IF ( a.business_library_type = 2, 1, 0 )), 0 ) AS two,
|
|
|
- IFNULL( SUM( IF ( a.business_library_type = 3, 1, 0 )), 0 ) AS three,
|
|
|
- IFNULL( SUM( IF ( a.business_library_type = 4, 1, 0 )), 0 ) AS four
|
|
|
+ sum( a.yywd + a.zxywk ) AS total,
|
|
|
+ a.one,
|
|
|
+ a.two,
|
|
|
+ a.three,
|
|
|
+ a.four
|
|
|
FROM
|
|
|
- sys_org_extend a
|
|
|
- LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
- where
|
|
|
- 1=1
|
|
|
- and b.path LIKE concat(#{orgPath}, '%')
|
|
|
- and b.is_lock = 0
|
|
|
- and b.deleted = 0
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ IFNULL( sum( IF ( b.type = 6, 1, 0 )), 0 ) AS yywd,
|
|
|
+ IFNULL( sum( IF ( b.type = 4 AND a.business_library = 1, 1, 0 )), 0 ) AS zxywk,
|
|
|
+ IFNULL( sum( IF ( a.business_library_type = 1, 1, 0 )), 0 ) AS one,
|
|
|
+ IFNULL( SUM( IF ( a.business_library_type = 2, 1, 0 )), 0 ) AS two,
|
|
|
+ IFNULL( SUM( IF ( a.business_library_type = 3, 1, 0 )), 0 ) AS three,
|
|
|
+ IFNULL( SUM( IF ( a.business_library_type = 4, 1, 0 )), 0 ) AS four
|
|
|
+ FROM
|
|
|
+ sys_org b
|
|
|
+ LEFT JOIN sys_org_extend a ON a.org_id = b.id
|
|
|
+ WHERE
|
|
|
+ b.is_lock = 0
|
|
|
+ and b.path LIKE concat(#{orgPath}, '%')
|
|
|
+ and b.deleted = 0
|
|
|
+ AND (b.type = 4 OR b.type = 5 OR b.type = 6)
|
|
|
+ ) a
|
|
|
</select>
|
|
|
<select id="getCollectLibrary" resultType="java.lang.Integer">
|
|
|
SELECT
|