动态sql_实际应用
2022/8/24 2:24:56
本文主要是介绍动态sql_实际应用,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.qfedu.fmmall.dao.OrdersMapper"> <resultMap id="BaseResultMap" type="com.qfedu.fmmall.entity.Orders"> <id column="order_id" jdbcType="VARCHAR" property="orderId"/> <result column="user_id" jdbcType="VARCHAR" property="userId"/> <result column="untitled" jdbcType="VARCHAR" property="untitled"/> <result column="receiver_name" jdbcType="VARCHAR" property="receiverName"/> <result column="receiver_mobile" jdbcType="VARCHAR" property="receiverMobile"/> <result column="receiver_address" jdbcType="VARCHAR" property="receiverAddress"/> <result column="total_amount" jdbcType="DECIMAL" property="totalAmount"/> <result column="actual_amount" jdbcType="INTEGER" property="actualAmount"/> <result column="pay_type" jdbcType="INTEGER" property="payType"/> <result column="order_remark" jdbcType="VARCHAR" property="orderRemark"/> <result column="status" jdbcType="VARCHAR" property="status"/> <result column="delivery_type" jdbcType="VARCHAR" property="deliveryType"/> <result column="delivery_flow_id" jdbcType="VARCHAR" property="deliveryFlowId"/> <result column="order_freight" jdbcType="DECIMAL" property="orderFreight"/> <result column="delete_status" jdbcType="INTEGER" property="deleteStatus"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> <result column="pay_time" jdbcType="TIMESTAMP" property="payTime"/> <result column="delivery_time" jdbcType="TIMESTAMP" property="deliveryTime"/> <result column="flish_time" jdbcType="TIMESTAMP" property="flishTime"/> <result column="cancel_time" jdbcType="TIMESTAMP" property="cancelTime"/> <result column="close_type" jdbcType="INTEGER" property="closeType"/> </resultMap> <select id="selectOrders"> select o.order_id, user_id, untitled, receiver_name, receiver_mobile, receiver_address, o.total_amount, actual_amount, pay_type, order_remark, status, delivery_type, delivery_flow_id, order_freight, delete_status, create_time, pay_time, delivery_time flish_time, cancel_time, close_type, item_id, i.order_id item_order_id, product_id, product_name, product_img, sku_id, sku_name, product_price, buy_counts, i.total_amount item_total_amount, basket_date, buy_time, is_comment from orders o inner join order_item i on o.order_id = i.order_id where o.user_id = #{userId} <if test="status != null"> and o.status=#{status} </if> and o.status = #{status} limit #{start}, #{limit} </select> </mapper>
这篇关于动态sql_实际应用的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-15JavaMailSender是什么,怎么使用?-icode9专业技术文章分享
- 2024-11-15JWT 用户校验学习:从入门到实践
- 2024-11-15Nest学习:新手入门全面指南
- 2024-11-15RestfulAPI学习:新手入门指南
- 2024-11-15Server Component学习:入门教程与实践指南
- 2024-11-15动态路由入门:新手必读指南
- 2024-11-15JWT 用户校验入门:轻松掌握JWT认证基础
- 2024-11-15Nest后端开发入门指南
- 2024-11-15Nest后端开发入门教程
- 2024-11-15RestfulAPI入门:新手快速上手指南