143 lines
5.2 KiB
XML
Raw Normal View History

2026-03-10 14:30:24 +08:00
<?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="PackageHelp">
<select id="getSentCountByBook" parameterType="java.lang.Integer" resultType="java.lang.Integer">
select count( s.sentenceId ) as howmuch
from Lesson u
inner join Lesson l
on u.lessonId = l.parentId and u.status =1
inner join LessonPart lp
on lp.lessonId = l.lessonId
inner join Sentence s
on s.lessonPartId = lp.lessonPartId and s.status = 1
where u.parentId = #{bookId} ;
</select>
<select id="getWordCountByBook" parameterType="java.lang.Integer" resultType="java.lang.Integer">
select count( w.wordsId ) as howmuch
from Lesson u
inner join Words w
on u.lessonId = w.lessonId and w.status=1
where u.parentId = #{bookId} ;
</select>
<select id="getBookPictureByBook" parameterType="java.lang.Integer" resultType="BookPicture">
select u.lessonId , u.courseCode , w.picture
from Lesson u
inner join Words w
on u.lessonId = w.lessonId and w.status=1
where u.parentId = #{bookId}
and length( trim( w.picture ) ) &gt; 0
order by u.orderId , w.wordsId ;
</select>
<select id="getAllSentsByBookIdForCheck" parameterType="java.lang.Integer" resultType="java.util.HashMap">
select a.lessonName as unitName , b.courseCode ,
c.title , d.content , c.orderId as partOrderId , a.courseCode as unitCode
from ( select lessonId , lessonname , orderId , courseCode
from lesson
where parentId = #{bookId} and status = 1 ) a
inner join Lesson b
on a.lessonId = b.parentId and b.status = 1
inner join LessonPart c
on b.lessonId = c.lessonId and c.status = 1
inner join Sentence d
on d.lessonPartId = c.lessonPartId and d.status = 1
order by a.orderId , b.orderId , c.orderId , d.orderId
</select>
<select id="getAllWordsByBookIdForCheck" parameterType="java.lang.Integer" resultType="java.util.HashMap">
select a.lessonName as unitName , a.courseCode ,
b.content , b.picture , b.example1 , b.example2 , b.example3
from ( select lessonId , lessonName , courseCode , orderId
from lesson
where parentId = #{bookId} and status = 1 ) a
inner join Words b
on a.lessonId = b.lessonId and b.status=1
order by a.orderId , b.wordsId
</select>
<select id="getEditor_SentCountByBook" parameterType="java.lang.Integer" resultType="java.lang.Integer">
select count( s.sentenceId ) as howmuch
from Editor_Lesson u
inner join Editor_Lesson l
on u.lessonId = l.parentId and u.status =1
inner join Editor_LessonPart lp
on lp.lessonId = l.lessonId
inner join Editor_Sentence s
on s.lessonPartId = lp.lessonPartId and s.status = 1
where u.parentId = #{bookId} ;
</select>
<select id="getEditor_WordCountByBook" parameterType="java.lang.Integer" resultType="java.lang.Integer">
select count( w.wordsId ) as howmuch
from Lesson u
inner join Editor_Words w
on u.lessonId = w.lessonId and w.status=1
where u.parentId = #{bookId} ;
</select>
<select id="getEditor_BookPictureByBook" parameterType="java.lang.Integer" resultType="BookPicture">
select u.lessonId , u.courseCode , w.picture
from Lesson u
inner join Editor_Words w
on u.lessonId = w.lessonId
where u.parentId = #{bookId} and b.status=1
and length( trim( w.picture ) ) &gt; 0
order by u.orderId , w.wordsId ;
</select>
<select id="getEditor_AllSentsByBookIdForCheck" parameterType="java.lang.Integer" resultType="java.util.HashMap">
select a.lessonName as unitName , b.courseCode ,
c.title , d.content , c.orderId as partOrderId , a.courseCode as unitCode
from ( select lessonId , lessonname , orderId , courseCode
from Editor_lesson
where parentId = #{bookId} and status = 1 ) a
inner join Editor_Lesson b
on a.lessonId = b.parentId and b.status = 1
inner join Editor_LessonPart c
on b.lessonId = c.lessonId and c.status = 1
inner join Editor_Sentence d
on d.lessonPartId = c.lessonPartId and d.status = 1
order by a.orderId , b.orderId , c.orderId , d.orderId
</select>
<select id="getEditor_AllWordsByBookIdForCheck" parameterType="java.lang.Integer" resultType="java.util.HashMap">
select a.lessonName as unitName , a.courseCode ,
b.content , b.picture , b.example1 , b.example2 , b.example3
from ( select lessonId , lessonName , courseCode , orderId
from lesson
where parentId = #{bookId} and status = 1 ) a
inner join Editor_Words b
on a.lessonId = b.lessonId and b.status=1
order by a.orderId , b.wordsId
</select>
</mapper>