61 lines
1.9 KiB
XML
61 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="SchoolOwnRace">
|
||
|
|
|
||
|
|
<insert id="insertSchoolOwnRace" parameterType="SchoolOwnRace">
|
||
|
|
INSERT INTO SchoolOwnRace ( schoolId, raceId , areaid ) Values
|
||
|
|
( #{schoolId}, #{raceId} , #{areaid} )
|
||
|
|
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateSchoolOwnRace" parameterType="SchoolOwnRace">
|
||
|
|
UPDATE SchoolOwnRace
|
||
|
|
SET schoolId = #{schoolId}, raceId = #{raceId}
|
||
|
|
WHERE schoolId=#{schoolId} and raceId=#{raceId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<select id="getSchoolOwnRaceByKey" parameterType="java.util.Map" resultType="SchoolOwnRace">
|
||
|
|
|
||
|
|
SELECT schoolId , raceId , areaid
|
||
|
|
FROM SchoolOwnRace
|
||
|
|
WHERE schoolId=#{schoolId} and raceId=#{raceId} and areaid = #{areaid}
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getSeqSchoolOwnRace" resultType="Integer" useCache="false" flushCache="true">
|
||
|
|
|
||
|
|
SELECT nextval('seq_schoolOwnRaceId') ;
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<insert id="insertSchoolOwnRaceBatch" parameterType="java.util.List">
|
||
|
|
|
||
|
|
INSERT INTO SchoolOwnRace ( schoolId, raceId , areaid ) Values
|
||
|
|
|
||
|
|
<foreach collection="list" index="index" item="item" separator=",">
|
||
|
|
|
||
|
|
( #{item.schoolId}, #{item.raceId} , #{item.areaid} )
|
||
|
|
|
||
|
|
</foreach>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<delete id="deleteSchoolOwnRaceByRaceId" parameterType="Integer">
|
||
|
|
DELETE FROM SchoolOwnRace
|
||
|
|
WHERE raceId = #{raceId}
|
||
|
|
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<select id="getSchoolsMapByRaceId" parameterType="java.lang.Integer" resultType="java.util.HashMap">
|
||
|
|
select a.schoolId , a.raceId , a.areaid , b.schoolName
|
||
|
|
from SchoolOwnRace a
|
||
|
|
inner join School b
|
||
|
|
on a.schoolId = b.schoolId
|
||
|
|
where a.raceId = #{raceId}
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</mapper>
|