parent
							
								
									2d0adc8258
								
							
						
					
					
						commit
						e9403316d8
					
				| 
						 | 
				
			
			@ -115,7 +115,7 @@
 | 
			
		|||
        ) d LEFT JOIN (
 | 
			
		||||
        SELECT
 | 
			
		||||
        statistic_date,
 | 
			
		||||
--         CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(concat(g.ancestors, ','),',', #{param.orgLevel}  + 1), ',', -1) as SIGNED) as a_org_id,
 | 
			
		||||
        CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(concat(g.ancestors, ','),',', #{param.orgLevel}  + 1), ',', -1) as SIGNED) as a_org_id,
 | 
			
		||||
        sum( consume_num ) AS consume_num,
 | 
			
		||||
        sum( consume_amount ) AS consume_amount,
 | 
			
		||||
        sum( consume_repair_num ) AS consume_repair_num,
 | 
			
		||||
| 
						 | 
				
			
			@ -128,10 +128,16 @@
 | 
			
		|||
        LEFT JOIN sys_dept g on g.dept_id = a.org_id
 | 
			
		||||
        <where>
 | 
			
		||||
            AND a.statistic_date BETWEEN #{param.startDate} AND #{param.endDate}
 | 
			
		||||
            and g.dept_id in
 | 
			
		||||
                <foreach collection="param.orgIdList" item="orgId" separator="," open="(" close=")">
 | 
			
		||||
                    #{orgId}
 | 
			
		||||
            <if test="param.orgIdList != null and param.orgIdList.size() > 0">
 | 
			
		||||
                and (
 | 
			
		||||
                <foreach collection="param.orgIdList" item="orgId" separator=" or " open=""
 | 
			
		||||
                         close="">
 | 
			
		||||
                    g.ancestors like concat('', #{orgId}, ',%')
 | 
			
		||||
                    or g.ancestors like concat('%,', #{orgId}, ',%')
 | 
			
		||||
                    or g.ancestors like concat('%,', #{orgId}, '')
 | 
			
		||||
                </foreach>
 | 
			
		||||
                )
 | 
			
		||||
            </if>
 | 
			
		||||
            <if test="'2'.toString() == authPO.roleType.toString()">
 | 
			
		||||
                and EXISTS (
 | 
			
		||||
                SELECT null
 | 
			
		||||
| 
						 | 
				
			
			@ -282,10 +288,16 @@
 | 
			
		|||
        LEFT JOIN sys_dept g on g.dept_id = a.org_id
 | 
			
		||||
        <where>
 | 
			
		||||
            AND a.statistic_date BETWEEN #{param.startDate} AND #{param.endDate}
 | 
			
		||||
            and g.dept_id in
 | 
			
		||||
            <foreach collection="param.orgIdList" item="orgId" separator="," open="(" close=")">
 | 
			
		||||
                #{orgId}
 | 
			
		||||
            </foreach>
 | 
			
		||||
            <if test="param.orgIdList != null and param.orgIdList.size() > 0">
 | 
			
		||||
                and (
 | 
			
		||||
                <foreach collection="param.orgIdList" item="orgId" separator=" or " open=""
 | 
			
		||||
                         close="">
 | 
			
		||||
                    g.ancestors like concat('', #{orgId}, ',%')
 | 
			
		||||
                    or g.ancestors like concat('%,', #{orgId}, ',%')
 | 
			
		||||
                    or g.ancestors like concat('%,', #{orgId}, '')
 | 
			
		||||
                </foreach>
 | 
			
		||||
                )
 | 
			
		||||
            </if>
 | 
			
		||||
            <if test="'2'.toString() == authPO.roleType.toString()">
 | 
			
		||||
                and EXISTS (
 | 
			
		||||
                SELECT null
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue