zcloud_gbs_edu/web-infrastructure/src/main/resources/mapper/TrainingUserMapper.xml

43 lines
1.2 KiB
XML
Raw Normal View History

2026-01-22 08:25:32 +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="com.zcloud.edu.persistence.mapper.TrainingUserMapper">
<update id="updateTime">
update training_user
<set>
start_time = #{params.startTime},
end_time = #{params.endTime}
</set>
<where>
phone = #{params.phone}
and ( end_time is null or end_time &lt; #{params.endTime})
</where>
</update>
2026-03-17 17:40:52 +08:00
<select id="listAllByPhones" resultType="com.zcloud.edu.persistence.dataobject.TrainingUserDO">
select
phone,
start_time,
end_time,
case when start_time &lt; now() and end_time > now() then 1 else 0 end stateFlag
from
training_user
<where>
delete_enum = 'false'
<if test="params.phones != null">
and phone in
<foreach item="phone" collection="params.phones" open="(" separator="," close=")">
#{phone}
</foreach>
</if>
</where>
</select>
2026-01-22 08:25:32 +08:00
</mapper>