|
|
|
@ -7,27 +7,36 @@ |
|
|
|
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 |
|
|
|
SELECT |
|
|
|
m.id, |
|
|
|
m.jwcode, |
|
|
|
m.name, <!-- ✅ message.name --> |
|
|
|
m.title, |
|
|
|
m.`desc`, |
|
|
|
m.status, |
|
|
|
m.market, |
|
|
|
m.type, |
|
|
|
m.type_id, |
|
|
|
m.flag, |
|
|
|
m.cz_time, |
|
|
|
mk.name AS market_name <!-- ✅ market.name --> |
|
|
|
FROM message m |
|
|
|
LEFT JOIN market mk ON m.market = mk.id |
|
|
|
<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 |
|
|
|
m.flag = 0 |
|
|
|
<if test="status != null and status.size() > 0"> |
|
|
|
AND m.status IN |
|
|
|
<foreach item="item" collection="status" open="(" separator="," close=")"> |
|
|
|
#{item} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="markets != null and markets.size() > 0"> |
|
|
|
AND m.market IN |
|
|
|
<foreach item="item" collection="markets" open="(" separator="," close=")"> |
|
|
|
#{item} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
ORDER BY m.cz_time DESC |
|
|
|
</select> |
|
|
|
</mapper> |