You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.3 KiB

  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.example.demo.mapper.cash.MessageMapper">
  4. <update id="update">
  5. update message
  6. set flag=1
  7. where id=#{id}
  8. </update>
  9. <select id="getMessage" resultType="com.example.demo.domain.vo.coin.Messages">
  10. SELECT id, jwcode, name, title, `desc`, status, market,type, type_id,flag,cz_time
  11. FROM message
  12. <where>
  13. flag=0
  14. <choose>
  15. <when test="status != null and status.size() > 0">
  16. and status IN
  17. <foreach item="item" collection="status" open="(" separator="," close=")">
  18. #{item}
  19. </foreach>
  20. </when>
  21. </choose>
  22. <choose>
  23. <when test="markets != null and markets.size() > 0">
  24. and market IN
  25. <foreach item="item" collection="markets" open="(" separator="," close=")">
  26. #{item}
  27. </foreach>
  28. </when>
  29. </choose>
  30. ORDER BY cz_time DESC
  31. </where>
  32. </select>
  33. </mapper>