54 lines
2.1 KiB
XML
54 lines
2.1 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="University">
|
||
|
|
|
||
|
|
<insert id="insertUniversity" parameterType="University">
|
||
|
|
INSERT INTO University ( schoolId, schoolName, address, areaId, telephone, url, contactor, cellphone, description, status , port , server ) Values ( #{schoolId}, #{schoolName}, #{address}, #{areaId}, #{telephone}, #{url}, #{contactor}, #{cellphone}, #{description}, #{status} , #{port} , #{server} )
|
||
|
|
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateUniversity" parameterType="University">
|
||
|
|
|
||
|
|
|
||
|
|
UPDATE University SET
|
||
|
|
|
||
|
|
schoolId = #{schoolId}, schoolName = #{schoolName}, address = #{address}, areaId = #{areaId}, telephone = #{telephone}, url = #{url}, contactor = #{contactor}, cellphone = #{cellphone}, description = #{description}, status = #{status} , port = #{port} , server = #{server}
|
||
|
|
where schoolId=#{schoolId}
|
||
|
|
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<select id="getUniversityByKey" parameterType="java.lang.Long" resultType="University">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
SELECT schoolId , schoolName , address , areaId , telephone , url , contactor , cellphone , description , status , port , server
|
||
|
|
FROM University WHERE schoolId=#{schoolId}
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="getSeqUniversity" resultType="Integer" useCache="false" flushCache="true">
|
||
|
|
|
||
|
|
SELECT nextval('seq_universityid') ;
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="getUniversitysCountByAreaId" parameterType="java.lang.Integer" resultType="Integer">
|
||
|
|
|
||
|
|
SELECT count(*) as howmuch from University
|
||
|
|
WHERE areaId=#{areaId}and status = 1
|
||
|
|
|
||
|
|
</select>
|
||
|
|
<select id="getUniversitysByAreaId" parameterType="java.util.Map" resultType="University">
|
||
|
|
|
||
|
|
|
||
|
|
SELECT schoolId , schoolName , address , areaId , telephone , url , contactor , cellphone , description , status , port , server
|
||
|
|
FROM University
|
||
|
|
WHERE areaId=#{areaId} and status = 1
|
||
|
|
LIMIT #{pageSize} OFFSET #{offset}
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
</mapper>
|