Browse Source

订单查询

xubh 5 năm trước cách đây
mục cha
commit
dd38faef4a

+ 2 - 0
src/main/java/com/minpay/db/table/own/mapper/ShOrderMapper.java

@@ -9,4 +9,6 @@ import java.util.Map;
 public interface ShOrderMapper extends IMINMybatisEntityMapper {
 	//查询订单列表
 	List<Map<String, String>> queryOrder(Map<String, String> map, MINRowBounds row);
+
+    List<Map<String, String>> queryOrderNew(Map<String, String> p, MINRowBounds rows);
 }

+ 84 - 2
src/main/java/com/minpay/shouhuo/orderaction/ShOrderManageAction.java

@@ -2,6 +2,7 @@ package com.minpay.shouhuo.orderaction;
 
 import com.min.util.OffSetUtil;
 import com.minpay.common.bean.User;
+import com.minpay.common.constant.Constant;
 import com.minpay.common.exception.BusinessCodeException;
 import com.minpay.common.format.IFormatService;
 import com.minpay.common.service.IOrderService;
@@ -57,8 +58,8 @@ public class ShOrderManageAction implements IMINAction {
 	 * @return
 	 * @throws MINBusinessException
 	 */
-	@MINAction(value = QUERY_ORDER)
-	public MINActionResult queryOrder(
+	@MINAction(value = "QUERY_ORDER")
+	public MINActionResult queryOrderb(
 			MINSession session,
 			@MINParam(key = "page", defaultValue = "1") int page,
 			@MINParam(key = "limit", defaultValue = "3") int limit,
@@ -159,4 +160,85 @@ public class ShOrderManageAction implements IMINAction {
 		return res;
 	}
 
+	/**
+	 *新查询订单
+	 * @param session
+	 * @param page
+	 * @param limit
+	 * @param equipmentId	机器编号		1
+	 * @param equipmentName
+	 * @param freightwayId	货道编号		1
+	 * @param payMode		支付方式		1
+	 * @param dates			日期(区间)	1
+	 * @param playerId
+	 * @param playerName	玩家名称		1
+	 * @param state			支付状态		1
+	 * @param orderNo		订单号		1
+	 * @param isDraw		是否中奖
+	 * @param productName	商品名称		1
+	 * @param gameRule		购买方式		1
+	 * @param deliveryId	出货编号    1
+	 * @param fapRequest
+	 * @return
+	 * @throws MINBusinessException
+	 */
+	@MINAction(value = QUERY_ORDER)
+	public MINActionResult queryOrder(
+			MINSession session,
+			@MINParam(key = "page", defaultValue = "1") int page,
+			@MINParam(key = "limit", defaultValue = "3") int limit,
+			@MINParam(key = "equipmentId") String equipmentId,
+			@MINParam(key = "equipmentName") String equipmentName,
+			@MINParam(key = "freightwayId") String freightwayId,
+			@MINParam(key = "payMode") String payMode,
+			@MINParam(key = "dates") String dates,
+			@MINParam(key = "playerId") String playerId,
+			@MINParam(key = "playerName") String playerName,
+			@MINParam(key = "state") String state,
+			@MINParam(key = "orderNo") String orderNo,
+			@MINParam(key = "isDraw") String isDraw,
+			@MINParam(key = "productName") String productName,
+			@MINParam(key = "gameRule") String gameRule,
+			@MINParam(key = "deliveryId") String deliveryId,
+			@MINParam(key = "pickupStt") String pickupStt,
+
+			MINHttpServletRequestContext fapRequest
+	) throws MINBusinessException {
+		MINActionResult res = new MINActionResult();
+		MINRowBounds rows = new MINRowBounds(page, limit);
+		User user = session.getUser();
+		// 创建查询条件
+		Map<String, String> p = new HashMap<String, String>();
+		p.put("equipmentId",equipmentId);
+		p.put("equipmentName",equipmentName);
+		p.put("freightwayId",freightwayId);
+		p.put("payMode",payMode);
+		p.put("playerId",user.getId());
+		p.put("state",state);
+		p.put("dates", dates);
+		p.put("orderNo", orderNo);
+		p.put("playerName", playerName);
+		p.put("isDraw", isDraw);
+		p.put("productName", productName);
+		p.put("gameRule", gameRule);
+		p.put("deliveryId", deliveryId);
+		p.put("pickupStt", pickupStt);
+		// 查询OrderInfMapper.xml
+		List<Map<String, String>> ls = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ShOrderMapper.class).queryOrderNew(p,rows);
+		// 格式化
+		ls = Service.lookup(IFormatService.class).formatDateTime(ls, "createTime");
+		ls = new MINCopyFormat("{isDraw:'isDrawdesc',payMode:'payModedesc','state':'statedesc','pickupStt':'pickupSttdesc'}").format(ls);
+		ls = Service.lookup(IFormatService.class).formatEnum(ls, "{isDrawdesc:'IS_DRAW',payModedesc:'PAY_TYPE',statedesc:'ORDER_STATE',pickupSttdesc:'ORDER_PICKUP_STT'}");
+
+
+		// 设置返回值
+		res.set(IMINBusinessConstant.F_PAGING_LAY, ls);
+		res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getCount());
+		return res;
+	}
+
+
+
+
+
 }

+ 73 - 1
src/main/resources/com/minpay/db/table/own/mapper/ShOrderMapper.xml

@@ -52,5 +52,77 @@
 		</if>
 		order by  a.VOI_CREATE_TIME desc
 	</select>
-
+	<select id="queryOrderNew" resultType="hashmap" parameterType="java.lang.String">
+		SELECT
+		d.VOD_DETAILS_ID		"id",
+		d.VOD_DELIVERY_ID		"deliveryId",
+		d.VOD_CREATE_TIME		"createTime",
+		a.VOI_EQUIPMENT_ID      "equipmentId",
+		c.VEQ_IMEI_ADDR			"imeiAddr",
+		d.VOD_PRO_NAME			"productName",
+		d.VOD_AMOUNT			"orderAmt",
+		e.VCI_AISLE				"aisle",
+		e.VCI_COST_PRICE		"costPrice",
+		a.VOI_STATE				"state",
+		a.VOI_PAY_MODE	    	"payMode",
+		a.VOI_GAME_RULE			"gameRule",
+		d.VOD_IS_DELIVERY		"pickupStt",
+		b.VCI_NAME  			"personName",
+		d.VOD_IS_WINNING		"isDraw"
+		FROM vm_order_details d LEFT JOIN   vm_order_inf a  ON d.VOD_ORDER_ID = a.VOI_ID
+		LEFT JOIN  vm_equipment_inf c ON a.VOI_EQUIPMENT_ID = c.VEQ_ID
+		LEFT JOIN vm_person_inf b ON a.VOI_PERSON_ID = b.VCI_ID
+		LEFT JOIN vm_pro_equ_rel e ON d.VOD_PRO_EQU_REL_ID = e.VCI_ID
+		WHERE 1=1 and a.VOI_OPERATION = '0' AND a.VOI_STATE = '00'
+		<if test="dates!=null and dates != ''">
+			and substr(d.VOD_CREATE_TIME,1,8) between substr((#{dates,jdbcType=VARCHAR}),1,8)
+			and substr((#{dates,jdbcType=VARCHAR}),10,17)
+		</if>
+		<if test="equipmentId != null and equipmentId != ''">
+			and a.VOI_EQUIPMENT_ID = #{equipmentId,jdbcType=VARCHAR}
+		</if>
+		<if test="imeiAddr != null and imeiAddr != ''">
+			and c.VEQ_IMEI_ADDR = #{imeiAddr,jdbcType=VARCHAR}
+		</if>
+		<if test="equipmentName != null and equipmentName != ''">
+			and c.VEQ_NAME like CONCAT('%', #{equipmentName,jdbcType=VARCHAR}, '%')
+		</if>
+		<if test="freightwayId != null and freightwayId != ''">
+			and e.VCI_AISLE = #{freightwayId,jdbcType=VARCHAR}
+		</if>
+		<if test="payMode != null and payMode != ''">
+			and a.VOI_PAY_MODE = #{payMode,jdbcType=VARCHAR}
+		</if>
+		<if test="playerId != null and playerId != ''">
+			and a.VOI_PERSON_ID = #{playerId,jdbcType=VARCHAR}
+		</if>
+		<if test="state != null and state != ''">
+			and a.VOI_STATE = #{state,jdbcType=VARCHAR}
+		</if>
+		<if test="playerName != null and playerName != ''">
+			and b.VCI_NAME = #{playerName,jdbcType=VARCHAR}
+		</if>
+		<if test="isDraw != null and isDraw != ''">
+			and d.VOD_IS_WINNING = #{isDraw,jdbcType=VARCHAR}
+		</if>
+		<if test="orderNo != null and orderNo != ''">
+			and d.VOD_DETAILS_ID = #{orderNo,jdbcType=VARCHAR}
+		</if>
+		<if test="productName != null and productName != ''">
+			and d.VOD_PRO_NAME like CONCAT('%', #{productName,jdbcType=VARCHAR}, '%')
+		</if>
+		<if test="gameRule != null and gameRule != ''">
+			and a.VOI_GAME_RULE = #{gameRule,jdbcType=VARCHAR}
+		</if>
+		<if test="pickupStt != null and pickupStt != ''">
+			and d.VOD_IS_DELIVERY = #{pickupStt,jdbcType=VARCHAR}
+		</if>
+		<if test="deliveryId != null and deliveryId != ''">
+			and d.VOD_DELIVERY_ID = #{deliveryId,jdbcType=VARCHAR}
+		</if>
+		<if test="branchId != null and branchId != ''">
+			and a.VOI_BRANCHID = #{branchId,jdbcType=VARCHAR}
+		</if>
+		order by  d.VOD_CREATE_TIME desc
+	</select>
 </mapper>