3eapi/bin/target/classes/mapper/UserOwnLessonMapper.xml
2026-03-10 16:40:19 +08:00

50 lines
1.7 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
<mapper namespace="com._3e.newdao.UserOwnLessonDao">
<!-- 支付完成后修改UserOwnLesson的到期时间 -->
<!-- 这里使用map:key分别是"years"="\'1 years\'"、"uid"=121313212 -->
<!-- 此id用于未到期用户 -->
<update id="doUpdateBetween" parameterType="map">
UPDATE userownlesson
SET endtime = #{endtime}
WHERE uid = #{uid} AND goodsid in (SELECT g.goodsid FROM goods g
WHERE (g.isrecomm > 0 AND g.price = 0)
OR g.isrecomm = 0)
</update>
<!-- 此id用于到期用户 -->
<update id="doUpdateAfter" parameterType="map">
UPDATE userownlesson
SET starttime = #{starttime} ,endtime = #{endtime},status=1
WHERE uid = #{uid} AND goodsid in (SELECT g.goodsid FROM goods g
WHERE (g.isrecomm > 0 AND g.price = 0)
OR g.isrecomm = 0)
</update>
<select id = "findMyEndTime" parameterType="long"
resultType="com._3e.entity.UserOwnLesson">
SELECT uid ,max(endtime) as endtime
FROM userownlesson
WHERE uid = #{uid} AND goodsid in (SELECT g.goodsid FROM goods g
WHERE (g.isrecomm > 0 AND g.price = 0)
OR g.isrecomm = 0)
GROUP BY uid
</select>
<!-- <select id = "testFind" parameterType="map" -->
<!-- resultType="com._3e.entity.Achivement"> -->
<!-- SELECT * -->
<!-- FROM achivement -->
<!-- WHERE uid = #{uid} and score > #{score} -->
<!-- </select> -->
<!-- <update id="update" parameterType="map"> -->
<!-- UPDATE achivement -->
<!-- SET score = score + #{score} -->
<!-- WHERE achivementid = #{id} AND uid = #{uid} -->
<!-- </update> -->
</mapper>