123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- <?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.minpay.db.table.own.mapper.ShOrderMapper">
- <select id="queryOrder" resultType="hashmap" parameterType="java.lang.String">
- select
- VOI_ID "id",
- VOI_CHANNEL "channel",
- VOI_PERSON_ID "personId",
- VOI_EQUIPMENT_ID "equipmentId",
- VOI_ORDER_AMT "orderAmt",
- VOI_STATE "state",
- VOI_RECORD_ID "recordId",
- VOI_PAY_ORDERNO "payOrderno",
- VOI_REMARKS "remarks",
- VOI_PAY_TYPE "payType",
- VOI_NUMBER "number",
- VOI_PRO_TYPE "proType",
- VOI_IS_DRAW "isDraw",
- VOI_IS_USED "isUsed",
- VOI_PRO_STATE "proState",
- VOI_DRAW_PRICE "drawPrice",
- VOI_CREATE_USER "createUser",
- VOI_CREATE_TIME "createTime",
- VOI_MODIFY_USER "modifyUser",
- VOI_MODIFY_TIME "modifyTime",
- VOI_BRANCHID "branchid",
- VOI_PAY_MODE "payMode",
- (SELECT GROUP_CONCAT(VOD_PRO_NAME) FROM vm_order_details w WHERE a.VOI_ID= w.VOD_ORDER_ID GROUP BY w.VOD_ORDER_ID) "productName",
- VOI_PICKUP_NO "pickupNo",
- VOI_PICKUP_STT "pickupStt",
- b.VCI_NAME "personName",
- c.VEQ_NAME "equipmentName"
- FROM
- vm_order_inf a LEFT JOIN vm_person_inf b on a.VOI_PERSON_ID = b.VCI_ID
- LEFT JOIN vm_equipment_inf c on a.VOI_EQUIPMENT_ID = c.VEQ_ID
- WHERE 1=1 and a.VOI_OPERATION = '0'
- <if test="dates!=null and dates != ''">
- and substr(a.VOI_CREATE_TIME,1,8) between substr((#{dates,jdbcType=VARCHAR}),1,8)
- and substr((#{dates,jdbcType=VARCHAR}),12,19)
- </if>
- <if test="equipmentId != null and equipmentId != ''">
- and a.VOI_EQUIPMENT_ID = #{equipmentId,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 a.VOI_EQUREL_ID = #{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_IS_DRAW = #{state,jdbcType=VARCHAR}
- </if>
- <if test="orderNo != null and orderNo != ''">
- and a.VOI_ID = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="branchId != null and branchId != ''">
- and a.VOI_BRANCHID = #{branchId,jdbcType=VARCHAR}
- </if>
- order by a.VOI_CREATE_TIME desc
- </select>
- <select id="queryOrderStatistics" resultType="hashmap" parameterType="java.lang.String">
- select
- count(1) number,
- sum(VOI_ORDER_AMT) sumAmt
- FROM
- vm_order_inf a LEFT JOIN vm_person_inf b on a.VOI_PERSON_ID = b.VCI_ID
- LEFT JOIN vm_equipment_inf c on a.VOI_EQUIPMENT_ID = c.VEQ_ID
- WHERE 1=1 and a.VOI_OPERATION = '0'
- <if test="dates!=null and dates != ''">
- and substr(a.VOI_CREATE_TIME,1,8) between substr((#{dates,jdbcType=VARCHAR}),1,8)
- and substr((#{dates,jdbcType=VARCHAR}),12,19)
- </if>
- <if test="equipmentId != null and equipmentId != ''">
- and a.VOI_EQUIPMENT_ID = #{equipmentId,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 a.VOI_EQUREL_ID = #{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_IS_DRAW = #{state,jdbcType=VARCHAR}
- </if>
- <if test="orderNo != null and orderNo != ''">
- and a.VOI_ID = #{orderNo,jdbcType=VARCHAR}
- </if>
- <if test="branchId != null and branchId != ''">
- and a.VOI_BRANCHID = #{branchId,jdbcType=VARCHAR}
- </if>
- order by a.VOI_CREATE_TIME desc
- </select>
- <select id="queryOrderStatisticsNew" resultType="hashmap" parameterType="java.lang.String">
- SELECT
- count(1) number,
- IFNULL(ROUND(SUM(d.VOD_AMOUNT),2) , 0) sumAmt
- 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'
- <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}),12,19)
- </if>
- <if test="equipmentId != null and equipmentId != ''">
- and c.VEQ_IMEI_ADDR = #{equipmentId,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>
- <if test="openId != null and openId != ''">
- and b.VCI_OPENID = #{openId,jdbcType=VARCHAR}
- </if>
- order by d.VOD_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",
- b.VCI_OPENID "openId",
- 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'
- <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}),12,19)
- </if>
- <if test="equipmentId != null and equipmentId != ''">
- and c.VEQ_IMEI_ADDR = #{equipmentId,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 like CONCAT('%', #{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>
- <if test="openId != null and openId != ''">
- and b.VCI_OPENID = #{openId,jdbcType=VARCHAR}
- </if>
- order by d.VOD_CREATE_TIME desc
- </select>
- </mapper>
|