|
|
|
@ -180,7 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
count(*) as total, |
|
|
|
SUM(CASE WHEN time_type = 'year' THEN 1 ELSE 0 END ) as yearTotal, |
|
|
|
SUM(CASE WHEN time_type = 'quarter' THEN 1 ELSE 0 END ) as quarterTotal, |
|
|
|
SUM(CASE WHEN time_type = 'month' THEN 1 ELSE 0 END ) as mouthTotal |
|
|
|
SUM(CASE WHEN time_type = 'month' THEN 1 ELSE 0 END ) as monthTotal |
|
|
|
FROM enforcement_inspection_program |
|
|
|
<where> |
|
|
|
<if test="bureauDeptName != null and bureauDeptName != ''"> |
|
|
|
@ -202,6 +202,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
and DATE_FORMAT(create_time, '%Y-%m') = #{month} |
|
|
|
</if> |
|
|
|
AND bureau_dept_id is not null |
|
|
|
and time_type is not null |
|
|
|
and(plan_year is not null or quarter is not null or mouth is not null) |
|
|
|
</where> |
|
|
|
GROUP BY bureau_dept_id |
|
|
|
order by total desc |
|
|
|
@ -211,7 +213,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
SELECT |
|
|
|
SUM(CASE WHEN time_type = 'year' THEN 1 ELSE 0 END ) as yearTotal, |
|
|
|
SUM(CASE WHEN time_type = 'quarter' THEN 1 ELSE 0 END ) as quarterTotal, |
|
|
|
SUM(CASE WHEN time_type = 'month' THEN 1 ELSE 0 END ) as mouthTotal |
|
|
|
SUM(CASE WHEN time_type = 'month' THEN 1 ELSE 0 END ) as monthTotal |
|
|
|
FROM enforcement_inspection_program |
|
|
|
<where> |
|
|
|
<if test="bureauDeptName != null and bureauDeptName != ''"> |
|
|
|
@ -233,6 +235,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
and DATE_FORMAT(create_time, '%m') = #{month} |
|
|
|
</if> |
|
|
|
AND bureau_dept_id is not null |
|
|
|
and time_type is not null |
|
|
|
and(plan_year is not null or quarter is not null or mouth is not null) |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
@ -262,6 +266,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
</if> |
|
|
|
AND bureau_dept_id is not null |
|
|
|
AND time_type is not null |
|
|
|
and(plan_year is not null or quarter is not null or mouth is not null) |
|
|
|
</where> |
|
|
|
GROUP BY bureau_dept_id |
|
|
|
order by total desc |
|
|
|
@ -292,12 +297,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
and DATE_FORMAT(create_time, '%Y-%m') = #{month} |
|
|
|
</if> |
|
|
|
AND bureau_dept_id is not null |
|
|
|
and time_type ='year' |
|
|
|
and plan_year is not null |
|
|
|
</where> |
|
|
|
GROUP BY bureau_dept_id |
|
|
|
order by total desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="staticProgramWithQuarter" resultType="com.zdxt.code.domain.dto.EnforcementInspectionProgramDto" > |
|
|
|
<!-- <select id="staticProgramWithQuarter" resultType="com.zdxt.code.domain.dto.EnforcementInspectionProgramDto" > |
|
|
|
SELECT |
|
|
|
bureau_dept_name, |
|
|
|
SUM(CASE WHEN time_type = 'quarter' THEN 1 ELSE 0 END ) as total |
|
|
|
@ -322,12 +329,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
AND DATE_FORMAT(create_time, '%Y-%m') = #{month} |
|
|
|
</if> |
|
|
|
AND bureau_dept_id is not null |
|
|
|
and time_type is not null |
|
|
|
and quarter is not null |
|
|
|
</where> |
|
|
|
GROUP BY bureau_dept_id |
|
|
|
order by total desc |
|
|
|
</select>--> |
|
|
|
<select id="staticProgramWithQuarter" resultType="com.zdxt.code.domain.dto.EnforcementInspectionProgramDto" > |
|
|
|
SELECT |
|
|
|
bureau_dept_name, |
|
|
|
SUM(CASE WHEN time_type = 'quarter' THEN 1 ELSE 0 END ) as total, |
|
|
|
SUM(CASE WHEN quarter = 1 THEN 1 ELSE 0 END ) as quarterTotal1, |
|
|
|
SUM(CASE WHEN quarter = 2 THEN 1 ELSE 0 END ) as quarterTotal2, |
|
|
|
SUM(CASE WHEN quarter = 3 THEN 1 ELSE 0 END ) as quarterTotal3, |
|
|
|
SUM(CASE WHEN quarter = 4 THEN 1 ELSE 0 END ) as quarterTotal4 |
|
|
|
FROM enforcement_inspection_program |
|
|
|
<where> |
|
|
|
<if test="year != null and year != ''"> |
|
|
|
AND YEAR(create_time) = #{year} |
|
|
|
</if> |
|
|
|
AND bureau_dept_id is not null |
|
|
|
and time_type ='quarter' |
|
|
|
and quarter is not null |
|
|
|
</where> |
|
|
|
GROUP BY bureau_dept_id |
|
|
|
order by total desc |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="staticProgramWithMonth" resultType="com.zdxt.code.domain.dto.EnforcementInspectionProgramDto" > |
|
|
|
<!-- <select id="staticProgramWithMonth" resultType="com.zdxt.code.domain.dto.EnforcementInspectionProgramDto" > |
|
|
|
SELECT |
|
|
|
bureau_dept_name, |
|
|
|
SUM(CASE WHEN time_type = 'month' THEN 1 ELSE 0 END ) as total |
|
|
|
@ -352,8 +381,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
AND DATE_FORMAT(create_time, '%Y-%m') = #{month} |
|
|
|
</if> |
|
|
|
AND bureau_dept_id is not null |
|
|
|
and time_type is not null |
|
|
|
and mouth is not null |
|
|
|
</where> |
|
|
|
GROUP BY bureau_dept_id |
|
|
|
order by total desc |
|
|
|
</select>--> |
|
|
|
<select id="staticProgramWithMonth" resultType="com.zdxt.code.domain.dto.EnforcementInspectionProgramDto" > |
|
|
|
SELECT |
|
|
|
bureau_dept_name, |
|
|
|
SUM(CASE WHEN time_type = 'month' THEN 1 ELSE 0 END ) as total, |
|
|
|
SUM(CASE WHEN mouth = 1 THEN 1 ELSE 0 END ) as monthTotal1, |
|
|
|
SUM(CASE WHEN mouth = 2 THEN 1 ELSE 0 END ) as monthTotal2, |
|
|
|
SUM(CASE WHEN mouth = 3 THEN 1 ELSE 0 END ) as monthTotal3, |
|
|
|
SUM(CASE WHEN mouth = 4 THEN 1 ELSE 0 END ) as monthTotal4, |
|
|
|
SUM(CASE WHEN mouth = 5 THEN 1 ELSE 0 END ) as monthTotal5, |
|
|
|
SUM(CASE WHEN mouth = 6 THEN 1 ELSE 0 END ) as monthTotal6, |
|
|
|
SUM(CASE WHEN mouth = 7 THEN 1 ELSE 0 END ) as monthTotal7, |
|
|
|
SUM(CASE WHEN mouth = 8 THEN 1 ELSE 0 END ) as monthTotal8, |
|
|
|
SUM(CASE WHEN mouth = 9 THEN 1 ELSE 0 END ) as monthTotal9, |
|
|
|
SUM(CASE WHEN mouth = 10 THEN 1 ELSE 0 END ) as monthTotal10, |
|
|
|
SUM(CASE WHEN mouth = 11 THEN 1 ELSE 0 END ) as monthTotal11, |
|
|
|
SUM(CASE WHEN mouth = 12 THEN 1 ELSE 0 END ) as monthTotal12 |
|
|
|
FROM enforcement_inspection_program |
|
|
|
<where> |
|
|
|
<if test="year != null and year != ''"> |
|
|
|
AND YEAR(create_time) = #{year} |
|
|
|
</if> |
|
|
|
AND bureau_dept_id is not null |
|
|
|
and time_type ='month' |
|
|
|
and mouth is not null |
|
|
|
</where> |
|
|
|
GROUP BY bureau_dept_id |
|
|
|
order by total desc |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
</mapper> |