<?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="org.jeecg.modules.oroqen.mapper.OroqenOrderMapper">

    <!-- 根据用户ID查询订单 -->
    <select id="selectByUserId" resultType="org.jeecg.modules.oroqen.entity.OroqenOrder">
        SELECT * FROM oroqen_order 
        WHERE user_id = #{userId} 
        AND del_flag = 0
        ORDER BY create_time DESC
    </select>

    <!-- 根据订单状态查询订单 -->
    <select id="selectByStatus" resultType="org.jeecg.modules.oroqen.entity.OroqenOrder">
        SELECT * FROM oroqen_order 
        WHERE status = #{status}
        AND del_flag = 0
        ORDER BY create_time DESC
    </select>

</mapper>