<?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.luojia_channel.modules.post.mapper.PostMapper">
    <select id="selectByIdsOrderByField" resultType="com.luojia_channel.modules.post.entity.Post">
        SELECT * FROM post
        WHERE id IN
        <foreach item="id" collection="ids" open="(" separator="," close=")">#{id}</foreach>
        ORDER BY FIELD(id,
        <foreach item="id" collection="ids" separator="," open="" close="">#{id}</foreach>)
    </select>
</mapper>