Browse Source

fiex:sql bug去除

master
pengwei 3 months ago
parent
commit
4a298f9817
  1. 48
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java

48
src/main/java/com/biutag/supervision/mapper/NegativeMapper.java

@ -236,19 +236,19 @@ public interface NegativeMapper extends BaseMapper<Negative> {
@Select("select " + @Select("select " +
"sd.short_name AS `name`," + " sd.short_name AS `name`," +
"sd.id AS departId, " + " sd.id AS departId, " +
"COUNT( DISTINCT ng.id ) AS totalPro, " + " COUNT( DISTINCT ng.id ) AS totalPro, " +
"COUNT( DISTINCT IF(ng.problemSourcesCode=13, ng.id, NULL) ) AS xc, " + " COUNT( DISTINCT IF(ng.problemSourcesCode=13, ng.id, NULL) ) AS xc, " +
"COUNT( DISTINCT IF(ng.problemSourcesCode=15, ng.id, NULL) ) AS zx, " + " COUNT( DISTINCT IF(ng.problemSourcesCode=15, ng.id, NULL) ) AS zx, " +
"COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS processingNumber, " + " COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS processingNumber, " +
"COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS completedNumber " + " COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS completedNumber " +
"from sup_depart sd " + " from sup_depart sd " +
"LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15) " + " LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15) " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " + " AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"WHERE sd.statistics_group_id=3 " + " WHERE sd.statistics_group_id=3 " +
"GROUP BY sd.short_name " + " GROUP BY sd.short_name " +
"ORDER BY totalPro DESC;" " ORDER BY totalPro DESC;"
) )
List<SuperviseMapIconVo> getSupervisionMapIconData(Date beginTime, Date endTime); List<SuperviseMapIconVo> getSupervisionMapIconData(Date beginTime, Date endTime);
@ -257,23 +257,23 @@ public interface NegativeMapper extends BaseMapper<Negative> {
//获取personNum、relationOrg //获取personNum、relationOrg
@Select( @Select(
"select count(*) FROM sup_depart sd " + "select count(*) FROM sup_depart sd " +
"LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15) " + " LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15) " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " + " AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + " LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " +
"WHERE nb.handleResultName != '' and nb.handleResultName IS NOT NULL and nb.handleResultName != '不予追责' " + " WHERE nb.handleResultName != '' and nb.handleResultName IS NOT NULL and nb.handleResultName != '不予追责' " +
"and nb.type = #{code} and sd.id =#{departId}" " and nb.type = #{code} and sd.id =#{departId}"
) )
String getSupervisionMapStringData(Date beginTime, Date endTime,String code,String departId); String getSupervisionMapStringData(Date beginTime, Date endTime,String code,String departId);
//获取completedRate //获取completedRate
@Select( @Select(
"select " + "select " +
"IFNULL( ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) " + " IFNULL( ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) " +
"FROM sup_depart sd" + " FROM sup_depart sd" +
"LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15)" + " LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15)" +
"AND crtTime BETWEEN #{beginTime} AND #{endTime}" + " AND crtTime BETWEEN #{beginTime} AND #{endTime}" +
"LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + " LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " +
"where sd.id =#{departId}" " where sd.id =#{departId}"
) )
String getSupervisionMapCompletedRate(Date beginTime, Date endTime,String departId); String getSupervisionMapCompletedRate(Date beginTime, Date endTime,String departId);

Loading…
Cancel
Save