<?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
|
) order by createTime desc limit 0, 1
|
</select>
|
|
|
|
<select id="getMyWorldCupList" resultType="com.dsh.communityWorldCup.model.WorldCupListVo">
|
select
|
a.id,
|
b.worldCupId,
|
c.name,
|
DATE_FORMAT(ifnull(c.registrationClosingTime, c.endTime), '%Y-%m-%d %H:%i') as registrationClosingTime,
|
CONCAT(c.startAge, '-', c.endAge) as age,
|
c.coverImg,
|
c.intro as content,
|
c.lon,
|
c.lat,
|
c.basePeople as heat,
|
c.status
|
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)
|
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>
|
|
|
|
<select id="getCount" resultType="int">
|
select count(*) from (
|
select
|
participantId,
|
participantType
|
from t_world_cup_payment_participant where worldCupId = #{worldCupId} and worldCupPaymentId in
|
<foreach collection="worldCupPaymentId" item="item" index="index" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
group by participantId, participantType
|
) as aa
|
</select>
|
|
|
|
<select id="getUserGameRecordList" resultType="map">
|
select
|
participantType,
|
participantId,
|
appUserId
|
from t_world_cup_payment_participant group by participantType, participantId, appUserId
|
</select>
|
</mapper>
|