dao层

List<MyHouseType> getListByType(@Param("newCurrentPage") int newCurrentPage,
                                    @Param("pageSize") int pageSize,
                                    @Param("type")String type,
                                    @Param("engineerId")int engineerId,
                                    @Param("cityIdList") List<Integer> cityIdList);

mapper

<select id="getListByType" resultMap="BaseResultMap">
        SELECT
            <include refid="Base_Column_List"></include>
        from
        z_my_house_type

        where
        type=#{type}  and engineerId=#{engineerId}
        and
        cityId in
        <foreach item="value" index="index" collection="cityIdList" open="(" separator="," close=")">
            #{value}
        </foreach>

        order by
        id
        desc
        LIMIT  #{newCurrentPage}  , #{pageSize}
    </select>

MyBaties list 传参

相关文章: