lisy
2023-07-07 59ad364486c751e68ea61125badeabcbd318fcb2
cloud-server-competition/src/main/resources/mapper/UserCompetitionMapper.xml
@@ -2,37 +2,5 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsh.competition.mapper.UserCompetitionMapper">
    <select id="queryUsersCompetetions" resultType="com.dsh.competition.entity.UserCompetition">
        SELECT *
        FROM t_user_competition
        UNION ALL
        SELECT *
        FROM t_user_competition1
        UNION ALL
        SELECT *
        FROM t_user_competition2
        UNION ALL
        SELECT *
        FROM t_user_competition3
        UNION ALL
        SELECT *
        FROM t_user_competition4
        UNION ALL
        SELECT *
        FROM t_user_competition5
        WHERE 1 = 1
        <if test=" stuId != null">
            and studentId = #{stuId}
        </if>
        <if test="appUserId != null">
            and competitionId in
        <foreach collection="comIds" item="item" separator="," open="(" index="index" close=")">
            #{item}
        </foreach>
        </if>
        <if test="startTime != null and endTime != null">
            and (insertTime between #{startTime} and #{endTime})
        </if>
    </select>
</mapper>