Merge remote-tracking branch 'origin/main'

main
cheney 11 months ago
commit 2d317e88b4
  1. 2
      competition/src/main/java/com/huoran/competition/mapper/CompetitionRegistrationMapper.java
  2. 130
      competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionMapper.xml
  3. 16
      competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionRegistrationMapper.xml
  4. 7
      competition/src/main/java/com/huoran/competition/service/impl/CompetitionRegistrationServiceImpl.java

@ -32,4 +32,6 @@ public interface CompetitionRegistrationMapper extends BaseMapper<CompetitionReg
IPage<RegistrationVO> selectApplicantByCondition(Page<RegistrationVO> page,@Param("req") PageRegistrationStaffReq req); IPage<RegistrationVO> selectApplicantByCondition(Page<RegistrationVO> page,@Param("req") PageRegistrationStaffReq req);
String selectSchoolName(@Param("accountId")String accountId); String selectSchoolName(@Param("accountId")String accountId);
Integer countTheNumberOfApplicants(@Param("competitionId")Integer competitionId);
} }

@ -61,12 +61,27 @@
c.play_end_time, c.play_end_time,
c.create_time, c.create_time,
IFNULL( IFNULL(
( SELECT count( 1 ) FROM c_competition_registration WHERE competition_id = c.id GROUP BY competition_id HAVING count( 1 ) > 0 ), (
SELECT
count( 1 )
FROM
c_competition_registration r
INNER JOIN nakadai.hr_user_account a ON a.id = r.account_id
AND a.is_del = 0
INNER JOIN nakadai.hr_user_info u ON u.user_id = a.user_id
AND u.is_del = 0
WHERE
competition_id = c.id
GROUP BY
competition_id
HAVING
count( 1 ) > 0
),
0 0
) AS applicant_num, ) AS applicant_num,
c.is_open, c.is_open,
create_source, create_source,
( CASE create_source WHEN 0 THEN '平台创建' WHEN 1 THEN '组织创建' ELSE '无' end) as createSource ( CASE create_source WHEN 0 THEN '平台创建' WHEN 1 THEN '组织创建' ELSE '无' END ) AS createSource
FROM FROM
c_competition c c_competition c
WHERE WHERE
@ -658,7 +673,22 @@
c.create_time, c.create_time,
c.sponsor, c.sponsor,
IFNULL( IFNULL(
( SELECT count( 1 ) FROM c_competition_registration WHERE competition_id = c.id GROUP BY competition_id HAVING count( 1 ) > 0 ), (
SELECT
count( 1 )
FROM
c_competition_registration r
INNER JOIN nakadai.hr_user_account a ON a.id = r.account_id
AND a.is_del = 0
INNER JOIN nakadai.hr_user_info u ON u.user_id = a.user_id
AND u.is_del = 0
WHERE
competition_id = c.id
GROUP BY
competition_id
HAVING
count( 1 ) > 0
),
0 0
) AS applicant_num, ) AS applicant_num,
c.is_open, c.is_open,
@ -666,15 +696,15 @@
( CASE create_source WHEN 0 THEN '平台创建' WHEN 1 THEN '组织创建' ELSE '无' END ) AS createSource, ( CASE create_source WHEN 0 THEN '平台创建' WHEN 1 THEN '组织创建' ELSE '无' END ) AS createSource,
IF IF
( (
( SELECT r.id FROM c_competition_registration r WHERE r.competition_id = c.id AND r.account_id = #{req.accountId} ) IS NULL, ( SELECT r.id FROM c_competition_registration r WHERE r.competition_id = c.id AND r.account_id = #{req.accountId} ) IS NULL,
1, 1,
0 0
) AS whetherToSignUp ) AS whetherToSignUp
FROM FROM
c_competition c c_competition c
WHERE WHERE
c.is_open = 0 c.is_open = 0
and c.publish_status = 1 AND c.publish_status = 1
<if test=" req.startTime!=null and req.endTime!=null "> <if test=" req.startTime!=null and req.endTime!=null ">
@ -698,44 +728,60 @@
</select> </select>
<select id="postRegistrationList" resultType="com.huoran.competition.entity.vo.CompetitionVO"> <select id="postRegistrationList" resultType="com.huoran.competition.entity.vo.CompetitionVO">
SELECT SELECT
* *
FROM FROM
( (
SELECT SELECT
c.id, c.id,
c.NAME AS competitionName, c.NAME AS competitionName,
c.founder_name, c.founder_name,
c.cover_url, c.cover_url,
c.competition_scope, c.competition_scope,
c.platform_source, c.platform_source,
c.publish_status, c.publish_status,
c.play_start_time, c.play_start_time,
c.play_end_time, c.play_end_time,
c.sign_up_start_time, c.sign_up_start_time,
c.sign_up_end_time, c.sign_up_end_time,
c.is_need_code, c.is_need_code,
c.invitation_code, c.invitation_code,
c.quantity_limit, c.quantity_limit,
c.whether_to_show_applicants, c.whether_to_show_applicants,
c.create_time, c.create_time,
c.sponsor, c.sponsor,
IFNULL( IFNULL(
( SELECT count( 1 ) FROM c_competition_registration WHERE competition_id = c.id GROUP BY competition_id HAVING count( 1 ) > 0 ), (
0 SELECT
) AS applicant_num, count( 1 )
c.is_open, FROM
create_source, c_competition_registration r
( CASE create_source WHEN 0 THEN '平台创建' WHEN 1 THEN '组织创建' ELSE '无' END ) AS createSource, INNER JOIN nakadai.hr_user_account a ON a.id = r.account_id
( SELECT d.id FROM c_competition_user_del d WHERE d.account_id = r.account_id AND d.competition_id = c.id ) AS isDelCompetition AND a.is_del = 0
FROM INNER JOIN nakadai.hr_user_info u ON u.user_id = a.user_id
c_competition_registration r AND u.is_del = 0
INNER JOIN c_competition c ON c.id = r.competition_id WHERE
WHERE competition_id = c.id
r.account_id = #{req.accountId} GROUP BY
AND r.is_disable = 0 competition_id
) t HAVING
count( 1 ) > 0
),
0
) AS applicant_num,
c.is_open,
create_source,
( CASE create_source WHEN 0 THEN '平台创建' WHEN 1 THEN '组织创建' ELSE '无' END ) AS createSource,
( SELECT d.id FROM c_competition_user_del d WHERE d.account_id = r.account_id AND d.competition_id = c.id ) AS isDelCompetition
FROM
c_competition_registration r
INNER JOIN c_competition c ON c.id = r.competition_id
WHERE
r.account_id = #{req.accountId}
AND r.is_disable = 0
) t
WHERE WHERE
t.isDelCompetition IS NULL t.isDelCompetition IS NULL
<if test=" req.startTime!=null and req.endTime!=null "> <if test=" req.startTime!=null and req.endTime!=null ">
and t.create_time between #{req.startTime} and #{req.endTime} and t.create_time between #{req.startTime} and #{req.endTime}

@ -48,8 +48,8 @@
END AS team_id END AS team_id
FROM FROM
c_competition_registration qa c_competition_registration qa
INNER JOIN nakadai.hr_user_account ua ON ua.id = qa.account_id INNER JOIN nakadai.hr_user_account ua ON ua.id = qa.account_id and ua.is_del = 0
INNER JOIN nakadai.hr_user_info u ON u.user_id = ua.user_id INNER JOIN nakadai.hr_user_info u ON u.user_id = ua.user_id and u.is_del = 0
LEFT JOIN c_competition_team ct ON ct.competition_id = qa.competition_id AND ct.account_id = qa.account_id LEFT JOIN c_competition_team ct ON ct.competition_id = qa.competition_id AND ct.account_id = qa.account_id
WHERE WHERE
qa.competition_id = #{req.competitionId} qa.competition_id = #{req.competitionId}
@ -135,4 +135,16 @@
join nakadai.school s on s.school_id = a.school_id join nakadai.school s on s.school_id = a.school_id
WHERE a.id = #{accountId} and s.is_del = 0 WHERE a.id = #{accountId} and s.is_del = 0
</select> </select>
<select id="countTheNumberOfApplicants" resultType="java.lang.Integer">
SELECT
count( 1 )
FROM
c_competition_registration r
INNER JOIN nakadai.hr_user_account a ON a.id = r.account_id
AND a.is_del = 0
INNER JOIN nakadai.hr_user_info u ON u.user_id = a.user_id
AND u.is_del = 0
WHERE
r.competition_id = #{competitionId}
</select>
</mapper> </mapper>

@ -251,9 +251,10 @@ public class CompetitionRegistrationServiceImpl extends ServiceImpl<CompetitionR
@Override @Override
public Integer registrationPopulation(String competitionId) { public Integer registrationPopulation(String competitionId) {
QueryWrapper<CompetitionRegistration> queryWrapper = new QueryWrapper<>(); /* QueryWrapper<CompetitionRegistration> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("competition_id", competitionId); queryWrapper.eq("competition_id", competitionId);
List<CompetitionRegistration> competitionRegistrations = baseMapper.selectList(queryWrapper); List<CompetitionRegistration> competitionRegistrations = baseMapper.selectList(queryWrapper);*/
return competitionRegistrations.size(); // return competitionRegistrations.size();
return baseMapper.countTheNumberOfApplicants(Integer.valueOf(competitionId));
} }
} }

Loading…
Cancel
Save