| | |
| | | <!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> |