67 lines
1.9 KiB
XML
67 lines
1.9 KiB
XML
|
|
<?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="UnivOwnRace">
|
||
|
|
|
||
|
|
<insert id="insertUnivOwnRace" parameterType="UnivOwnRace">
|
||
|
|
INSERT INTO UnivOwnRace ( schoolId, raceId, areaId ) Values ( #{schoolId}, #{raceId}, #{areaId} )
|
||
|
|
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateUnivOwnRace" parameterType="UnivOwnRace">
|
||
|
|
|
||
|
|
|
||
|
|
UPDATE UnivOwnRace SET
|
||
|
|
|
||
|
|
schoolId = #{schoolId}, raceId = #{raceId}, areaId = #{areaId}
|
||
|
|
where schoolId=#{schoolId} and raceId=#{raceId}
|
||
|
|
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<select id="getUnivOwnRaceByKey" parameterType="java.util.Map" resultType="UnivOwnRace">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
SELECT schoolId , raceId , areaId
|
||
|
|
FROM UnivOwnRace WHERE schoolId=#{schoolId} and raceId=#{raceId}
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="getSeqUnivOwnRace" resultType="Integer" useCache="false" flushCache="true">
|
||
|
|
|
||
|
|
SELECT nextval('seq_univOwnRaceId') ;
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<insert id="insertUnivOwnRaceBatch" parameterType="java.util.List">
|
||
|
|
|
||
|
|
INSERT INTO UnivOwnRace ( schoolId, raceId, areaId ) Values
|
||
|
|
|
||
|
|
<foreach collection="list" index="index" item="item" separator=",">
|
||
|
|
|
||
|
|
( #{item.schoolId}, #{item.raceId}, #{item.areaId} )
|
||
|
|
|
||
|
|
</foreach>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<delete id="deleteUnivOwnRaceByRaceId" parameterType="Integer">
|
||
|
|
DELETE FROM UnivOwnRace
|
||
|
|
WHERE raceId = #{raceId}
|
||
|
|
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<select id="getUnivsMapByRaceId" parameterType="java.lang.Integer" resultType="java.util.HashMap">
|
||
|
|
select a.schoolId , a.raceId , a.areaId , b.schoolName
|
||
|
|
from UnivOwnRace a
|
||
|
|
inner join university b
|
||
|
|
on a.schoolId = b.schoolId
|
||
|
|
where a.raceId = #{raceId}
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
</mapper>
|