Browse Source

Merge remote-tracking branch 'origin/master'

main
sjh 1 year ago
parent
commit
5960857bbf
  1. 4
      src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java
  2. 7
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java
  3. 3
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java
  4. 77
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ScoreController.java
  5. 12
      src/main/java/com/biutag/supervision/flow/action/ApplyExtensionAction.java
  6. 16
      src/main/java/com/biutag/supervision/mapper/DepartScoreMapper.java
  7. 6
      src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java
  8. 15
      src/main/java/com/biutag/supervision/mapper/PoliceScoreMapper.java
  9. 7
      src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java
  10. 2
      src/main/java/com/biutag/supervision/pojo/domain/ProfilePolice.java
  11. 32
      src/main/java/com/biutag/supervision/pojo/entity/DepartScore.java
  12. 32
      src/main/java/com/biutag/supervision/pojo/entity/PoliceScore.java
  13. 11
      src/main/java/com/biutag/supervision/service/DepartScoreService.java
  14. 38
      src/main/java/com/biutag/supervision/service/NegativeScoreService.java
  15. 17
      src/main/java/com/biutag/supervision/service/PoliceScoreService.java
  16. 10
      src/main/resources/mapper/ProfileDepartMapper.xml
  17. 10
      src/main/resources/mapper/ProfilePoliceMapper.xml
  18. 2
      src/test/java/com/biutag/supervision/tools/GenCodeTests.java

4
src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java

@ -16,8 +16,8 @@ public enum FlowNodeEnum {
VERIFY("verify"),
SECOND_APPROVE("second_approve"),
FIRST_APPROVE("first_approve"),
SECOND_EXTENSION_APPROVE("first_approve"),
FIRST_EXTENSION_APPROVE("first_approve"),
SECOND_EXTENSION_APPROVE("second_extension_approve"),
FIRST_EXTENSION_APPROVE("first_extension_approve"),
COMPLETED("completed");
private String key;

7
src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java

@ -154,14 +154,13 @@ public class ProfileDepartController {
radarIndicatorItem.setName(item.getLabel());
return radarIndicatorItem;
}).toList();
List<Integer> problemTypeRadarData = problemTypeBarList.stream().map(BarItem::getValue).toList();
profileDepart.setProblemTypeRadarIndicator(problemTypeRadarIndicator);
profileDepart.setProblemTypeRadarData(problemTypeRadarData);
// 突出问题排名
profileDepart.setProblemTypeBarList(profileDepartMapper.selectThirdProblemType(departId, beginTime, endTime));
List<Object> result = negativeScoreService.calculateDepartScore(beginTime, endTime, departId);
profileDepart.setScore((BigDecimal) result.get(0));
profileDepart.setExpression(result.get(1).toString());
profileDepart.setRemarks(result.get(2).toString());
return Result.success(profileDepart);
}

3
src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java

@ -44,7 +44,6 @@ import java.util.stream.Collectors;
@RestController
public class ProfilePoliceController {
private final ScoreService profilePoliceService;
private final ProfilePoliceMapper profilePoliceMapper;
private final SupPoliceService policeService;
@ -155,6 +154,8 @@ public class ProfilePoliceController {
List<Object> result = negativeScoreService.calculatePoliceScore(beginTime, endTime, idCode);
profilePolice.setScore((BigDecimal) result.get(0));
profilePolice.setExpression(result.get(1).toString());
return Result.success(profilePolice);
}

77
src/main/java/com/biutag/supervision/controller/sensitivePerception/ScoreController.java

@ -0,0 +1,77 @@
package com.biutag.supervision.controller.sensitivePerception;
import com.biutag.supervision.mapper.DepartScoreMapper;
import com.biutag.supervision.mapper.PoliceScoreMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.DepartScore;
import com.biutag.supervision.pojo.entity.PoliceScore;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.entity.SupPolice;
import com.biutag.supervision.service.NegativeScoreService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
/**
* @author wxc
* @date 2024/11/13
*/
@Slf4j
@RequestMapping("score")
@RequiredArgsConstructor
@RestController
public class ScoreController {
private final PoliceScoreMapper policeScoreMapper;
private final DepartScoreMapper departScoreMapper;
private final NegativeScoreService negativeScoreService;
@RequestMapping("police")
public Result<String> updatePoliceScore() {
List<SupPolice> supPolices = policeScoreMapper.listPolice();
Date endTime = new Date();
LocalDateTime localDateTime = LocalDateTime.of(2024, 1, 1, 0, 0, 0);
Date beginTime = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
supPolices.forEach(item -> {
List<Object> result = negativeScoreService.calculatePoliceScore(beginTime, endTime, item.getIdCode());
PoliceScore score = new PoliceScore();
score.setIdCode(item.getIdCode());
score.setScore((Double) result.get(0));
score.setExpression((String) result.get(1));
score.setBeginTime(beginTime);
score.setEndTime(endTime);
score.setCreateTime(new Date());
policeScoreMapper.insert(score);
});
return Result.success("success");
}
@RequestMapping("depart")
public Result<String> updateDepartScore() {
List<SupDepart> supDeparts = departScoreMapper.listDepart();
Date endTime = new Date();
LocalDateTime localDateTime = LocalDateTime.of(2024, 1, 1, 0, 0, 0);
Date beginTime = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
supDeparts.forEach(item -> {
List<Object> result = negativeScoreService.calculateDepartScore(beginTime, endTime, item.getId());
DepartScore score = new DepartScore();
score.setDepartId(item.getId());
score.setScore((Double) result.get(0));
score.setExpression((String) result.get(1));
score.setBeginTime(beginTime);
score.setEndTime(endTime);
score.setCreateTime(new Date());
departScoreMapper.insert(score);
});
return Result.success("success");
}
}

12
src/main/java/com/biutag/supervision/flow/action/ApplyExtensionAction.java

@ -5,14 +5,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.enums.FlowActionEnum;
import com.biutag.supervision.constants.enums.FlowNodeEnum;
import com.biutag.supervision.constants.enums.RoleCodeEnum;
import com.biutag.supervision.constants.enums.WorkStatusEnum;
import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.dto.flow.ExtensionApplyData;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeExtensionApply;
import com.biutag.supervision.pojo.entity.NegativeWork;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.service.NegativeExtensionApplyService;
import com.biutag.supervision.service.NegativeService;
@ -76,16 +75,19 @@ public class ApplyExtensionAction implements Action {
String roleCode;
String departId;
String departName;
String flowKey;
// 是否是二级机构办理
if (negative.getIsSecondHandle()) {
roleCode = RoleCodeEnum.FIRST_ADMIN.getCode();
departId = AppConstants.ROOT_DEPART_ID;
departName = AppConstants.ROOT_DEPART_NAME;
flowKey = FlowNodeEnum.FIRST_EXTENSION_APPROVE.getKey();
} else {
roleCode = RoleCodeEnum.SECOND_ADMIN.getCode();
SupDepart parentDepart = departService.getParentDepart(currentWork.getDepartId());
departId = parentDepart.getId();
departName = parentDepart.getShortName();
flowKey = actionDto.getNextFlowKey();
}
workService.remove(new LambdaQueryWrapper<NegativeWork>()
.eq(NegativeWork::getNegativeId, actionDto.getNegativeId())
@ -98,7 +100,7 @@ public class ApplyExtensionAction implements Action {
.setDepartId(departId)
.setDepartName(departName)
.setProblemSourcesCode(negative.getProblemSourcesCode())
.setFlowKey(actionDto.getNextFlowKey())
.setFlowKey(flowKey)
.setCreateTime(LocalDateTime.now())
.setUpdateTime(LocalDateTime.now())
.setStatus(WorkStatusEnum.todo.name());

16
src/main/java/com/biutag/supervision/mapper/DepartScoreMapper.java

@ -0,0 +1,16 @@
package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.DepartScore;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.entity.SupPolice;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface DepartScoreMapper extends BaseMapper<DepartScore> {
@Select("select d.id from sup_depart d left join negative_score_depart sd on d.id = sd.depart_id where sd.depart_id is not null GROUP BY d.id")
List<SupDepart> listDepart();
}

6
src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java

@ -19,9 +19,9 @@ public interface NegativeBlameMapper extends BaseMapper<NegativeBlame> {
@Select("select count(DISTINCT n.id) from negative n left join negative_blame nb on n.id = nb.negativeId left join negative_problem_relation pr on pr.negativeId = n.id and pr.blameId = nb.blameId where n.checkStatus in ('1', '2') and n.discoveryTime BETWEEN #{beginTime} and #{endTime} and nb.blameIdCode = #{idCode} and pr.twoLevelCode = #{twoLevelCode}")
int selectCountByTrue(String idCode, String twoLevelCode, LocalDateTime beginTime, LocalDateTime endTime);
@Select("select DISTINCT nb.* from negative_blame nb left join negative n on nb.negativeId = n.id left join negative_score_police sp on " +
"sp.negative_id = nb.negativeId and sp.id_code = nb.blameIdCode left join negative_problem_relation pr on pr.negativeId = nb.negativeId and pr.blameId = nb.blameId " +
"where n.checkStatus in ('1', '2') and n.processing_status = 'completed' and sp.negative_id is null and pr.threeLevelCode is not null")
@Select("select DISTINCT nb.* from negative_blame nb left join negative n on nb.negativeId = n.id " +
"left join negative_problem_relation pr on pr.negativeId = nb.negativeId and pr.blameId = nb.blameId " +
"where n.checkStatus in ('1', '2') and n.processing_status = 'completed' and pr.threeLevelCode is not null")
List<NegativeBlame> selectVerifyTrue();
}

15
src/main/java/com/biutag/supervision/mapper/PoliceScoreMapper.java

@ -0,0 +1,15 @@
package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.PoliceScore;
import com.biutag.supervision.pojo.entity.SupPolice;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface PoliceScoreMapper extends BaseMapper<PoliceScore> {
@Select("select p.id_code from sup_police p left join negative_score_police sp on p.id_code = sp.id_code where sp.id_code is not null GROUP BY p.id_code")
List<SupPolice> listPolice();
}

7
src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java

@ -22,6 +22,8 @@ public class ProfileDepart {
private String expression;
private String remarks;
private DepartInfo departInfo = new DepartInfo();
private NegativeInfo negativeInfo = new NegativeInfo();
private List<PieItem> problemSourcesList = new ArrayList<>();
@ -29,8 +31,9 @@ public class ProfileDepart {
private List<BarItem> policeBarList = new ArrayList<>();
// 雷达图
private List<RadarIndicatorItem> problemTypeRadarIndicator = new ArrayList<>();
private List<Integer> problemTypeRadarData = new ArrayList<>();
private List<BarItem> problemTypeBarList = new ArrayList<>();
private List<Integer> scoreRadarData = new ArrayList<>();
private List<BarItem> scoreTypeBarList = new ArrayList<>();
private List<BarItem> weightTypeBarList = new ArrayList<>();
@Setter
@Getter

2
src/main/java/com/biutag/supervision/pojo/domain/ProfilePolice.java

@ -21,6 +21,8 @@ public class ProfilePolice {
private String expression;
private String remarks;
private SupPolice policeInfo = new SupPolice();
private NegativeInfo negativeInfo = new NegativeInfo();
private List<PieItem> problemSourcesList = new ArrayList<>();

32
src/main/java/com/biutag/supervision/pojo/entity/DepartScore.java

@ -0,0 +1,32 @@
package com.biutag.supervision.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Setter
@Getter
public class DepartScore {
//
@TableId(value = "depart_id")
private String departId;
//
@TableField("score")
private Double score;
//
@TableField("expression")
private String expression;
private Date createTime;
private Date beginTime;
private Date endTime;
}

32
src/main/java/com/biutag/supervision/pojo/entity/PoliceScore.java

@ -0,0 +1,32 @@
package com.biutag.supervision.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Setter
@Getter
public class PoliceScore {
//
@TableId(value = "id_code")
private String idCode;
//
@TableField("score")
private Double score;
//
@TableField("expression")
private String expression;
private Date createTime;
private Date beginTime;
private Date endTime;
}

11
src/main/java/com/biutag/supervision/service/DepartScoreService.java

@ -0,0 +1,11 @@
package com.biutag.supervision.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.pojo.entity.DepartScore;
import com.biutag.supervision.mapper.DepartScoreMapper;
import org.springframework.stereotype.Service;
@Service
public class DepartScoreService extends ServiceImpl<DepartScoreMapper, DepartScore> {
}

38
src/main/java/com/biutag/supervision/service/NegativeScoreService.java

@ -10,6 +10,7 @@ import com.biutag.supervision.mapper.SupDictContentMapper;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.util.ScoreRule;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@ -23,6 +24,7 @@ import java.util.stream.Collectors;
* @author wxc
* @date 2024/11/12
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class NegativeScoreService {
@ -50,6 +52,7 @@ public class NegativeScoreService {
flag.set(true);
System.out.println("calculateScore-------------------------------------------------");
List<NegativeBlame> negativeBlames = blameMapper.selectVerifyTrue();
log.info("总共问题条数:{}", negativeBlames.size());
if (negativeBlames.isEmpty()) {
flag.set(false);
return;
@ -61,9 +64,10 @@ public class NegativeScoreService {
Set<String> negativeIds = negativeBlames.stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet());
List<NegativeProblemRelation> problemsAll = problemRelationService.list(negativeIds);
List<Negative> negatives = negativeService.listByIds(negativeIds);
List<SupDepart> departs = departService.listByIds(negatives.stream().map(Negative::getInvolveDepartId).collect(Collectors.toSet()));
negativeBlames.forEach(blame -> {
Negative negative = negatives.stream().filter(item -> item.getId().equals(blame.getNegativeId())).findFirst().get();
SupDepart depart = departService.getById(negative.getInvolveDepartId());
SupDepart depart = departs.stream().filter(item -> item.getId().equals(negative.getInvolveDepartId())).findFirst().get();
NegativeScorePolice negativeScorePolice = new NegativeScorePolice()
.setNegativeId(blame.getNegativeId())
.setIdCode(blame.getBlameIdCode())
@ -151,17 +155,17 @@ public class NegativeScoreService {
if (sd == 0) {
return 0;
}
List<BusinessPolice> businessPolices = businessPoliceService.list(beginTime, endTime, businessTypeCode);
List<BusinessDepart> businessDeparts = businessDepartService.list(beginTime, endTime, businessTypeCode);
// 总业务量
int totalBusinessSize = businessPolices.stream().mapToInt(BusinessPolice::getNumber).sum();
int totalBusinessSize = businessDeparts.stream().mapToInt(BusinessDepart::getNumber).sum();
// 平均问题发生率
double avgRate = totalBusinessSize == 0? 0: NumberUtil.div(businessScorePolice.size(), totalBusinessSize);
// 个人问题数
long personSize = businessScorePolice.stream().filter(item -> police.getIdCode().equals(item.getIdCode())).count();
// 个人业务量
long personBusinessSize = businessPolices.stream().filter(item -> police.getName().equals(item.getPoliceName()) && police.getEmpNo().equals(item.getEmpNo())).count();
long personSize = businessScorePolice.stream().filter(item -> police.getOrgId().equals(item.getIdCode())).count();
// 单位业务量
long departBusinessSize = businessDeparts.stream().filter(item -> police.getOrgId().equals(item.getDepartId())).count();
// 个人问题发生率
double personRate = personBusinessSize == 0? 0: NumberUtil.div(personSize, personBusinessSize);
double personRate = departBusinessSize == 0? 0: NumberUtil.div(personSize, departBusinessSize);
return NumberUtil.div(personRate - avgRate, sd);
}
@ -222,10 +226,12 @@ public class NegativeScoreService {
List<NegativeScorePolice> scorePolices = negativeScorePoliceService.list(beginTime, endTime, depart.getStatisticsGroupId());
Double totalScore = scorePolices.stream().mapToDouble(NegativeScorePolice::getScore).sum();
List<String> expressionArr = new ArrayList<>();
StringBuilder remarks = new StringBuilder();
double policeScore = Arrays.stream(BusinessTypeEnum.values()).mapToDouble(businessTypeEnum -> {
List<NegativeScorePolice> businessScorePolice = scorePolices.stream().filter(item -> item.getBusinessTypeCode().equals(businessTypeEnum.getValue())).toList();
// 业务涉及人数
int policeSize = businessScorePolice.stream().map(NegativeScorePolice::getIdCode).collect(Collectors.toSet()).size();
remarks.append(String.format("业务设计人数 %s", policeSize));
// 业务问题数
int businessSize = businessScorePolice.size();
//---------------------------------------------------------
@ -236,6 +242,7 @@ public class NegativeScoreService {
double[] diffNumbers = group.values().stream().mapToDouble(val -> val.size() - avgNumber).toArray();
// 业务标准差
double sd = calculateSd(diffNumbers, policeSize);
log.info("业务标准差为:{}", sd);
// 业务差异值
double diff;
long personalSize = businessScorePolice.stream().filter(item -> idCode.equals(item.getIdCode())).count();
@ -244,17 +251,25 @@ public class NegativeScoreService {
} else {
diff = calculateDiff2(personalSize, avgNumber, sd);
}
log.info("业务差异值为:{}", diff);
// 业务风险指数
double businessScore = calculateBusinessScore(diff, personalSize);
log.info("业务风险指数:{}", businessScore);
// 业务权重
Double score = businessScorePolice.stream().mapToDouble(NegativeScorePolice::getScore).sum();
double businessWeight = calculateBusinessWeight(totalScore, score);
expressionArr.add(String.format("(%s * %s)", businessScore, businessWeight));
remarks.append(String.format("%s:", businessTypeEnum.getLabel())).append("\n");
remarks.append(String.format("业务涉及人数 %s", policeSize)).append("\n");
remarks.append(String.format("业务问题数 %s", businessSize)).append("\n");
remarks.append(String.format("平均问题数 %s", avgNumber)).append("\n");
remarks.append(String.format("业务标准差 %s", sd)).append("\n");
remarks.append(String.format("业务差异值 %s", diff)).append("\n");
return NumberUtil.mul(businessScore, businessWeight);
}).sum();
BigDecimal score = NumberUtil.roundHalfEven(policeScore, 2);
String expression = String.join(" + ", expressionArr);
return List.of(score, expression);
return List.of(score, expression, remarks);
}
/**
@ -270,6 +285,7 @@ public class NegativeScoreService {
List<NegativeScoreDepart> scoreDeparts = negativeScoreDepartService.list(beginTime, endTime, depart.getStatisticsGroupId());
Double totalScore = scoreDeparts.stream().mapToDouble(NegativeScoreDepart::getScore).sum();
List<String> expressionArr = new ArrayList<>();
StringBuilder remarks = new StringBuilder();
double policeScore = Arrays.stream(BusinessTypeEnum.values()).mapToDouble(businessTypeEnum -> {
List<NegativeScoreDepart> businessScoreDeparts = scoreDeparts.stream().filter(item -> item.getBusinessTypeCode().equals(businessTypeEnum.getValue())).toList();
// 业务涉及人数
@ -296,6 +312,12 @@ public class NegativeScoreService {
Double score = businessScoreDeparts.stream().mapToDouble(NegativeScoreDepart::getScore).sum();
double businessWeight = calculateBusinessWeight(totalScore, score);
expressionArr.add(String.format("(%s * %s)", businessScore, businessWeight));
remarks.append(String.format("%s:", businessTypeEnum.getLabel())).append("\n");
remarks.append(String.format("业务涉及人数 %s", departSize)).append("\n");
remarks.append(String.format("当前部门问题数 %s", personalSize)).append("\n");
remarks.append(String.format("平均问题数 %s", avgNumber)).append("\n");
remarks.append(String.format("业务标准差 %s", sd)).append("\n");
remarks.append(String.format("业务差异值 %s", diff)).append("\n");
return NumberUtil.mul(businessScore, businessWeight);
}).sum();
BigDecimal score = NumberUtil.roundHalfEven(policeScore, 2);

17
src/main/java/com/biutag/supervision/service/PoliceScoreService.java

@ -0,0 +1,17 @@
package com.biutag.supervision.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.pojo.entity.PoliceScore;
import com.biutag.supervision.mapper.PoliceScoreMapper;
import com.biutag.supervision.pojo.entity.SupPolice;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class PoliceScoreService extends ServiceImpl<PoliceScoreMapper, PoliceScore> {
}

10
src/main/resources/mapper/ProfileDepartMapper.xml

@ -8,7 +8,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
d.*,
count( DISTINCT nb.blameIdCode ) verify_police_size,
count( n.id ) verify_size
count( n.id ) verify_size,
dc.score
FROM
(
SELECT
@ -16,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d1.short_name parent_depart_name,
d.short_name depart_name,
p.police_size,
p.aux_size
FROM
sup_depart d
@ -23,13 +25,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN sup_depart_police_size p ON p.depart_id = d.id
WHERE
d.LEVEL = 3
and d.statistics_group_id = #{departGroupId}
) d
LEFT JOIN negative n ON n.involveDepartId = d.depart_id
AND n.checkStatus IN ( '1', '2' )
AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}
LEFT JOIN negative_blame nb ON n.id = nb.negativeId
left join depart_score dc on d.depart_id = dc.depart_id
WHERE
d.statistics_group_id = #{departGroupId}
1 = 1
<if test="departName != null and departName != ''">
AND d.short_name like concat('%', #{departName}, '%')
</if>
@ -41,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d.parent_depart_name,
d.depart_name
ORDER BY
verify_size DESC
score DESC
</select>
<select id="selectPoliceNegativeCount" resultType="com.biutag.supervision.pojo.dto.common.BarItem">

10
src/main/resources/mapper/ProfilePoliceMapper.xml

@ -14,16 +14,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
p.person_type,
d.short_name depart_name,
d1.short_name parent_depart_name,
count( DISTINCT n.negative_id ) verify_size
count( DISTINCT n.negative_id ) verify_size,
pc.score
FROM
sup_police p
LEFT JOIN sup_depart d ON p.org_id = d.id
LEFT JOIN sup_depart d1 ON d.pid = d1.id and d1.level >= 2
LEFT JOIN negative_score_police n ON p.id_code = n.id_code
left join police_score pc on p.id_code = pc.id_code
WHERE
n.id_code is not null
AND n.discovery_time BETWEEN #{beginTime} AND #{endTime}
AND d.statistics_group_id = #{departGroupId}
AND pc.score > 0
<if test="name != null and name != ''">
AND p.name like concat('%', #{name}, '%')
</if>
@ -41,9 +44,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
p.position,
p.person_type,
d.short_name,
d1.short_name
d1.short_name,
pc.score
ORDER BY
verify_size DESC
pc.score desc
</select>
<select id="selectProblemType" resultType="com.biutag.supervision.pojo.dto.common.BarItem">

2
src/test/java/com/biutag/supervision/tools/GenCodeTests.java

@ -25,7 +25,7 @@ public class GenCodeTests {
@Test
public void genEntity() throws TemplateException, IOException {
String tableName = "risk_personal";
String tableName = "depart_score";
String tableSchema = "negative";
boolean genMapper = true;
boolean genService = true;

Loading…
Cancel
Save