Browse Source

feat: 加上问题详情

master
buaixuexideshitongxue 3 weeks ago
parent
commit
a4a2c2d204
  1. 8
      src/main/java/com/biutag/supervision/pojo/dto/common/BarItem.java
  2. 20
      src/main/resources/mapper/StatisticsGroupMapper.xml

8
src/main/java/com/biutag/supervision/pojo/dto/common/BarItem.java

@ -2,6 +2,7 @@ package com.biutag.supervision.pojo.dto.common;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.math.BigDecimal;
@ -13,8 +14,15 @@ import java.math.BigDecimal;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class BarItem {
private String label;
private BigDecimal value;
private String detailId;
public BarItem(String label, BigDecimal value) {
this.label = label;
this.value = value;
}
}

20
src/main/resources/mapper/StatisticsGroupMapper.xml

@ -79,9 +79,11 @@
<select id="selectNegativeStatisticsByThree" resultType="com.biutag.supervision.pojo.dto.common.BarItem">
SELECT
membersName label,
`value`
`value`,
detail_depart.id detailId
FROM
negative_group_members m
LEFT JOIN sup_depart detail_depart ON detail_depart.id = m.membersCode
LEFT JOIN (
SELECT
three_involve_depart_id,
@ -102,9 +104,11 @@
<select id="selectNegativePerNumberStatisticsByThree" resultType="com.biutag.supervision.pojo.dto.common.BarItem">
SELECT
membersName label,
`value`
`value`,
detail_depart.id detailId
FROM
negative_group_members m
LEFT JOIN sup_depart detail_depart ON detail_depart.id = m.membersCode
LEFT JOIN (
SELECT
three_involve_depart_id,
@ -127,9 +131,11 @@
SELECT
membersName label,
CASE WHEN s.police_size + s.aux_size > 0 THEN
ROUND(total / ( s.police_size + s.aux_size ), 1) ELSE 0 END `value`
ROUND(total / ( s.police_size + s.aux_size ), 1) ELSE 0 END `value`,
detail_depart.id detailId
FROM
negative_group_members m
LEFT JOIN sup_depart detail_depart ON detail_depart.id = m.membersCode
LEFT JOIN (
SELECT
three_involve_depart_id,
@ -151,7 +157,12 @@
<select id="selectNegativeStatistics" resultType="com.biutag.supervision.pojo.dto.common.BarItem">
SELECT
b.blameName label,
count( DISTINCT n.id ) `value`
count( DISTINCT n.id ) `value`,
CASE WHEN COUNT(DISTINCT NULLIF(TRIM(b.blameIdCode), '')) = 1
AND COUNT(DISTINCT p.id) = 1
AND (SELECT COUNT(DISTINCT NULLIF(TRIM(b2.blameIdCode), ''))
FROM negative_blame b2 WHERE b2.blameName = b.blameName) = 1
THEN MIN(p.id_code) END detailId
FROM
negative n
JOIN negative_blame b ON n.id = b.negativeId
@ -159,6 +170,7 @@
<foreach collection="personTypeCode" item="data" open="(" close=")" separator=",">
#{data}
</foreach>
LEFT JOIN sup_police p ON p.id_code = b.blameIdCode AND p.del = 0
LEFT JOIN sup_depart d ON n.handle_three_depart_id = d.id
WHERE
n.crtTime BETWEEN #{beginTime} AND #{endTime}

Loading…
Cancel
Save