The query data in the xml price inquiry contains a list, so a collection is required <resultMap id="XX" type="com.XXX.XXXX"> <id column="o_id" jdbcType="BIGINT" property="id" /> <result column="o_user_id" jdbcType="BIGINT" property="userId" /> .... <collection property="orderProductList" ofType="com.XXXXXX.XXXXX"> <id column="p_id" jdbcType="BIGINT" property="id" /> <result column="p_order_id" jdbcType="BIGINT" property="orderId" /> .... </collection> </resultMap> The general paging query encapsulated by such a query system is incorrect, so you need to add paging to your own SQL to solve it. <select id="XXX" resultMap="OrderListMap"> SELECT you.nick_name, yo.id o_id, yo.user_id o_user_id FROM ( SELECT * FROM youpin_order WHERE 1 = 1 <if test="status != null"> and `status` = #{status} </if> <if test="page != null and limit != null"> LIMIT #{page}, #{limit} </if> ) LEFT JOIN XXX yop ON yo.id = yop.order_id LEFT JOIN XXXX you ON yo.user_id = you.id </select> When passing in parameters, calculation is required Summarize The above is the solution to the MySQL one-to-many association query paging error problem introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: How to use geoip to restrict regions in nginx
>>: Implementation of communication between Vue and Flask
1. Background 1.1 Problems A recent product testi...
A system administrator may manage multiple server...
1. Background Although I have read many blogs or ...
Table of contents 1. js statement Second, js arra...
Docker supports running on the following CentOS v...
Brief description Suitable for readers: Mobile de...
This article example shares the specific implemen...
This article describes how to compile and install...
This reading note mainly records the operations r...
1. Download the ElasticSearch 6.4.1 installation ...
Code Explanation 1.1 http:www.baidu.test.com defa...
Table of contents Environment Preparation start 1...
Speaking of Nestjs exception filter, we have to m...
Lists for organizing data After learning so many ...
I made a Dockerfile for openresty on centos7 and ...