50 lines
1.7 KiB
XML
50 lines
1.7 KiB
XML
|
|
<?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>
|