Browse Source

统计分析加入权限

v2
蟑螂恶霸 2 years ago
parent
commit
47718c14a9
  1. 21
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalMapper.xml

21
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalMapper.xml

@ -33,13 +33,12 @@
</select> </select>
<select id="statisticalLawEnforcementItem" parameterType="StatisticalVo" resultMap="StatisticalVoResult"> <select id="statisticalLawEnforcementItem" parameterType="StatisticalVo" resultMap="StatisticalVoResult">
select law_enforcement_item,count(*) as total from enforcement_registration select law_enforcement_item,count(*) as total from enforcement_registration er
<where> where DATE_FORMAT(er.enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
<if test="params.beginTime != null and params.beginTime != ''"> <if test="params.dataScope != null and params.dataScope != ''">
AND create_time = #{params.beginTime} <!-- 数据范围过滤 -->
</if> ${params.dataScope}
AND DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' ) </if>
</where>
GROUP BY law_enforcement_item GROUP BY law_enforcement_item
</select> </select>
<select id="statisticalLawEnforcer" parameterType="StatisticalVo" resultMap="StatisticalVoResult"> <select id="statisticalLawEnforcer" parameterType="StatisticalVo" resultMap="StatisticalVoResult">
@ -50,7 +49,7 @@
FROM FROM
enforcement_registration enforcement_registration
WHERE WHERE
DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' ) DATE_FORMAT( enforcement_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' )
GROUP BY GROUP BY
law_enforcer_id UNION ALL law_enforcer_id UNION ALL
SELECT SELECT
@ -60,7 +59,7 @@
FROM FROM
enforcement_registration er enforcement_registration er
<where> <where>
and DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' ) and DATE_FORMAT( er.enforcement_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' )
<if test="params.dataScope != null and params.dataScope != ''"> <if test="params.dataScope != null and params.dataScope != ''">
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
@ -82,7 +81,7 @@
LEFT JOIN ( select dict_label,dict_value from sys_dict_data where dict_type = 'enterpriseType') sdd LEFT JOIN ( select dict_label,dict_value from sys_dict_data where dict_type = 'enterpriseType') sdd
on ei.enterprise_type = sdd.dict_value on ei.enterprise_type = sdd.dict_value
<where> <where>
and DATE_FORMAT( er.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' ) and DATE_FORMAT( er.enforcement_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' )
<if test="params.dataScope != null and params.dataScope != ''"> <if test="params.dataScope != null and params.dataScope != ''">
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
@ -96,7 +95,7 @@
COUNT(CASE WHEN is_complaint = 1 THEN 1 END) AS complaint_count COUNT(CASE WHEN is_complaint = 1 THEN 1 END) AS complaint_count
from enforcement_registration er from enforcement_registration er
<where> <where>
AND DATE_FORMAT(create_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' ) AND DATE_FORMAT(er.enforcement_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' )
<if test="params.dataScope != null and params.dataScope != ''"> <if test="params.dataScope != null and params.dataScope != ''">
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}

Loading…
Cancel
Save