549 lines
19 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="Parameter">
<select id="judgeRaceQt" resultType="Integer">
select count(paraid) from Parameter where paraLong = #{stuId} and paraInt = #{raceId}
</select>
<insert id="insertParameter" parameterType="Parameter">
INSERT INTO Parameter ( paraId,paraType,paraInt,paraLong,valueInt,valueLong,valueStr,startTime,created,status,description,memo )
Values ( #{paraId},#{paraType},#{paraInt},#{paraLong},#{valueInt},#{valueLong},#{valueStr},#{startTime},#{created},#{status},#{description},#{memo})
</insert>
<update id="updateParameter" parameterType="Parameter">
UPDATE Parameter
SET paraType=#{paraType},paraInt=#{paraInt},paraLong=#{paraLong},valueInt=#{valueInt},valueLong=#{valueLong},valueStr=#{valueStr},startTime=#{startTime},created=#{created},status=#{status},description=#{description},memo=#{memo}
WHERE paraId=#{paraId}
</update>
<select id="getParameter" parameterType="java.lang.Integer" resultType="Parameter">
SELECT paraId,paraType,paraInt,paraLong,valueInt,valueLong,valueStr,startTime,created,status,description,memo
FROM Parameter
WHERE paraId=#{paraId}
</select>
<select id="getSeqParameter" resultType="java.lang.Integer" useCache="false" flushCache="true">
SELECT nextval('seq_parameterid') ;
</select>
<select id="getParameterByParaIntAndParaType" parameterType="java.util.Map" resultType="Parameter">
SELECT paraId,paraType,paraInt,paraLong,valueInt,valueLong,valueStr,startTime,created,status,description,memo
FROM Parameter
<where>
<if test="paraType != null">
paraType = #{paraType}
</if>
<if test="paraInt != null ">
and paraInt = #{paraInt}
</if>
and status =1
</where>
order by startTime desc,created desc,paraId desc
</select>
<select id="getDubSearchTagsByParaTypeAndParaInt" parameterType="java.util.Map" resultType="DubSearchTag">
select paraId as type,valueStr as title,valueint as gradeAffiliation,valueLong as orderId,memo as themeGradeAffiliation from parameter where paraType = #{paraType} and paraInt = #{paraInt} order by paraid
</select>
<select id="getParameterByParaIntAndParaTypeForPrice" parameterType="java.util.Map" resultType="Parameter">
SELECT paraId,paraType,paraInt,paraLong,valueInt,valueLong,valueStr,startTime,created,status,description,memo
FROM Parameter
<where>
<if test="paraType != null">
paraType = #{paraType}
</if>
<if test="paraInt != null ">
and paraInt = #{paraInt}
</if>
<if test="paraLong != null">
and paraLong = #{paraLong}
</if>
and status =1 and startTime &lt;= now()
</where>
order by startTime desc,created desc,paraId desc
</select>
<select id="getParameterByParaTypeAndVlueInt" parameterType="java.util.Map" resultType="Parameter">
SELECT paraId,paraType,paraInt,paraLong,valueInt,valueLong,valueStr,startTime,created,status,description,memo
FROM Parameter
<where>
<if test="paraType != null">
paraType = #{paraType}
</if>
<if test="valueInt != null ">
and valueInt = #{valueInt}
</if>
and status =1
</where>
order by created desc,startTime desc,paraId desc
</select>
<select id="getParametersByParaInt" parameterType="java.util.Map" resultType="Parameter">
SELECT paraId,paraType,paraInt,paraLong,valueInt,valueLong,startTime,created,status,description,memo,valueStr
FROM Parameter where status=1
<if test="paraType != null"> and
paraType = #{paraType}
</if>
<if test="paraInt != null"> and
paraInt = #{paraInt}
</if>
order by created desc ,startTime desc ,paraId desc
<if test="pageSize!=null">
limit #{pageSize}
</if>
<if test="offset!=null">
offset #{offset}
</if>
</select>
<select id="getParametersByParaIntCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(paraId)
FROM Parameter where status=1
<if test="paraType != null"> and
paraType = #{paraType}
</if>
<if test="paraInt != null"> and
paraInt = #{paraInt}
</if>
</select>
<select id="getParametersByParaLong" parameterType="java.util.Map" resultType="Parameter">
SELECT paraId,paraType,paraLong,valueInt,valueLong,startTime,created,status,description,memo,valueStr
FROM Parameter where status=1
<if test="paraType != null"> and
paraType = #{paraType}
</if>
<if test="paraLong != null"> and
paraLong = #{paraLong}
</if>
order by startTime desc ,created desc
<if test="pageSize!=null">
limit #{pageSize}
</if>
<if test="offset!=null">
offset #{offset}
</if>
</select>
<select id="getParametersByParaLongCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(paraId)
FROM Parameter where status=1
<if test="paraType != null"> and
paraType = #{paraType}
</if>
<if test="paraLong != null"> and
paraLong = #{paraLong}
</if>
<if test="valueInt != null"> and
valueInt = #{valueInt}
</if>
</select>
<select id="getExamPaperDetails" parameterType="java.util.Map" resultType="java.util.Map">
select
p.paraint examPaperId,e.title,e.examLevel,p.valueint partType,p.valuelong difficult,p.valuestr guid,p.status,p.description tags,p.memo questiontitle
FROM Parameter p
inner join exampaper e
on p.paraint=e.exampaperid
<if test="examLevel != null">
and e.examLevel = #{examLevel}
</if>
<if test="title != null">
and e.title like '%${title}%'
</if>
where p.status=1 and p.paratype=3
<if test="partType != null">
and p.valueint = #{partType}
</if>
<if test="difficult != null">
and p.valuelong = #{difficult}
</if>
<if test="questionTitle != null">
and p.memo like '%${questionTitle}%'
</if>
<if test="tags != null">
<foreach collection="tags" item="item" separator=" " >
${connector} p.description like '%${item}%'
</foreach>
</if>
order by p.paraid desc
<if test="pageSize!=null">
limit #{pageSize}
</if>
<if test="offset!=null">
offset #{offset}
</if>
</select>
<select id="getExamPaperDetailsCount" parameterType="java.util.Map" resultType="java.lang.Integer">
select count(*)
FROM Parameter p
inner join exampaper e
on p.paraint=e.exampaperid
<if test="examLevel != null">
and e.examLevel = #{examLevel}
</if>
<if test="title != null">
and e.title like '%${title}%'
</if>
where p.status=1 and p.paratype=3
<if test="partType != null">
and p.valueint = #{partType}
</if>
<if test="difficult != null">
and p.valuelong = #{difficult}
</if>
<if test="questionTitle != null">
and p.memo like '%${questionTitle}%'
</if>
<if test="tags != null">
<foreach collection="tags" item="item" separator=" " >
${connector} p.description like '%${item}%'
</foreach>
</if>
</select>
<select id="getTags" parameterType="java.util.Map" resultType="java.util.Map" >
select paraId as "tagId",valuestr as "tagTitle",paraint as "tagType",description as "tagValue"
from parameter where paratype=5 and status=1 and paraint &gt;0 order by paraId desc
<if test="pageSize!=null">
limit #{pageSize}
</if>
<if test="offset!=null">
offset #{offset}
</if>
</select>
<select id="getTagsCount" resultType="java.lang.Integer">
select count(paraId)
from parameter where paratype=5 and status=1 and paraint &gt;0
</select>
<select id="getTag" resultType="java.util.Map" parameterType="java.lang.Integer">
select paraId as "tagId",valuestr as "tagTitle",paraint as "tagType",description as "tagValue"
from parameter where paratype=5 and status=1 and paraId=#{tagId}
</select>
<select id="getOtherSystemOwnSchools" resultType="java.util.Map" parameterType="java.util.Map">
select paraId,paraLong,s.areaId,schoolname,a.areaName county,b.areaname provincialCity,
c.areaname province from parameter p
inner join school s
on p.paralong=s.schoolId and paraType=#{paraType} and p.status=1 and s.status=1 and valueint= #{valueInt}
inner join area a
on a.areaId = s.areaId
inner join area b
on b.areaId = a.parentId
inner join area c
on c.areaId = b.parentId
order by paraid desc
<if test="pageSize!=null">
limit #{pageSize}
</if>
<if test="offset!=null">
offset #{offset}
</if>
</select>
<delete id="deleleParameterByParaIds" parameterType="java.util.List">
delete from parameter where paraId in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<select id="getTemporaryRespackage" resultType="Parameter" parameterType="java.util.Map">
SELECT paraId,paraType,paraInt,paraLong,valueInt,valueLong,valueStr,startTime,created,status,description,memo
FROM Parameter
WHERE paraInt=#{lessonId} and valueStr=#{courseType} and paraType=11 and status=1
order by created desc limit 1
</select>
<select id="getTemporaryRespackages" resultType="Parameter" parameterType="java.util.Map">
SELECT paraId,paraType,paraInt,paraLong,valueInt,valueLong,valueStr,startTime,created,status,description,memo
FROM Parameter
WHERE paraType=11 and status=1
order by created desc
</select>
<select id="getStorageBag" resultType="Parameter" parameterType="java.util.Map">
SELECT paraId,paraType,paraInt,paraLong,valueInt,valueLong,valueStr,startTime,created,status,description,memo
FROM Parameter
WHERE paraType=13 and paralong=#{teacherId} and valueInt=#{isOral}
order by created desc limit 1
</select>
<select id="getParameterByRecognizeCode" resultType="Parameter" parameterType="java.util.Map">
select paraId,paraType,paraInt,paraLong,valueInt,valueLong,valueStr,created,startTime,status,description,memo
from Parameter where valueStr = #{recognizecode} and paraInt=#{raceId} limit 1
</select>
<select id="getParametersByParaLongs" parameterType="java.util.Map" resultType="Parameter">
SELECT paraId,paraType,paraLong,valueInt,startTime,created,status,description,memo,valueStr
FROM Parameter where status=1
<if test="paraType != null"> and
paraType = #{paraType}
</if>
<if test="paraLongs != null"> and
paraLong in
<foreach item="item" collection="paraLongs" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
<select id="getParameterByValuestrAndParaintAndStatus" parameterType="java.util.Map" resultType="Parameter">
select paraId,paraInt,paraType,paraLong,valueInt,valueLong,startTime,created,status,description,memo,valueStr
FROM Parameter
<where>
<if test="valueStr != null">
and valueStr = #{valueStr}
</if>
<if test="paraInt != null">
and paraInt = #{paraInt}
</if>
<if test="status != null">
and status = #{status}
</if>
and paraType= 20
</where>
</select>
<select id="getParameterByValueLongAndParaintAndStatus" parameterType="java.util.Map" resultType="java.util.Map">
select studentId , truename , nickname , areaId ,to_char(starttime, 'yyyy-mm-dd HH24:MI:SS') as starttime,
recognizeCode , cellphone , telephone , email
FROM Parameter as a inner join student on a.paraLong = studentId
<where>
<if test="valueLong != null">
and a.valueLong = #{valueLong}
</if>
<if test="paraInt != null">
and a.paraInt = #{paraInt}
</if>
<if test="status != null">
and a.status = #{status}
</if>
and paraType= 20 order by a.starttime desc
</where>
</select>
<select id="getClassmatesInfoForPass" parameterType="java.util.HashMap" resultType="java.util.HashMap">
select DISTINCT s.studentId "studentId",st.avatar, st.truename ,st.nickname ,signature,userlevel "userLevel",
levelname "levelName",goldmedalcount "goldMedalCount"
from
studentownclass s
inner join
student st on s.status=0
and st.studentid=s.studentId and st.status=0 and st.areaId = #{areaId} and s.areaid=#{areaId}
inner join userhonor u on u.uid=s.studentid and u.areaid=#{areaId}
where st.studentid in
<foreach collection="studentIds" item="item" separator="," close=")" open="(">
#{item}
</foreach>
order by goldmedalcount desc nulls last,s.studentid
</select>
<select id="getAllLogoutStudentByClassesId" parameterType="java.util.Map" resultType="java.lang.Long">
select s.studentid as studentId from parameter as a
inner join student as s on a.paraLong = s.studentId and s.status = 1
inner join studentownclass as soc on soc.studentId = s.studentId
where a.paraInt = 1 and a.status = 1 and a.paraType = 16 and valuelong = #{teacherId} and soc.classesId = #{classesId} order By a.created desc
</select>
<select id="getAllSuccessLogoutStudentByClassesId" parameterType="java.util.Map" resultType="java.lang.Long">
select s.studentid as studentId from parameter as a
inner join student as s on a.paraLong = s.studentId and s.status = 0
inner join studentownclass as soc on soc.studentId = s.studentId
where a.paraInt = 3 and a.status = 0 and a.paraType = 16 and valuelong = #{teacherId} and soc.classesId = #{classesId} group by s.studentid
</select>
<select id="getParameterByKeys" parameterType="java.util.Map" resultType="Parameter">
select paraId,paraInt,paraType,paraLong,valueInt,valueLong,startTime,created,status,description,memo,valueStr
FROM Parameter
<where>
<if test="valueLong != null">
and valueLong = #{valueLong}
</if>
<if test="paraInt != null">
and paraInt = #{paraInt}
</if>
<if test="status != null">
and status = #{status}
</if>
<if test="paraType != null">
and paraType = #{paraType}
</if>
<if test="paraLong != null">
and paraLong = #{paraLong}
</if>
<if test="valueInt != null">
and valueInt = #{valueInt}
</if>
</where>
</select>
<select id="getParameterByKeysForGoodsVersion" parameterType="java.util.Map" resultType="Parameter">
select a.paraId,a.paraInt,a.paraType,a.paraLong,a.valueInt,a.valueLong,a.startTime,a.created,a.status,a.description,a.memo,a.valueStr
FROM Parameter as a inner join goods g on a.valueInt = g.goodsid
<where>
<if test="valueLong != null">
and a.valueLong = #{valueLong}
</if>
<if test="paraInt != null">
and a.paraInt = #{paraInt}
</if>
<if test="status != null">
and a.status = #{status}
</if>
<if test="paraType != null">
and a.paraType = #{paraType}
</if>
<if test="paraLong != null">
and a.paraLong = #{paraLong}
</if>
<if test="valueInt != null">
and a.valueInt = #{valueInt}
</if>
</where>
order by g.goodslevel ,g.goodsid
</select>
<select id="getParameterByKeyForTags" parameterType="java.util.Map" resultType="Parameter">
select paraId,paraInt,paraType,paraLong,valueInt,valueLong,startTime,created,status,description,memo,valueStr
FROM Parameter
<where>
<if test="paraInt != null">
and paraInt = #{paraInt}
</if>
<if test="status != null">
and status = #{status}
</if>
<if test="paraType != null">
and paraType = #{paraType}
</if>
<if test="examLevel != null">
and to_number(trim((memo::json->>'examlevel') :: text),'999999') = #{examLevel}
</if>
</where>
</select>
<select id="getTeacherPaperTags" parameterType="java.util.Map" resultType="Parameter">
select c.paraId,c.paraInt,c.paraType,c.paraLong,c.valueInt,c.valueLong,c.startTime,c.created,c.status,c.description,c.memo,c.valueStr from parameter as c
<where>
<if test="paraInt != null">
and paraInt = #{paraInt}
</if>
<if test="status != null">
and status = #{status}
</if>
<if test="paraType != null">
and paraType = #{paraType}
</if>
</where>
-- where c.status = 1 and c.paraint = -1 and c.paraType = 5
and to_number(trim((c.memo::json->>'examlevel') :: text),'999999') in
(select b.classlevel from teacher as a inner join classes as b on a.teacherid = b.teacherid
where a.teacherId = #{teacherId})
group by c.paraId ,c.valuestr
order by position(SUBSTRING(c.valuestr, 1, 1) in '大高初九八七六五四三二一') desc,
position(SUBSTRING(c.valuestr, 2, 1) in '大高初九八七六五四三二一') desc,c.valuestr
</select>
<select id="getParentAreaForAreaTag" parameterType="java.util.Map" resultType="AreaDto">
with temp as (select b.parentid from parameter as a
inner join area as b on a.valueint=b.areaid
<where>
<if test="paraInt != null">
and a.paraInt = #{paraInt}
</if>
<if test="status != null">
and a.status = #{status}
</if>
<if test="paraType != null">
and a.paraType = #{paraType}
</if>
<if test="valueInt != null">
and a.valueInt = #{valueInt}
</if>
</where>
GROUP BY b.parentid)
select a.* from area as a inner join temp as b on a.areaid = b.parentid
</select>
<select id="getParameterForAreaTag" parameterType="java.lang.Integer" resultType="Parameter">
select DISTINCT a.* from parameter as a inner join area as b on a.valueint=b.areaid where paraint = -2 and paratype = 5 and status =1 and b.parentid = #{parentid}
</select>
<select id="getProvinceList" parameterType="java.util.Map" resultType="Parameter">
select * from parameter where paratype = #{paraType} and SUBSTRING(cast(paraint as VARCHAR), 3, 4) = '0000'
</select>
<select id="getCityList" parameterType="java.util.Map" resultType="Parameter">
select * from parameter where paratype = #{paraType} and SUBSTRING(cast(paraint as VARCHAR), 1, 2) = #{startString} and SUBSTRING(cast (paraint as VARCHAR), 3, 5) != '0000'
</select>
<select id="getDefaultClassLevelName" parameterType="java.lang.Long" resultType="java.util.HashMap">
select valueStr as valueStr,paraId as paraId from parameter where paratype =5 and paraint =-1
and to_number(trim((memo::json->>'examlevel') :: text),'999999')
in(select classlevel from classes c where teacherid = #{studentid} and classtype =1 and status =1 GROUP BY classlevel) ORDER BY paraid
</select>
<select id="getDefaultGoodsidName" parameterType="java.lang.Long" resultType="java.util.HashMap">
SELECT u.goodsId as valueInt,p.valueStr as valueStr FROM userownlesson u INNER JOIN parameter p on u.goodsid = p.valueint
WHERE u.uid = #{studentid} and u.status = 1 and p.paratype =5 and p.paraint =-3 and p.status =1
</select>
<select id="getDefaultCityAreaidName" parameterType="java.lang.String" resultType="java.util.HashMap">
select paraint as areaId,valuestr as valueStr from parameter where paratype =24
and SUBSTRING(cast(paraint as VARCHAR), 1, 4) = #{key}
</select>
</mapper>