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
Preface This article lists several common, practi...
Table of contents 1. Introduction to podman 2. Ad...
Preface Starting from React 16, the concept of Er...
Table of contents 1. Overview 2. Django Project 3...
Table of contents Installing the SDK Managing loc...
Chinese Tutorial https://www.ncnynl.com/category/...
Dark background style page design is very popular...
Tomcat7.0 sets virtual directory (1) Currently, o...
Vulnerability Details VSFTP is a set of FTP serve...
Writing a Dockerfile Configure yum source cd /tmp...
Rich text editors are often used when doing backg...
Table of contents Early creation method Factory P...
Page replacement algorithm: The essence is to mak...
In daily work, we sometimes run slow queries to r...
This article uses an example to describe how to i...