<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.dsh.communityWorldCup.mapper.WorldCupPaymentParticipantMapper">
|
|
|
|
<select id="getWorldCupPaymentParticipant" resultType="com.dsh.communityWorldCup.entity.WorldCupPaymentParticipant">
|
select *
|
from t_world_cup_payment_participant
|
where worldCupId = #{worldCupId} and participantType = #{participantType} and participantId = #{participantId} and worldCupPaymentId in (
|
select id from t_world_cup_payment where worldCupId = #{worldCupId} and payStatus = 2 and state = 1
|
)
|
</select>
|
|
|
|
<select id="getMyWorldCupList" resultType="com.dsh.communityWorldCup.model.WorldCupListVo">
|
select
|
a.id,
|
c.name,
|
DATE_FORMATc.registrationClosingTime, '%Y-%m-%d %H:%i') as registrationClosingTime,
|
CONCAT(c.startAge, '-', c.endAge) as age,
|
c.coverImg,
|
c.intro as content,
|
c.lon,
|
c.lat,
|
ifnull(d.num, 0) + c.basePeople as heat
|
from t_world_cup_payment_participant a
|
left join t_world_cup_payment b on (a.worldCupPaymentId = b.id)
|
left join t_world_cup c on (b.worldCupId = c.id)
|
left join (select worldCupId, count(*) as num from t_world_cup_payment_participant where worldCupPaymentId in (select id from t_world_cup_payment where payStatus = 2 and refundTime is null and state = 1) group by worldCupId) d on (c.id = d.worldCupId)
|
where a.participantType = #{item.isStudent} and a.participantId = #{item.id} and b.payStatus = 2 and b.refundTime is null and b.state = 1
|
<if test="null != item.state">
|
and c.status = #{item.state}
|
</if>
|
order by b.createTime desc limit #{item.pageNo}, #{item.pageSize}
|
</select>
|
</mapper>
|