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
Table of contents Preface Scope 1. What is scope?...
<br />Recently, UCDChina wrote a series of a...
Table of contents Solution 1: Rebuild Replicas Pr...
Preface: When using MySQL, you may encounter time...
Table of contents 1. Virtual Host 1.1 Virtual Hos...
Effect picture (if you want a triangle, please cl...
Table of contents 1. Offline installation 2. Onli...
MySql is a data source we use frequently. It is v...
1. Commonly used high-order functions of arrays S...
The following information is compiled from the Int...
Table of contents 1. Introduction 2. Usage 3. Dev...
Overview of Alibaba Cloud Security Group Sharing ...
Classification of color properties Any color can ...
Node.js solves the problem of Chinese garbled cha...
This article records the installation and configu...