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.

33 lines
1.3 KiB

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.cash.MessageMapper">
<update id="update">
update message
set flag=1
where id=#{id}
</update>
<select id="getMessage" resultType="com.example.demo.domain.vo.coin.Messages">
SELECT id, jwcode, name, title, `desc`, status, market,type, type_id,flag,cz_time
FROM message
<where>
flag=0
<choose>
<when test="status != null and status.size() > 0">
and status IN
<foreach item="item" collection="status" open="(" separator="," close=")">
#{item}
</foreach>
</when>
</choose>
<choose>
<when test="markets != null and markets.size() > 0">
and market IN
<foreach item="item" collection="markets" open="(" separator="," close=")">
#{item}
</foreach>
</when>
</choose>
ORDER BY cz_time DESC
</where>
</select>
</mapper>