TaShareActivityMapper.xml 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.huiju.estateagents.mapper.TaShareActivityMapper">
  4. <select id="selectTaShareActivityById" resultType="com.huiju.estateagents.entity.TaShareActivity">
  5. select
  6. t.group_activity_id,
  7. t.building_id,
  8. t.activity_name,
  9. t.main_img,
  10. t.group_buy_people,
  11. t.integral,
  12. t.share_id,
  13. t.poster_id,
  14. t.status
  15. from ta_share_activity t where t.group_activity_id = #{activityId}
  16. </select>
  17. <update id="updateActivityToUnStart">
  18. update ta_share_activity
  19. set activity_status = 1
  20. where
  21. NOW() &lt; start_time and activity_status != 2
  22. </update>
  23. <update id="updateUnStartGroupActivity">
  24. update ta_share_activity t
  25. set activity_status = 0
  26. where
  27. t.activity_status != '2' and NOW() BETWEEN t.start_time and t.end_time
  28. </update>
  29. <update id="updateProcessGroupActivity">
  30. update ta_share_activity
  31. set activity_status = 2
  32. where
  33. NOW() > end_time and activity_status != 2
  34. </update>
  35. <select id="calParticipateNum" resultType="java.lang.Integer">
  36. select t.join_people as num from ta_share_record t where t.group_activity_id = #{groupActivityId} group by t.group_activity_id
  37. </select>
  38. </mapper>