75 lines
2.9 KiB
XML
75 lines
2.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="UnivMaterial">
|
||
|
|
|
||
|
|
<insert id="insertUnivMaterial" parameterType="UnivMaterial">
|
||
|
|
INSERT INTO UnivMaterial ( materialId, teacherId, title, content, picture,
|
||
|
|
origiVoice, created, status , areaid , isNetMate )
|
||
|
|
Values ( #{materialId}, #{teacherId}, #{title}, #{content}, #{picture},
|
||
|
|
#{origiVoice},current_timestamp, #{status} , #{areaid} , #{isNetMate} )
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateUnivMaterial" parameterType="UnivMaterial">
|
||
|
|
UPDATE UnivMaterial
|
||
|
|
SET materialId = #{materialId}, teacherId = #{teacherId}, title = #{title},
|
||
|
|
content = #{content}, picture = #{picture}, origiVoice = #{origiVoice},
|
||
|
|
created = #{created}, status = #{status} , areaid = #{areaid} ,
|
||
|
|
isNetMate = #{isNetMate}
|
||
|
|
where materialId=#{materialId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<select id="getUnivMaterialByKey" parameterType="java.lang.Integer" resultType="UnivMaterial">
|
||
|
|
SELECT materialId , teacherId , title , content , picture , origiVoice ,
|
||
|
|
created , status , areaid ,isNetMate
|
||
|
|
FROM UnivMaterial
|
||
|
|
WHERE materialId=#{materialId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getSeqUnivMaterialId" resultType="Integer" useCache="false" flushCache="true">
|
||
|
|
SELECT nextval('seq_UnivmaterialId')
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getUnivMaterialsCountByTeacherId" parameterType="java.util.Map" resultType="Integer">
|
||
|
|
SELECT count(*) as howmuch
|
||
|
|
from UnivMaterial
|
||
|
|
WHERE teacherId=#{teacherId} and status = 1
|
||
|
|
and areaid = #{areaid}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getUnivMaterialsByTeacherId" parameterType="java.util.Map" resultType="UnivMaterial">
|
||
|
|
SELECT materialId , teacherId , title , content , picture , origiVoice ,
|
||
|
|
created , status , areaid , isNetMate
|
||
|
|
FROM UnivMaterial
|
||
|
|
WHERE teacherId=#{teacherId} and status = 1 and areaid = #{areaid}
|
||
|
|
ORDER BY materialId desc
|
||
|
|
LIMIT #{pageSize} OFFSET #{offset}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<update id="UnivmaterialBatchUpdateByMaterialId">
|
||
|
|
UPDATE UnivMaterial
|
||
|
|
SET status = 0
|
||
|
|
WHERE materialId in
|
||
|
|
<foreach collection="list" index="index" item="item" separator="," close=")" open="(">
|
||
|
|
|
||
|
|
#{item}
|
||
|
|
|
||
|
|
</foreach>
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<select id="getUnivMaterialsCountByNet" resultType="Integer">
|
||
|
|
SELECT count(*) as howmuch
|
||
|
|
FROM UnivMaterial
|
||
|
|
WHERE isNetMate =1 and status =1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getUnivMaterialsByNet" parameterType="java.util.Map" resultType="UnivMaterial">
|
||
|
|
SELECT materialId , teacherId , title , content , picture , origiVoice ,
|
||
|
|
created , status , areaid , isNetMate
|
||
|
|
FROM UnivMaterial
|
||
|
|
WHERE isNetMate = 1 and status = 1
|
||
|
|
ORDER BY materialId desc
|
||
|
|
LIMIT #{pageSize} OFFSET #{offset}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
</mapper>
|