动态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-05-13TiDB + ES:转转业财系统亿级数据存储优化实践
- 2024-05-09“2024鸿蒙零基础快速实战-仿抖音App开发(ArkTS版)”实战课程已上线
- 2024-05-09聊聊如何通过arthas-tunnel-server来远程管理所有需要arthas监控的应用
- 2024-05-09log4j2这么配就对了
- 2024-05-09nginx修改Content-Type
- 2024-05-09Redis多数据源,看这篇就够了
- 2024-05-09Google Chrome驱动程序 124.0.6367.62(正式版本)去哪下载?
- 2024-05-09有没有大佬知道这种数据应该怎么抓取呀?
- 2024-05-09这种运行结果里的10.100000001,怎么能最快改成10.1?
- 2024-05-09企业src漏洞挖掘-有意思的命令执行