You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
<?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= "com.msdw.tms.dao.ClassTeachingDao" >
<select id= "queryInvitationCode" resultType= "com.msdw.tms.entity.ExperimentalTeachingEntity" >
select invitation_code from tms_experimental_teaching where project_id = #{projectId} and is_code = #{isCode}
</select>
<select id= "getByClassRecord" resultType= "com.msdw.tms.entity.ExperimentalTeachingEntity" >
SELECT
id,
experimental_class_name,
surplus_time,
experiment_duration,
experimental_name,
experimental_number,
start_time,
stop_time,
`status`
FROM
tms_experimental_teaching
WHERE
is_del=0
<if test= "cla.status!=null" > and `status` = #{cla.status}</if>
<if test= "cla.condition!=null" > and ( project_name like concat('%',#{cla.condition},'%') or experimental_class_name like concat('%',#{cla.condition},'%') )</if>
<if test= "cla.startTime!=null and cla.endTime!=null" > and stop_time between #{cla.endTime} and #{cla.startTime}</if>
<if test= "cla.month!=null" > and DATE_SUB(CURDATE(), INTERVAL #{cla.month} month ) < = date(stop_time)</if>
</select>
<update id= "updateSurplusTime" parameterType= "com.msdw.tms.entity.ExperimentalTeachingEntity" >
UPDATE tms_experimental_teaching
SET surplus_time = TIMEDIFF( stop_time, NOW( ) )
WHERE
now( ) >= start_time
AND stop_time >= now( )
AND is_del=0
</update>
<update id= "updateSurplusTimeNull" parameterType= "com.msdw.tms.entity.ExperimentalTeachingEntity" >
UPDATE tms_experimental_teaching
SET surplus_time = 0
WHERE
now( ) >= stop_time
AND is_del=0
</update>
<select id= "querySimulationPlayList" resultType= "com.msdw.tms.entity.BroadcastEntity" >
SELECT id,title,links,isdel FROM tms_broadcast
</select>
</mapper>