GroupRelationMapper.xml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  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.cyksj.mapper.GroupsRelationMapper">
  4. <update id="updateExpiryTime">
  5. update groups_relation
  6. set start_time = null,
  7. expiry_time = null,
  8. status = #{entity.status},
  9. renew_status = #{entity.renewStatus},
  10. is_handle = #{entity.isHandle},
  11. user_id = #{entity.userId},
  12. account = #{entity.account}
  13. where id = #{entity.id} and expiry_time = #{expireTime}
  14. </update>
  15. <select id="getAccountIdsByUserIdOrNickNameOrSubmitAccount" resultType="java.lang.Long">
  16. select gr.groups_id
  17. from groups_relation gr,
  18. `user` u
  19. where gr.user_id = u.id
  20. <if test="nickName != null and nickName != ''">
  21. and u.nickname like '%${nickName}%'
  22. </if>
  23. <if test="userId != null">
  24. and u.id = #{userId,jdbcType=BIGINT}
  25. </if>
  26. <if test="submitAccount != null and submitAccount != ''">
  27. and gr.account = #{submitAccount,jdbcType=VARCHAR}
  28. </if>
  29. group by gr.groups_id
  30. </select>
  31. <select id="getGroupTripsSkuIdByRelationId" resultType="java.lang.Long">
  32. select gt.sku_id from `groups_trips` gt left join `groups_relation` gr on gr.groups_id = gt.id where gr.id = #{relationId} limit 1
  33. </select>
  34. </mapper>