Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the experience of using mybatis?

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you about the experience of using mybatis, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

@ Param uses @ Param ("model") specified in the Java code, and List queryByPage (@ Param ("model") ProductQueryReq queryModel) is also required in the mapper.xml configuration; select from product_info where is_deleted='N' and status = # {model.productStatus,jdbcType=INTEGER}

If it is not written in mapper.xml, an error message will be started:

BoundSql.getParameterObject ():

There is only one parameter that can not specify @ Param, and the object property List queryByPage (ProductQueryReq queryModel) can be used directly in mapper.xml.

If mapper.xml uses an alias to report an error:

Multiple parameters of the same type also need to be defined @ Param UserImageTransfer selectFirstHistoryOrcInfo (String productCode, String userId)

The usage of collection

Under collection, both the primary table and the schedule need to find the primary key; even if the label has written other fields, it must be the real primary key of the database table.

Select p.id, p.batch_no, p.serial_no, p.product_code, p.package_no, p.amount, p.origin_info, p.trade_status, p.return_info, d.id d_id, d.product_code d_product_code D.package_no d_package_no, d.batch_no d_batch_no, d.serial_no d_serial_no, d.amount d_amount, d.contract_no d_contract_no, d.policy_no d_policy_no, d.trade_no d_trade_no, d.report_amount d_report_amount D.trade_status d_trade_status, d.resp_code d_resp_code, d.resp_msg d_resp_msg, d.report_no d_report_no, d.claim_no d_claim_no, d.agreed_repay_date d_agreed_repay_date, d.gmt_created d_gmt_created D.return_info d_return_info from cmb_creditcard_claim_package p inner join cmb_creditcard_claim_detail d on p.batch_no = d.batch_no where p.gmt_created > = # {beginDate,jdbcType=TIMESTAMP} and and above is the experience of using mybatis The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report