|
|
|
<?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.epmet.dao.issue.StatsIssueDao">
|
|
|
|
<select id="selectAgencyIssueTotal" resultType="com.epmet.dto.issue.IssueAgencyDTO">
|
|
|
|
SELECT ORG_ID AS "agencyId",
|
|
|
|
ORG_ID_PATH AS "pIds",
|
|
|
|
ISSUE_STATUS AS "status",
|
|
|
|
COUNT(ID) AS "count"
|
|
|
|
FROM
|
|
|
|
issue
|
|
|
|
WHERE
|
|
|
|
DEL_FLAG = '0'
|
|
|
|
AND CUSTOMER_ID = #{customerId}
|
|
|
|
GROUP BY
|
|
|
|
ORG_ID, ISSUE_STATUS
|
|
|
|
</select>
|
|
|
|
<select id="selectAgencyIssueInc" resultType="com.epmet.dto.issue.IssueAgencyDTO">
|
|
|
|
SELECT
|
|
|
|
i.ORG_ID AS "agencyId",
|
|
|
|
i.ORG_ID_PATH AS "pIds",
|
|
|
|
ip.ISSUE_STATUS AS "status",
|
|
|
|
COUNT(ip.ID) AS "count"
|
|
|
|
FROM
|
|
|
|
issue i
|
|
|
|
INNER JOIN issue_process ip ON i.ID = ip.ISSUE_ID
|
|
|
|
AND ip.DEL_FLAG = '0'
|
|
|
|
WHERE
|
|
|
|
i.DEL_FLAG = '0'
|
|
|
|
AND i.CUSTOMER_ID = #{customerId}
|
|
|
|
AND DATE(ip.ip.CREATED_TIME) = #{date}
|
|
|
|
GROUP BY
|
|
|
|
i.ORG_ID,
|
|
|
|
ip.ISSUE_STATUS
|
|
|
|
</select>
|
|
|
|
<select id="selectAgencyClosedIssueTotal" resultType="com.epmet.dto.issue.IssueAgencyDTO">
|
|
|
|
SELECT
|
|
|
|
ORG_ID AS "agencyId",
|
|
|
|
ORG_ID_PATH AS "pIds",
|
|
|
|
RESOLVE_TYPE AS "status",
|
|
|
|
COUNT( ID ) AS "count"
|
|
|
|
FROM
|
|
|
|
issue
|
|
|
|
WHERE
|
|
|
|
DEL_FLAG = '0'
|
|
|
|
AND ISSUE_STATUS = 'closed'
|
|
|
|
AND CUSTOMER_ID = #{customerId}
|
|
|
|
AND DATE(UPDATED_TIME) <![CDATA[ <= ]]> #{date}
|
|
|
|
GROUP BY
|
|
|
|
ORG_ID,
|
|
|
|
RESOLVE_TYPE
|
|
|
|
</select>
|
|
|
|
<select id="selectAgencyClosedIssueInc" resultType="com.epmet.dto.issue.IssueAgencyDTO">
|
|
|
|
SELECT
|
|
|
|
ORG_ID AS "agencyId",
|
|
|
|
ORG_ID_PATH AS "pIds",
|
|
|
|
RESOLVE_TYPE AS "status",
|
|
|
|
COUNT( ID ) AS "count"
|
|
|
|
FROM
|
|
|
|
issue
|
|
|
|
WHERE
|
|
|
|
DEL_FLAG = '0'
|
|
|
|
AND ISSUE_STATUS = 'closed'
|
|
|
|
AND CUSTOMER_ID = #{customerId}
|
|
|
|
AND DATE(UPDATED_TIME) = #{date}
|
|
|
|
GROUP BY
|
|
|
|
ORG_ID,
|
|
|
|
RESOLVE_TYPE
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectGridProjectList" resultType="com.epmet.entity.issue.IssueEntity">
|
|
|
|
SELECT
|
|
|
|
i.id AS "id",
|
|
|
|
i.grid_id AS "gridId",
|
|
|
|
i.org_id AS "orgId",
|
|
|
|
ipr.project_id AS "projectId"
|
|
|
|
FROM
|
|
|
|
issue i
|
|
|
|
INNER JOIN issue_project_relation ipr ON i.id = ipr.issue_id
|
|
|
|
WHERE
|
|
|
|
i.del_flag = '0'
|
|
|
|
AND ipr.del_flag = '0'
|
|
|
|
AND i.customer_id = #{customerId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|