|
@@ -68,6 +68,7 @@
|
|
|
LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
WHERE
|
|
|
a.type = #{leadType}
|
|
|
+ <if test="level != null and level != ''">AND a.lin_level = #{level}</if>
|
|
|
<choose>
|
|
|
<when test="deptId != null and deptId != ''">and FIND_IN_SET( #{deptId}, CONCAT(d.ancestors,',',d.dept_id) )</when>
|
|
|
<otherwise>${params.dataScope}</otherwise>
|
|
@@ -207,4 +208,25 @@
|
|
|
WHERE
|
|
|
event_id = #{id} ORDER by flag
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+
|
|
|
+ <select id="getNumByLevel" parameterType="WaterConservancyViewBO" resultType="map">
|
|
|
+ SELECT
|
|
|
+ a.dict_value level,
|
|
|
+ a.dict_label name,
|
|
|
+ IFNULL(b.num,0) num
|
|
|
+ FROM
|
|
|
+ ${database_system}.sys_dict_data a
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT
|
|
|
+ a.lin_level,
|
|
|
+ count( a.id ) num
|
|
|
+ FROM
|
|
|
+ centerdata_t_hydraulic_river_length a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ where a.type = #{leadType}
|
|
|
+ ${params.dataScope}
|
|
|
+ GROUP BY a.lin_level
|
|
|
+ ) b ON a.dict_value = b.lin_level
|
|
|
+ WHERE a.dict_type = 'forest_lin_level'
|
|
|
+ </select>
|
|
|
+</mapper>
|