512 lines
19 KiB
XML
512 lines
19 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="combo">
|
||
|
|
|
||
|
|
|
||
|
|
<select id="comboArea" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
SELECT areaId as value, areaName as label
|
||
|
|
FROM Area
|
||
|
|
WHERE parentId = #{parentId}
|
||
|
|
ORDER BY areaId
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboSchoolByArea" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
SELECT schoolId as value, schoolName as label
|
||
|
|
FROM School WHERE areaId = #{areaId} and status = 1
|
||
|
|
ORDER BY schoolId
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboTeacherBySchool" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
SELECT teacherId as value, trueName as label
|
||
|
|
FROM Teacher
|
||
|
|
WHERE schoolId = #{schoolId} and status = 1
|
||
|
|
ORDER BY loginno
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboClassesBySchool" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
SELECT classesId as value, className as label
|
||
|
|
FROM Classes WHERE schoolId = #{schoolId}
|
||
|
|
and status = 1 and classType = 1
|
||
|
|
ORDER BY schoolyear desc , classorder asc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboClassesAllBySchool" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
SELECT a.classesId as value, a.className as label
|
||
|
|
FROM Classes as a inner join teacher as b on a.teacherId = b.teacherId WHERE b.schoolId = #{schoolId}
|
||
|
|
and a.status = 1
|
||
|
|
ORDER BY a.schoolyear desc , a.classorder asc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboClassesByTeacher" parameterType="java.util.Map" resultType="ComboItem">
|
||
|
|
SELECT classesId as value, className as label
|
||
|
|
FROM Classes
|
||
|
|
WHERE teacherId = #{teacherId} and status = 1
|
||
|
|
<if test="classType!=null">
|
||
|
|
AND classType = #{classType}
|
||
|
|
</if>
|
||
|
|
ORDER BY schoolyear desc , classorder asc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboLessonByParent" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
SELECT lessonId as value, lessonName as label,assigntime
|
||
|
|
FROM Lesson
|
||
|
|
WHERE parentId = #{parentId} and status = 1
|
||
|
|
order by orderId
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboLessonByParentNew" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
SELECT a.lessonId as value, a.lessonName as label,sum(b.assigntime) as assigntime
|
||
|
|
FROM Lesson as a inner join Lesson b on a.lessonId = b.parentId and b.status = 1
|
||
|
|
WHERE a.parentId = #{parentId} and a.status = 1
|
||
|
|
group by a.lessonId, a.lessonName
|
||
|
|
order by a.orderId
|
||
|
|
</select>
|
||
|
|
<select id="bookLessonNew" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
SELECT a.lessonId as value, a.lessonName as label,sum(c.assigntime) as assigntime
|
||
|
|
FROM Lesson as a inner join Lesson b on a.lessonId = b.parentId and b.status = 1 inner join Lesson c on b.lessonId = c.parentId and c.status = 1
|
||
|
|
WHERE a.lessonId = #{parentId} and a.status = 1
|
||
|
|
group by a.lessonId, a.lessonName
|
||
|
|
order by a.orderId
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboLessonRoleByLesson" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
SELECT lessonRoleId as value, name as label
|
||
|
|
FROM LessonRole
|
||
|
|
WHERE lessonId = #{lessonId} and status = 1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboLessonPartByLesson" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
SELECT lessonPartId as value, title as label
|
||
|
|
FROM LessonPart
|
||
|
|
WHERE lessonId = #{lessonId} and status = 1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboSentenceByLessonPart" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
SELECT sentenceId as value, content as label
|
||
|
|
FROM Sentence
|
||
|
|
WHERE lessonPartId = #{lessonPartId} and status = 1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboGoods" resultType="ComboItem">
|
||
|
|
SELECT goodsId as value, goodsName as label
|
||
|
|
FROM Goods
|
||
|
|
ORDER BY goodsId
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboUserOwnLesson" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
with temp0 as (
|
||
|
|
SELECT a.uid,
|
||
|
|
b.lessonid,
|
||
|
|
c.packagetitle AS lessonname,
|
||
|
|
c.coursetype,
|
||
|
|
c.coursecode,
|
||
|
|
b.orderid,
|
||
|
|
c.packagepic,
|
||
|
|
c.version,
|
||
|
|
c.versionno,
|
||
|
|
c.packagename AS url,
|
||
|
|
b.isrecommend,
|
||
|
|
b.lessonname AS bookname,
|
||
|
|
c.mobilpic
|
||
|
|
FROM userownlesson a
|
||
|
|
JOIN goods m ON a.goodsid = m.goodsid
|
||
|
|
JOIN goodsownpackage n ON a.goodsid = n.goodsid
|
||
|
|
JOIN respackage c ON n.lessonid = c.lessonid AND n.coursetype = c.coursetype
|
||
|
|
JOIN lesson b ON c.lessonid = b.lessonid AND b.status = 1
|
||
|
|
WHERE a.starttime <= now() and a.uid = #{uid}
|
||
|
|
AND c.courseType = 'L'
|
||
|
|
|
||
|
|
),
|
||
|
|
temp as(select b.unitid from assignment a inner join assigndetail b on
|
||
|
|
a.assignmentid=b.assignmentid and a.teacherid=#{uid}
|
||
|
|
AND a.assigntype = 'L'
|
||
|
|
order by created desc
|
||
|
|
limit 1),
|
||
|
|
temp4 as (select parentid from lesson a inner join temp b on a.lessonid =b.unitid ),
|
||
|
|
<!-- temp1 as (
|
||
|
|
SELECT lessonId
|
||
|
|
FROM temp0 a
|
||
|
|
WHERE uid = #{uid}
|
||
|
|
AND courseType = 'L' ),-->
|
||
|
|
|
||
|
|
temp2 as (
|
||
|
|
select a.parentid ,a.lessonname ,b.lessonid from temp0 as b inner join lesson as a on a.lessonid = b.lessonid
|
||
|
|
),
|
||
|
|
temp3 as (
|
||
|
|
select c.parentid as parentid ,a.lessonname ,b.lessonid from lesson as a inner join temp2 as b on a.lessonid = b.parentid
|
||
|
|
left join temp4 as c on c.parentid = b.lessonid
|
||
|
|
)
|
||
|
|
|
||
|
|
SELECT a.lessonId as value , bookname as label ,b.lessonname
|
||
|
|
FROM temp0 a left join temp3 as b on a.lessonid = b.lessonid
|
||
|
|
WHERE uid = #{uid}
|
||
|
|
AND courseType = 'L'
|
||
|
|
GROUP BY value,label,b.lessonname,b.parentid,coursecode,orderid,coursetype
|
||
|
|
order by b.parentid nulls last, coursecode,orderid,coursetype
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboUserOwnLessonNotWithTime" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
|
||
|
|
with temp as(select b.unitid from assignment a inner join assigndetail b on
|
||
|
|
a.assignmentid=b.assignmentid and a.teacherid= #{uid}
|
||
|
|
AND a.assigntype = 'L'
|
||
|
|
order by created desc
|
||
|
|
limit 1)
|
||
|
|
,
|
||
|
|
temp5 as (
|
||
|
|
select parentId from lesson as a inner join temp as b on a.lessonid = b.unitid
|
||
|
|
),
|
||
|
|
userOwnBook1 as (SELECT A
|
||
|
|
.uid,
|
||
|
|
b.lessonid,
|
||
|
|
C.packagetitle AS lessonname,
|
||
|
|
C.coursetype,
|
||
|
|
C.coursecode,
|
||
|
|
b.orderid,
|
||
|
|
C.packagepic,
|
||
|
|
C.VERSION,
|
||
|
|
C.versionno,
|
||
|
|
C.packagename AS url,
|
||
|
|
b.isrecommend,
|
||
|
|
b.lessonname AS bookname,
|
||
|
|
C.mobilpic,
|
||
|
|
M.isout,
|
||
|
|
A.starttime,
|
||
|
|
A.endtime
|
||
|
|
FROM
|
||
|
|
|
||
|
|
userownlesson
|
||
|
|
A JOIN goods M ON
|
||
|
|
A.uid = #{uid}
|
||
|
|
and
|
||
|
|
A.goodsid = M.goodsid
|
||
|
|
JOIN goodsownpackage n ON
|
||
|
|
A.goodsid = n.goodsid
|
||
|
|
JOIN respackage C ON
|
||
|
|
n.lessonid = C.lessonid
|
||
|
|
AND n.coursetype = C.coursetype
|
||
|
|
JOIN lesson b ON
|
||
|
|
C.lessonid = b.lessonid
|
||
|
|
),
|
||
|
|
temp2 as (SELECT lessonId
|
||
|
|
FROM userOwnBook1 a
|
||
|
|
WHERE uid = #{uid}
|
||
|
|
AND courseType = 'L'),
|
||
|
|
temp3 as (
|
||
|
|
select a.parentid ,a.lessonname ,b.lessonid from temp2 as b inner join lesson as a on a.lessonid = b.lessonid
|
||
|
|
) ,
|
||
|
|
temp4 as (
|
||
|
|
select c.parentid as parentid ,a.lessonname ,b.lessonid from lesson as a inner join temp3 as b on a.lessonid = b.parentid
|
||
|
|
LEFT join temp5 as c on b.lessonid=c.parentid
|
||
|
|
)
|
||
|
|
SELECT a.lessonId as value , bookname as label ,b.lessonname
|
||
|
|
FROM userOwnBook1 a left join temp4 as b on a.lessonid = b.lessonid
|
||
|
|
WHERE uid = #{uid}
|
||
|
|
AND courseType = 'L'
|
||
|
|
GROUP BY value,label,b.lessonname,b.parentid,coursecode,orderid,coursetype
|
||
|
|
order by b.parentid nulls last, coursecode,orderid,coursetype
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboUserOwnWord" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
<!-- SELECT lessonId as value , bookname as label
|
||
|
|
FROM v_userOwnBook
|
||
|
|
WHERE uid = #{uid}
|
||
|
|
AND courseType = 'W'
|
||
|
|
order by coursecode,orderid,coursetype -->
|
||
|
|
|
||
|
|
with temp as(select b.unitid from assignment a inner join assigndetail b on
|
||
|
|
a.assignmentid=b.assignmentid and a.teacherid=#{uid}
|
||
|
|
AND a.assigntype = 'W'
|
||
|
|
order by created desc
|
||
|
|
limit 1),
|
||
|
|
temp2 as (select parentid from lesson a inner join temp b on a.lessonid =b.unitid ),
|
||
|
|
temp as (SELECT a.*,b.parentid
|
||
|
|
FROM v_userOwnBook a left join lesson as b on a.lessonid=b.lessonid
|
||
|
|
WHERE uid = #{uid}
|
||
|
|
AND courseType = 'W'
|
||
|
|
)
|
||
|
|
select a.lessonid as value ,a.bookname as label ,b.lessonname from temp as a inner join lesson as b on a.parentid = b.lessonid
|
||
|
|
left join temp2 as c on a.lessonid = c.parentid
|
||
|
|
GROUP BY value,label,b.lessonname,c.parentid,a.coursecode,a.orderid,a.coursetype
|
||
|
|
order by c.parentid nulls last,a.coursecode,a.orderid,a.coursetype
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboUserOwnWordNotWithTime" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
<!-- SELECT lessonId as value , bookname as label
|
||
|
|
FROM v_userOwnBook
|
||
|
|
WHERE uid = #{uid}
|
||
|
|
AND courseType = 'W'
|
||
|
|
order by coursecode,orderid,coursetype -->
|
||
|
|
|
||
|
|
with temp as(select b.unitid from assignment a inner join assigndetail b on
|
||
|
|
a.assignmentid=b.assignmentid and a.teacherid=#{uid}
|
||
|
|
AND a.assigntype = 'W'
|
||
|
|
order by created desc
|
||
|
|
limit 1),
|
||
|
|
temp2 as (
|
||
|
|
select parentid from lesson a inner join temp b on a.lessonid =b.unitid
|
||
|
|
),
|
||
|
|
userOwnBook1 as
|
||
|
|
(SELECT A
|
||
|
|
.uid,
|
||
|
|
b.lessonid,b.parentid,
|
||
|
|
C.packagetitle AS lessonname,
|
||
|
|
C.coursetype,
|
||
|
|
C.coursecode,
|
||
|
|
b.orderid,
|
||
|
|
C.packagepic,
|
||
|
|
C.VERSION,
|
||
|
|
C.versionno,
|
||
|
|
C.packagename AS url,
|
||
|
|
b.isrecommend,
|
||
|
|
b.lessonname AS bookname,
|
||
|
|
C.mobilpic,
|
||
|
|
M.isout,
|
||
|
|
A.starttime,
|
||
|
|
A.endtime
|
||
|
|
FROM
|
||
|
|
|
||
|
|
userownlesson
|
||
|
|
A JOIN goods M ON
|
||
|
|
A.uid = #{uid}
|
||
|
|
and
|
||
|
|
A.goodsid = M.goodsid
|
||
|
|
JOIN goodsownpackage n ON
|
||
|
|
A.goodsid = n.goodsid
|
||
|
|
JOIN respackage C ON
|
||
|
|
n.lessonid = C.lessonid
|
||
|
|
AND n.coursetype = C.coursetype
|
||
|
|
JOIN lesson b ON
|
||
|
|
C.lessonid = b.lessonid
|
||
|
|
)
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
SELECT a.lessonId as value , bookname as label , b.lessonname
|
||
|
|
FROM userOwnBook1 a left join lesson b on a.parentid=b.lessonid left join temp2 as c on a.lessonid = c.parentid
|
||
|
|
WHERE
|
||
|
|
a.courseType = 'W'
|
||
|
|
GROUP BY value,label,b.lessonname,c.parentid,a.coursecode,a.orderid,a.coursetype
|
||
|
|
order by c.parentid nulls last,a.coursecode,a.orderid,a.coursetype
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboStudentOwnClasses" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
select s.classesid as value , c.classname as label
|
||
|
|
from studentownclass s
|
||
|
|
inner join classes c
|
||
|
|
on s.classesid = c.classesid and c.status=1 and s.status=1
|
||
|
|
where studentid = #{uid} and isdelegate = 1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboUnivByArea" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
SELECT schoolId as value, schoolName as label
|
||
|
|
FROM University
|
||
|
|
WHERE areaId = #{areaId} and status = 1
|
||
|
|
ORDER BY schoolId
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboUnivTeacherBySchool" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
SELECT teacherId as value, trueName as label
|
||
|
|
FROM UnivTeacher
|
||
|
|
WHERE schoolId = #{schoolId} and status = 1
|
||
|
|
ORDER BY loginno
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboUnivOwnBook" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
SELECT c.lessonId as value , c.lessonname as label
|
||
|
|
FROM ( select goodsId from UnivOwnLesson
|
||
|
|
where schoolId = #{schoolId}
|
||
|
|
|
||
|
|
and startTime < current_timestamp
|
||
|
|
and endTime > current_timestamp
|
||
|
|
) a
|
||
|
|
INNER JOIN GoodsOwnPackage b
|
||
|
|
ON a.goodsid = b.goodsid and b.courseType = 'L'
|
||
|
|
INNER JOIN Lesson c
|
||
|
|
ON b.lessonId = c.lessonId and c.status = 1
|
||
|
|
ORDER BY c.lessonId
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboUnivuserOwnClass" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
select s.classesid as value , c.classname as label
|
||
|
|
from Univstudentownclass s
|
||
|
|
inner join Univclasses c
|
||
|
|
on s.classesid = c.classesid
|
||
|
|
where studentid = #{uid} and isdelegate = 1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="allUnivs" resultType="ComboItem">
|
||
|
|
SELECT schoolId as value, schoolName as label
|
||
|
|
FROM University
|
||
|
|
WHERE status = 1
|
||
|
|
ORDER BY areaId asc , schoolId asc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="comboUnivClassesBySchool" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
SELECT classesId as value, className as label
|
||
|
|
FROM UnivClasses WHERE schoolId = #{schoolId}
|
||
|
|
and status = 1 and classType = 1
|
||
|
|
ORDER BY schoolyear desc , classorder asc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="comboClassesByArea" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
|
||
|
|
select classesid as value,className as label from classes c inner join
|
||
|
|
school s on c.schoolid=s.schoolid and s.areaid = #{areaId} and c.status=1
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboAdminsByRoleType" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
|
||
|
|
<!-- SELECT adminId as value,truename as label
|
||
|
|
FROM Admin
|
||
|
|
WHERE roleType = #{roleType} AND status = 1
|
||
|
|
|
||
|
|
AND startTime<now()
|
||
|
|
AND endTime>now()
|
||
|
|
|
||
|
|
ORDER BY adminId desc -->
|
||
|
|
|
||
|
|
|
||
|
|
SELECT adminId as value,truename as label,1 as o
|
||
|
|
FROM Admin
|
||
|
|
WHERE roleType = #{_parameter} AND status = 1
|
||
|
|
|
||
|
|
AND startTime<now()
|
||
|
|
AND endTime>now()
|
||
|
|
|
||
|
|
|
||
|
|
<if test="_parameter==12">
|
||
|
|
union
|
||
|
|
|
||
|
|
SELECT adminId as value,truename as label,-1 as o
|
||
|
|
FROM Admin
|
||
|
|
WHERE roleType = #{_parameter} AND status = 1
|
||
|
|
|
||
|
|
AND startTime<now()
|
||
|
|
AND endTime<=now()
|
||
|
|
</if>
|
||
|
|
order by o desc ,value desc
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="comboAdminRuleOtherByAdminId" parameterType="java.util.Map" resultType="ComboItem">
|
||
|
|
|
||
|
|
select aro.subadminid as value,a.truename as label from adminruleother aro
|
||
|
|
inner join
|
||
|
|
admin a
|
||
|
|
on aro.subadminid= a.adminId and aro.adminid=#{adminId} and a.status = 1
|
||
|
|
<if test="isAll==null">
|
||
|
|
AND a.startTime<now()
|
||
|
|
AND a.endTime>now()
|
||
|
|
</if>
|
||
|
|
<if test="roleType != null">AND
|
||
|
|
|
||
|
|
aro.roleType = #{roleType}
|
||
|
|
|
||
|
|
</if>
|
||
|
|
|
||
|
|
ORDER BY aro.subadminid desc
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="comboClassesByParent" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
|
||
|
|
select classesid as value,className as label from classes c inner join
|
||
|
|
school s on c.schoolid=s.schoolid and s.areaid in
|
||
|
|
(select areaId from area where parentid=#{areaId})
|
||
|
|
and c.status=1
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboClassesByProvince" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
|
||
|
|
select classesid as value,className as label from classes c inner join
|
||
|
|
school s on c.schoolid=s.schoolid and s.areaid in
|
||
|
|
(select areaId from area where parentid in
|
||
|
|
(select areaId from area where parentid = #{areaId} ))
|
||
|
|
and c.status=1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="comboAdminOwnSchoolByAreaId" parameterType="java.util.Map" resultType="ComboItem">
|
||
|
|
|
||
|
|
select a.schoolId as value,s.schoolname as label from adminownschool a inner join school s
|
||
|
|
on a.schoolid=s.schoolid and s.status=1 and a.adminid=#{adminId}
|
||
|
|
and s.areaId=#{areaId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboClassOwnMessageByMessageId" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
select com.classesId as value,c.classname as label from classownmessage com inner join
|
||
|
|
classes c on c.classesId = com.classesid and com.classmessageid=#{messageId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboAdminOwnAreaByAdminId" parameterType="java.util.Map" resultType="ComboItem">
|
||
|
|
<if test="type==1">
|
||
|
|
with temp as(
|
||
|
|
select a.areaId as value,areaName as label from adminownarea a inner join
|
||
|
|
area b on a.areaid=b.areaid and a.adminId=#{adminId} and type = 1
|
||
|
|
),
|
||
|
|
temp1 as(select distinct c.areaId as value,c.areaName as label from adminownarea a inner join
|
||
|
|
area b on a.areaid=b.areaid and a.adminId=#{adminId} and type = 2
|
||
|
|
inner join area c on b.parentId=c.areaId)
|
||
|
|
select distinct value,label from (select value,label from temp union all select value,label from temp1 )
|
||
|
|
as a order by value
|
||
|
|
</if>
|
||
|
|
<if test="type==3">
|
||
|
|
select a.areaId as value,areaName as label from adminownarea a inner join
|
||
|
|
area b on a.areaid=b.areaid and a.adminId=#{adminId} and (type = 1 or type=2)
|
||
|
|
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboAdminOwnAreaByAdminIdAndAreaId" parameterType="java.util.Map" resultType="ComboItem">
|
||
|
|
|
||
|
|
select a.areaId as value,a.areaName as label from area a inner join adminownarea b
|
||
|
|
on a.areaid=b.areaid and a.parentId=#{areaId} and b.adminId=#{adminId} and b.type=2
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="secondProxyerOwnCity" parameterType="java.lang.Integer" resultType="ComboItem">
|
||
|
|
|
||
|
|
select a.areaId as value,a.areaName as label from area a inner join area b
|
||
|
|
on a.areaId=b.parentId and b.areaid=#{areaId}
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="comboUnivOwnWord" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
SELECT c.lessonId as value , c.lessonname as label
|
||
|
|
FROM ( select goodsId from UnivOwnLesson
|
||
|
|
where schoolId = #{schoolId}
|
||
|
|
|
||
|
|
and startTime < current_timestamp
|
||
|
|
and endTime > current_timestamp
|
||
|
|
) a
|
||
|
|
INNER JOIN GoodsOwnPackage b
|
||
|
|
ON a.goodsid = b.goodsid and b.courseType = 'W'
|
||
|
|
INNER JOIN Lesson c
|
||
|
|
ON b.lessonId = c.lessonId and c.status = 1
|
||
|
|
ORDER BY c.lessonId
|
||
|
|
</select>
|
||
|
|
<select id="comboStudyOwnSchool" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
|
||
|
|
select a.valuelong as value,b.schoolname as label from parameter a inner join school b on
|
||
|
|
a.valuelong=b.schoolId and a.paralong=#{adminId} and a.paratype=9
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="comboGradeLeaderOwnClass" parameterType="java.lang.Long" resultType="ComboItem">
|
||
|
|
|
||
|
|
select a.valuelong as value,b.classname as label from parameter a inner join classes b on
|
||
|
|
a.valuelong=b.classesId and a.paralong=#{adminId} and a.paratype=10
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
</mapper>
|