<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.project.report.mapper.ReportMapper">
|
|
<!-- 执法次数月度分布-->
|
<select id="getMonthCount"
|
parameterType="com.project.report.domain.bo.query.ReportQueryBo"
|
resultType="com.project.common.vo.KeyVal">
|
select
|
MONTH(apply_time) AS k,
|
IFNULL(count(order_id),0) as v
|
from enforce_order
|
where 1=1
|
and check_status>=2
|
<if test="deptId != null ">
|
AND check_dept_id = #{deptId}
|
</if>
|
<if test="beginTime!=null and beginTime!=''">
|
AND apply_time >= #{beginTime}
|
</if>
|
<if test="endTime!=null and endTime!=''">
|
AND apply_time <= #{endTime}
|
</if>
|
GROUP BY k
|
</select>
|
|
<!-- 执法次数部门分布-->
|
<select id="getDeptCount"
|
parameterType="com.project.report.domain.bo.query.ReportQueryBo"
|
resultType="com.project.common.vo.KeyVal">
|
select
|
check_dept_id AS k,
|
IFNULL(count(order_id),0) as v
|
from enforce_order
|
where 1=1
|
and check_status>=2
|
<if test="beginTime!=null and beginTime!=''">
|
AND apply_time >= #{beginTime}
|
</if>
|
<if test="endTime!=null and endTime!=''">
|
AND apply_time <= #{endTime}
|
</if>
|
GROUP BY k
|
</select>
|
|
<!-- 被执法次数企业分布-->
|
<select id="getCompanyCount"
|
parameterType="com.project.report.domain.bo.query.ReportQueryBo"
|
resultType="com.project.common.vo.KeyVal">
|
|
select
|
sc.company_name AS k,
|
IFNULL(count(eo.order_id),0) as v
|
from sys_company sc
|
left join enforce_order eo on sc.company_id=eo.company_id
|
where 1=1
|
and sc.company_status=0
|
and sc.check_status=2
|
and eo.check_status>=2
|
<if test="beginTime!=null and beginTime!=''">
|
AND eo.apply_time >= #{beginTime}
|
</if>
|
<if test="endTime!=null and endTime!=''">
|
AND eo.apply_time <= #{endTime}
|
</if>
|
GROUP BY k order by v desc
|
</select>
|
|
<!-- 执法类型分布-->
|
<select id="getEnforceTypeCount"
|
parameterType="com.project.report.domain.bo.query.ReportQueryBo"
|
resultType="com.project.common.vo.KeyVal">
|
select
|
enforce_type AS k,
|
IFNULL(count(order_id),0) as v
|
from enforce_order
|
where 1=1
|
and check_status>=2
|
<if test="beginTime!=null and beginTime!=''">
|
AND apply_time >= #{beginTime}
|
</if>
|
<if test="endTime!=null and endTime!=''">
|
AND apply_time <= #{endTime}
|
</if>
|
GROUP BY k
|
</select>
|
|
<!-- 投诉处理状态-->
|
<select id="getComplaintStatusCount"
|
parameterType="com.project.report.domain.bo.query.ReportQueryBo"
|
resultType="com.project.common.vo.KeyVal">
|
select
|
complaint_status AS k,
|
IFNULL(count(id),0) as v
|
from enforce_complaint_log
|
where 1=1
|
<if test="beginTime!=null and beginTime!=''">
|
AND complaint_time >= #{beginTime}
|
</if>
|
<if test="endTime!=null and endTime!=''">
|
AND complaint_time <= #{endTime}
|
</if>
|
GROUP BY k
|
</select>
|
|
<!-- 投诉类型分布-->
|
<select id="getComplaintTypeCount"
|
parameterType="com.project.report.domain.bo.query.ReportQueryBo"
|
resultType="com.project.common.vo.KeyVal">
|
select
|
complaint_type AS k,
|
IFNULL(count(id),0) as v
|
from enforce_complaint_log
|
where 1=1
|
<if test="beginTime!=null and beginTime!=''">
|
AND complaint_time >= #{beginTime}
|
</if>
|
<if test="endTime!=null and endTime!=''">
|
AND complaint_time <= #{endTime}
|
</if>
|
<if test="doComplaint != null ">
|
<if test="doComplaint == 0 ">
|
AND complaint_status = 0
|
</if>
|
<if test="doComplaint == 1 ">
|
AND complaint_status != 0
|
</if>
|
</if>
|
GROUP BY k
|
</select>
|
|
</mapper>
|