main
rong.liu 11 months ago
parent b9c2592d4b
commit 7915da7ad4
  1. 111
      competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionMapper.xml

@ -673,7 +673,22 @@
c.create_time,
c.sponsor,
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
) AS applicant_num,
c.is_open,
@ -681,15 +696,15 @@
( CASE create_source WHEN 0 THEN '平台创建' WHEN 1 THEN '组织创建' ELSE '无' END ) AS createSource,
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,
0
) AS whetherToSignUp
FROM
c_competition c
WHERE
c.is_open = 0
and c.publish_status = 1
c.is_open = 0
AND c.publish_status = 1
<if test=" req.startTime!=null and req.endTime!=null ">
@ -713,44 +728,60 @@
</select>
<select id="postRegistrationList" resultType="com.huoran.competition.entity.vo.CompetitionVO">
SELECT
*
*
FROM
(
SELECT
c.id,
c.NAME AS competitionName,
c.founder_name,
c.cover_url,
c.competition_scope,
c.platform_source,
c.publish_status,
c.play_start_time,
c.play_end_time,
c.sign_up_start_time,
c.sign_up_end_time,
c.is_need_code,
c.invitation_code,
c.quantity_limit,
c.whether_to_show_applicants,
c.create_time,
c.sponsor,
IFNULL(
( SELECT count( 1 ) FROM c_competition_registration WHERE competition_id = c.id GROUP BY competition_id 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
(
SELECT
c.id,
c.NAME AS competitionName,
c.founder_name,
c.cover_url,
c.competition_scope,
c.platform_source,
c.publish_status,
c.play_start_time,
c.play_end_time,
c.sign_up_start_time,
c.sign_up_end_time,
c.is_need_code,
c.invitation_code,
c.quantity_limit,
c.whether_to_show_applicants,
c.create_time,
c.sponsor,
IFNULL(
(
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
) 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
t.isDelCompetition IS NULL
t.isDelCompetition IS NULL
<if test=" req.startTime!=null and req.endTime!=null ">
and t.create_time between #{req.startTime} and #{req.endTime}

Loading…
Cancel
Save