Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.jarvis.domain.OrderRows;
|
||||
@@ -39,9 +40,34 @@ public class JDOrderListController extends BaseController
|
||||
* 查询JD订单列表
|
||||
*/
|
||||
@org.springframework.web.bind.annotation.GetMapping("/list")
|
||||
public TableDataInfo list(JDOrder query) {
|
||||
public TableDataInfo list(JDOrder query, HttpServletRequest request) {
|
||||
startPage();
|
||||
java.util.List<JDOrder> list = jdOrderService.selectJDOrderList(query);
|
||||
|
||||
// 处理排序参数
|
||||
String orderBy = request.getParameter("orderBy");
|
||||
String isAsc = request.getParameter("isAsc");
|
||||
|
||||
// 处理时间筛选参数
|
||||
String beginTimeStr = request.getParameter("beginTime");
|
||||
String endTimeStr = request.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()) {
|
||||
// 设置排序参数
|
||||
query.getParams().put("orderBy", orderBy);
|
||||
query.getParams().put("isAsc", isAsc);
|
||||
list = jdOrderService.selectJDOrderListWithSort(query);
|
||||
} else {
|
||||
list = jdOrderService.selectJDOrderList(query);
|
||||
}
|
||||
|
||||
TableDataInfo dataTable = getDataTable(list);
|
||||
List<JDOrder> rows = (List<JDOrder>) dataTable.getRows();
|
||||
for (JDOrder jdOrder : rows) {
|
||||
|
||||
@@ -13,6 +13,11 @@ public interface JDOrderMapper {
|
||||
*/
|
||||
List<JDOrder> selectJDOrderList(JDOrder jdOrder);
|
||||
|
||||
/**
|
||||
* 查询京东订单列表(支持动态排序)
|
||||
*/
|
||||
List<JDOrder> selectJDOrderListWithSort(JDOrder jdOrder);
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,11 @@ public interface IJDOrderService {
|
||||
*/
|
||||
List<JDOrder> selectJDOrderList(JDOrder jdOrder);
|
||||
|
||||
/**
|
||||
* 查询列表(支持动态排序)
|
||||
*/
|
||||
List<JDOrder> selectJDOrderListWithSort(JDOrder jdOrder);
|
||||
|
||||
/**
|
||||
* 按ID查询
|
||||
*/
|
||||
|
||||
@@ -19,6 +19,11 @@ public class JDOrderServiceImpl implements IJDOrderService {
|
||||
return jdOrderMapper.selectJDOrderList(jdOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JDOrder> selectJDOrderListWithSort(JDOrder jdOrder) {
|
||||
return jdOrderMapper.selectJDOrderListWithSort(jdOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JDOrder selectJDOrderById(Long id) {
|
||||
return jdOrderMapper.selectJDOrderById(id);
|
||||
|
||||
@@ -42,13 +42,47 @@
|
||||
<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 >= #{params.beginTime}
|
||||
and date(order_time) >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and order_time <= #{params.endTime}
|
||||
and date(order_time) <= #{params.endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by order_time desc, id desc
|
||||
order by create_time desc, remark asc, id desc
|
||||
</select>
|
||||
|
||||
<select id="selectJDOrderListWithSort" parameterType="JDOrder" resultMap="JDOrderResult">
|
||||
<include refid="selectJDOrderBase"/>
|
||||
<where>
|
||||
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
||||
<if test="distributionMark != null and distributionMark != ''"> and distribution_mark = #{distributionMark}</if>
|
||||
<if test="modelNumber != null and modelNumber != ''"> and model_number like concat('%', #{modelNumber}, '%')</if>
|
||||
<if test="link != null and link != ''"> and link like concat('%', #{link}, '%')</if>
|
||||
<if test="paymentAmount != null"> and payment_amount = #{paymentAmount}</if>
|
||||
<if test="rebateAmount != null"> and rebate_amount = #{rebateAmount}</if>
|
||||
<if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
|
||||
<if test="logisticsLink != null and logisticsLink != ''"> and logistics_link like concat('%', #{logisticsLink}, '%')</if>
|
||||
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
|
||||
<if test="buyer != null and buyer != ''"> and buyer like concat('%', #{buyer}, '%')</if>
|
||||
<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 date(order_time) >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date(order_time) <= #{params.endTime}
|
||||
</if>
|
||||
</where>
|
||||
<choose>
|
||||
<when test="params.orderBy != null and params.orderBy != ''">
|
||||
order by ${params.orderBy}
|
||||
<if test="params.isAsc != null and params.isAsc == 'asc'">asc</if>
|
||||
<if test="params.isAsc == null or params.isAsc == 'desc'">desc</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
order by create_time desc, remark asc, id desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="selectJDOrderById" parameterType="long" resultMap="JDOrderResult">
|
||||
|
||||
Reference in New Issue
Block a user