|
@@ -51,25 +51,59 @@
|
|
|
</if>
|
|
</if>
|
|
|
<!--按机构下钻时-->
|
|
<!--按机构下钻时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
|
- <choose>
|
|
|
|
|
- <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
|
|
|
|
|
- p.deptid,
|
|
|
|
|
- </when>
|
|
|
|
|
- <!--下钻的非五级机构时,下钻到下级机构-->
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- substr(p.deptid,1,#{reportReqVo.drilFlag}) institutionId,
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
|
|
+ <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ p.deptid,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,11) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,8) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,6) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,4) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,2) institutionId,
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
- <!--团队返回上层时-->
|
|
|
|
|
|
|
+ <!--返回上层时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
|
- p.deptid,
|
|
|
|
|
- </if>
|
|
|
|
|
- <!--机构返回上层时-->
|
|
|
|
|
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
|
|
|
|
|
- substr(p.deptid,1,#{reportReqVo.drilFlag}) institutionId,
|
|
|
|
|
|
|
+ <!--返回的是五级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,11) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,8) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,6) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,4) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,2) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,1) institutionId,
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+
|
|
|
</if>
|
|
</if>
|
|
|
<if test="reportReqVo.riskCode != null and reportReqVo.riskCode != ''">
|
|
<if test="reportReqVo.riskCode != null and reportReqVo.riskCode != ''">
|
|
|
<if test="reportReqVo.riskCode!='ALL'.toString()">
|
|
<if test="reportReqVo.riskCode!='ALL'.toString()">
|
|
@@ -93,25 +127,57 @@
|
|
|
</if>
|
|
</if>
|
|
|
<!--按机构下钻时-->
|
|
<!--按机构下钻时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
|
- <choose>
|
|
|
|
|
- <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
|
|
|
|
|
- and p.deptid in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
- </when>
|
|
|
|
|
- <!--下钻的非五级机构时,下钻到下级机构-->
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- and substr(p.deptid,1,#{reportReqVo.drilFlag}) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
|
|
+ <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ and p.deptid in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,11) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,8) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,6) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,4) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,2) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
-
|
|
|
|
|
- <!--团队返回上层时-->
|
|
|
|
|
|
|
+ <!--返回上层时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
|
- and p.deptid = #{reportReqVo.deptId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <!--机构返回上层时-->
|
|
|
|
|
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
|
|
|
|
|
- and substr(p.deptid,1,#{reportReqVo.drilFlag}) = #{reportReqVo.deptId}
|
|
|
|
|
|
|
+ <!--返回的是五级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,8) = #{reportReqVo.deptId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,6) = #{reportReqVo.deptId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,4) = #{reportReqVo.deptId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,2) = #{reportReqVo.deptId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,1) = #{reportReqVo.deptId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,1) = #{reportReqVo.deptId}
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
<!--非下钻查询时拼接-->
|
|
<!--非下钻查询时拼接-->
|
|
@@ -156,24 +222,57 @@
|
|
|
</if>
|
|
</if>
|
|
|
<!--按机构下钻时-->
|
|
<!--按机构下钻时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
|
- <choose>
|
|
|
|
|
- <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
|
|
|
|
|
- ,p.deptid order by p.deptid,p.`risk_name`
|
|
|
|
|
- </when>
|
|
|
|
|
- <!--下钻的非五级机构时,下钻到下级机构-->
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- ,substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag}),p.`risk_name`
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
|
|
+ <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ ,p.deptid order by p.deptid,p.`risk_name`
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,11) order by substr(p.deptid,1,11),p.`risk_name`
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,8) order by substr(p.deptid,1,8),p.`risk_name`
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,6) order by substr(p.deptid,1,6),p.`risk_name`
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,4) order by substr(p.deptid,1,4),p.`risk_name`
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,2) order by substr(p.deptid,1,2),p.`risk_name`
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
- <!--团队返回上层时-->
|
|
|
|
|
|
|
+ <!--返回上层时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
|
- ,p.deptid order by p.deptid
|
|
|
|
|
- </if>
|
|
|
|
|
- <!--机构返回上层时-->
|
|
|
|
|
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
|
|
|
|
|
- ,substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag})
|
|
|
|
|
|
|
+ <!--返回的是五级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,11) order by substr(p.deptid,1,11)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,8) order by substr(p.deptid,1,8)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,6) order by substr(p.deptid,1,6)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,4) order by substr(p.deptid,1,4)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,2) order by substr(p.deptid,1,2)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,1) order by substr(p.deptid,1,1)
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
</when>
|
|
</when>
|
|
@@ -186,24 +285,57 @@
|
|
|
</if>
|
|
</if>
|
|
|
<!--按机构下钻时-->
|
|
<!--按机构下钻时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
|
- <choose>
|
|
|
|
|
- <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
|
|
|
|
|
- group by p.deptid order by p.deptid
|
|
|
|
|
- </when>
|
|
|
|
|
- <!--下钻的非五级机构时,下钻到下级机构-->
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- group by substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag})
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
|
|
+ <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ group by p.deptid order by p.deptid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,11) order by substr(p.deptid,1,11)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,8) order by substr(p.deptid,1,8)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,6) order by substr(p.deptid,1,6)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,4) order by substr(p.deptid,1,4)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,2) order by substr(p.deptid,1,2)
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
- <!--团队返回上层时-->
|
|
|
|
|
|
|
+ <!--返回上层时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
|
- group by p.deptid order by p.deptid
|
|
|
|
|
- </if>
|
|
|
|
|
- <!--机构返回上层时-->
|
|
|
|
|
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
|
|
|
|
|
- group by substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag})
|
|
|
|
|
|
|
+ <!--返回的是五级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,11) order by substr(p.deptid,1,11)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,8) order by substr(p.deptid,1,8)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,6) order by substr(p.deptid,1,6)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,4) order by substr(p.deptid,1,4)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,2) order by substr(p.deptid,1,2)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,1) order by substr(p.deptid,1,1)
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
</otherwise>
|
|
</otherwise>
|
|
@@ -226,7 +358,6 @@
|
|
|
select
|
|
select
|
|
|
count(1)
|
|
count(1)
|
|
|
from (
|
|
from (
|
|
|
-
|
|
|
|
|
SELECT
|
|
SELECT
|
|
|
<!--下钻查询时拼接-->
|
|
<!--下钻查询时拼接-->
|
|
|
<if test="reportReqVo.isDrilling != null and reportReqVo.isDrilling == '1'.toString()">
|
|
<if test="reportReqVo.isDrilling != null and reportReqVo.isDrilling == '1'.toString()">
|
|
@@ -236,25 +367,59 @@
|
|
|
</if>
|
|
</if>
|
|
|
<!--按机构下钻时-->
|
|
<!--按机构下钻时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
|
- <choose>
|
|
|
|
|
- <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
|
|
|
|
|
- p.deptid,
|
|
|
|
|
- </when>
|
|
|
|
|
- <!--下钻的非五级机构时,下钻到下级机构-->
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- substr(p.deptid,1,#{reportReqVo.drilFlag}) institutionId,
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
|
|
+ <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ p.deptid,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,11) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,8) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,6) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,4) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,2) institutionId,
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
- <!--团队返回上层时-->
|
|
|
|
|
|
|
+ <!--返回上层时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
|
- p.deptid,
|
|
|
|
|
- </if>
|
|
|
|
|
- <!--机构返回上层时-->
|
|
|
|
|
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
|
|
|
|
|
- substr(p.deptid,1,#{reportReqVo.drilFlag}) institutionId,
|
|
|
|
|
|
|
+ <!--返回的是五级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,11) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,8) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,6) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,4) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,2) institutionId,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ substr(p.deptid,1,1) institutionId,
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+
|
|
|
</if>
|
|
</if>
|
|
|
<if test="reportReqVo.riskCode != null and reportReqVo.riskCode != ''">
|
|
<if test="reportReqVo.riskCode != null and reportReqVo.riskCode != ''">
|
|
|
<if test="reportReqVo.riskCode!='ALL'.toString()">
|
|
<if test="reportReqVo.riskCode!='ALL'.toString()">
|
|
@@ -278,25 +443,57 @@
|
|
|
</if>
|
|
</if>
|
|
|
<!--按机构下钻时-->
|
|
<!--按机构下钻时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
|
- <choose>
|
|
|
|
|
- <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
|
|
|
|
|
- and p.deptid in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
- </when>
|
|
|
|
|
- <!--下钻的非五级机构时,下钻到下级机构-->
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- and substr(p.deptid,1,#{reportReqVo.drilFlag}) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
|
|
+ <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ and p.deptid in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,11) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,8) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,6) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,4) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,2) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
-
|
|
|
|
|
- <!--团队返回上层时-->
|
|
|
|
|
|
|
+ <!--返回上层时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
|
- and p.deptid = #{reportReqVo.deptId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <!--机构返回上层时-->
|
|
|
|
|
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
|
|
|
|
|
- and substr(p.deptid,1,#{reportReqVo.drilFlag}) = #{reportReqVo.deptId}
|
|
|
|
|
|
|
+ <!--返回的是五级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,8) = #{reportReqVo.deptId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,6) = #{reportReqVo.deptId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,4) = #{reportReqVo.deptId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,2) = #{reportReqVo.deptId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,1) = #{reportReqVo.deptId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ and substr(p.deptid,1,1) = #{reportReqVo.deptId}
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
<!--非下钻查询时拼接-->
|
|
<!--非下钻查询时拼接-->
|
|
@@ -341,24 +538,57 @@
|
|
|
</if>
|
|
</if>
|
|
|
<!--按机构下钻时-->
|
|
<!--按机构下钻时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
|
- <choose>
|
|
|
|
|
- <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
|
|
|
|
|
- ,p.deptid order by p.deptid,p.`risk_name`
|
|
|
|
|
- </when>
|
|
|
|
|
- <!--下钻的非五级机构时,下钻到下级机构-->
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- ,substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag}),p.`risk_name`
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
|
|
+ <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ ,p.deptid order by p.deptid,p.`risk_name`
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,11) order by substr(p.deptid,1,11),p.`risk_name`
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,8) order by substr(p.deptid,1,8),p.`risk_name`
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,6) order by substr(p.deptid,1,6),p.`risk_name`
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,4) order by substr(p.deptid,1,4),p.`risk_name`
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,2) order by substr(p.deptid,1,2),p.`risk_name`
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
- <!--团队返回上层时-->
|
|
|
|
|
|
|
+ <!--返回上层时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
|
- ,p.deptid order by p.deptid
|
|
|
|
|
- </if>
|
|
|
|
|
- <!--机构返回上层时-->
|
|
|
|
|
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
|
|
|
|
|
- ,substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag})
|
|
|
|
|
|
|
+ <!--返回的是五级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,11) order by substr(p.deptid,1,11)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,8) order by substr(p.deptid,1,8)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,6) order by substr(p.deptid,1,6)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,4) order by substr(p.deptid,1,4)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,2) order by substr(p.deptid,1,2)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ ,substr(p.deptid,1,1) order by substr(p.deptid,1,1)
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
</when>
|
|
</when>
|
|
@@ -371,24 +601,57 @@
|
|
|
</if>
|
|
</if>
|
|
|
<!--按机构下钻时-->
|
|
<!--按机构下钻时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
|
|
|
- <choose>
|
|
|
|
|
- <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
|
|
|
|
|
- group by p.deptid order by p.deptid
|
|
|
|
|
- </when>
|
|
|
|
|
- <!--下钻的非五级机构时,下钻到下级机构-->
|
|
|
|
|
- <otherwise>
|
|
|
|
|
- group by substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag})
|
|
|
|
|
- </otherwise>
|
|
|
|
|
- </choose>
|
|
|
|
|
|
|
+ <!--下钻的是五级机构时,下钻到团队-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ group by p.deptid order by p.deptid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,11) order by substr(p.deptid,1,11)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,8) order by substr(p.deptid,1,8)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,6) order by substr(p.deptid,1,6)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,4) order by substr(p.deptid,1,4)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--下钻的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,2) order by substr(p.deptid,1,2)
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
- <!--团队返回上层时-->
|
|
|
|
|
|
|
+ <!--返回上层时-->
|
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
<if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
|
|
|
- group by p.deptid order by p.deptid
|
|
|
|
|
- </if>
|
|
|
|
|
- <!--机构返回上层时-->
|
|
|
|
|
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
|
|
|
|
|
- group by substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag})
|
|
|
|
|
|
|
+ <!--返回的是五级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '5'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,11) order by substr(p.deptid,1,11)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是四级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '4'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,8) order by substr(p.deptid,1,8)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是三级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '3'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,6) order by substr(p.deptid,1,6)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是二级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '2'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,4) order by substr(p.deptid,1,4)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是一级机构时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '1'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,2) order by substr(p.deptid,1,2)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--返回的是总部时-->
|
|
|
|
|
+ <if test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == 'X'.toString()">
|
|
|
|
|
+ group by substr(p.deptid,1,1) order by substr(p.deptid,1,1)
|
|
|
|
|
+ </if>
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
</otherwise>
|
|
</otherwise>
|