This commit is contained in:
2025-09-13 22:32:00 +08:00
parent 69af30cd37
commit 4e6526f74c
2 changed files with 15 additions and 4 deletions

View File

@@ -46,6 +46,17 @@ public class JDOrderListController extends BaseController
String orderBy = getRequest().getParameter("orderBy");
String isAsc = getRequest().getParameter("isAsc");
// 处理时间筛选参数
String beginTimeStr = getRequest().getParameter("beginTime");
String endTimeStr = getRequest().getParameter("endTime");
if (beginTimeStr != null && !beginTimeStr.isEmpty()) {
query.getParams().put("beginTime", beginTimeStr);
}
if (endTimeStr != null && !endTimeStr.isEmpty()) {
query.getParams().put("endTime", endTimeStr);
}
java.util.List<JDOrder> list;
if (orderBy != null && !orderBy.isEmpty()) {
// 设置排序参数

View File

@@ -42,10 +42,10 @@
<if test="orderTime != null"> and order_time = #{orderTime}</if>
<if test="status != null and status != ''"> and status like concat('%', #{status}, '%')</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and order_time &gt;= #{params.beginTime}
and date(order_time) &gt;= #{params.beginTime}
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and order_time &lt;= #{params.endTime}
and date(order_time) &lt;= #{params.endTime}
</if>
</where>
order by remark asc, order_time desc, id desc
@@ -67,10 +67,10 @@
<if test="orderTime != null"> and order_time = #{orderTime}</if>
<if test="status != null and status != ''"> and status like concat('%', #{status}, '%')</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and order_time &gt;= #{params.beginTime}
and date(order_time) &gt;= #{params.beginTime}
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and order_time &lt;= #{params.endTime}
and date(order_time) &lt;= #{params.endTime}
</if>
</where>
<choose>