Browse Source

11

tiaosheng
Lihong@123456 5 years ago
parent
commit
85a453ddc7
  1. 3
      mt/src/main/java/com/ccsens/mt/service/ExcelService.java
  2. 2
      mt/src/main/resources/application-dev.yml
  3. 45
      mt/src/main/resources/mapper_dao/CompeteCompanyDao.xml

3
mt/src/main/java/com/ccsens/mt/service/ExcelService.java

@ -617,8 +617,7 @@ public class ExcelService implements IExcelService {
@Override @Override
public String public String competeJoinCount(CompeteDto.CompeteTime params) throws IOException {
competeJoinCount(CompeteDto.CompeteTime params) throws IOException {
List<TableVo.CompeteOverview> competeOverviewList = competeJoinCountList(params); List<TableVo.CompeteOverview> competeOverviewList = competeJoinCountList(params);
return getExcelFilePathForCompeteJoinCount(competeOverviewList); return getExcelFilePathForCompeteJoinCount(competeOverviewList);
} }

2
mt/src/main/resources/application-dev.yml

@ -31,3 +31,5 @@ file:
signUpUrl: https://test.tall.wiki/compete/ signUpUrl: https://test.tall.wiki/compete/
domain: https://test.tall.wiki/gateway/mt/ domain: https://test.tall.wiki/gateway/mt/
imgDomain: https://test.tall.wiki/gateway/mt/uploads/ imgDomain: https://test.tall.wiki/gateway/mt/uploads/
logging:
path:

45
mt/src/main/resources/mapper_dao/CompeteCompanyDao.xml

@ -401,22 +401,41 @@
<select id="selectCompeteJoinCountList" resultType="com.ccsens.mt.bean.vo.TableVo$CompeteOverview"> <select id="selectCompeteJoinCountList" resultType="com.ccsens.mt.bean.vo.TableVo$CompeteOverview">
SELECT *, select t3.companyId,t3.companyName as companyName , t1.coachNum, t2.guideNum, t3.playerNum , IFNULL(t1.coachNum,0) + IFNULL(t2.guideNum,0) + IFNULL(t3.playerNum,0) as sum from
(coachNum+guideNum+playerNum) as sum (select t.companyId, t.companyName,count(t.id) as playerNum from
FROM
(SELECT (SELECT
tcc.`name` as companyName, DISTINCT(tcp.id) as id, tcc.id as companyId,tcc.`name` as companyName
tcc.id, FROM
(SELECT count(tcca.id) FROM t_compete_coach tcca WHERE tcc.id = tcca.company_id and identity = 1 and rec_status = 0) as coachNum, t_compete_company tcc
(SELECT count(tcca.id) FROM t_compete_coach tcca WHERE tcc.id = tcca.company_id and identity = 0 and rec_status = 0) as guideNum, left join
((SELECT COUNT(tcpp.id) FROM t_compete_project_player tcpp LEFT JOIN t_compete_player tcp on tcp.id = tcpp.player_id WHERE tcp.company_id = tcc.id and tcp.rec_status = 0 and tcpp.rec_status = 0 and tcp.rec_status = 0) + t_compete_player tcp on tcc.id = tcp.company_id
(SELECT COUNT(tctm.id) FROM t_compete_team_member tctm LEFT JOIN t_compete_team tct on tctm.compete_team_id = tct.id WHERE tct.company_id = tcc.id and tct.rec_status = 0 and tctm.rec_status = 0 ))as playerNum LEFT JOIN t_compete_project_player tcpp ON tcp.id = tcpp.player_id
WHERE
tcc.type = 0
AND tcp.company_id = tcc.id
AND tcc.rec_status = 0
AND tcp.rec_status = 0
AND tcpp.rec_status = 0
UNION
SELECT
DISTINCT(tcp.id) as id,tcc.id as companyId,tcc.`name` as companyName
FROM FROM
t_compete_company tcc t_compete_company tcc
LEFT JOIN t_compete_team tct ON tcc.id = tct.company_id
LEFT JOIN t_compete_team_member tctm on tct.id = tctm.compete_team_id
LEFT JOIN t_compete_player tcp ON tctm.player_id = tcp.id
WHERE WHERE
tcc.rec_status =0 tcc.type = 0
and tcc.compete_time_id = #{competeTimeId} AND tct.rec_status = 0
) c AND tctm.rec_status = 0
WHERE c.playerNum &lt;&gt; 0 And tcc.rec_status = 0
AND tcp.rec_status = 0) t
group by t.companyId
having count(t.id) > 0
) t3
left join
(SELECT tcc.id as companyId,tcc.`name` as companyName ,count(tcca.id) as coachNum FROM t_compete_company tcc left join (select * from t_compete_coach where rec_status = 0) tcca on tcc.id = tcca.company_id where tcc.type = 0 AND identity = 1 and tcc.rec_status = 0 GROUP BY tcc.id) t1 on t1.companyId = t3.companyId
left join
(SELECT tcc.id as companyId,tcc.`name` as companyName , count(tcca.id) as guideNum FROM t_compete_company tcc left join (select * from t_compete_coach where rec_status = 0) tcca on tcc.id = tcca.company_id where tcc.type = 0 AND identity = 0 and tcc.rec_status = 0 GROUP BY tcc.id) t2 on t2.companyId = t3.companyId
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save