|
- <?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.iformall.mapper.NeuPosOrderMasterExtMapper">
-
- <select id="queryShopPayTypeTradeList" parameterType="com.iformall.domain.po.NeuPosOrderMasterExt" resultType="java.util.Map">
- SELECT shop_id as shopId,
- sum(real_pay_amount) as payAmount,
- count(0) as payCount
- from order_master
- where order_status = 2 and order_type != '3'
- <if test=" orgId != null">
- and org_id = #{orgId}
- </if>
- <if test=" shopId != null">
- and shop_id = #{shopId}
- </if>
- <if test=" createBegin != null">
- and created_at >= #{createBegin}
- </if>
- <if test=" createEnd != null">
- and created_at <= #{createEnd}
- </if>
- GROUP BY shop_id
- ORDER BY shop_id asc
- </select>
-
- <select id="queryShopPayOrderList" parameterType="com.iformall.domain.po.NeuPosOrderMasterExt" resultType="java.util.Map">
- select ifnull(sum(order_amount),0) as payAmount,
- ifnull(sum(discount_amount),0) as discountAmount,
- count(order_amount) as payCount,
- ifnull(sum(if(order_status=4,real_pay_amount,0)),0) refundAmount,
- count(if(order_status=4,true,null)) refundCount,
- ifnull(sum(if(order_status=2,real_pay_amount,0)),0) as amount,
- pay_type as payType
- from order_master
- where pay_status = 2 and order_type != '3'
- <if test=" orgId != null">
- and org_id = #{orgId}
- </if>
- <if test=" shopId != null">
- and shop_id = #{shopId}
- </if>
- <if test=" createBegin != null">
- and created_at >= #{createBegin}
- </if>
- <if test=" createEnd != null">
- and created_at <= #{createEnd}
- </if>
- GROUP BY pay_type
- </select>
-
- <select id="selectShopList" parameterType="Integer" resultType="java.util.Map">
- select id,name from `shop` where status = 1
- <if test=" orgId != null">
- and org_id = #{orgId}
- </if>
- order by name asc
- </select>
-
- <select id="selectPayTypeList" resultType="java.util.Map">
- select pay_type,name from `trade_pay_type_dict`
- </select>
-
- <select id="queryOrderList" parameterType="com.iformall.domain.po.NeuPosOrderMasterExt" resultType="java.util.Map">
- SELECT order_number as orderNumber, serial_no as serialNo, order_amount as orderAmount,real_pay_amount as realPayAmount,
- discount_amount as discountAmount, pay_type as payType,paid_time as paidTime,order_status as orderStatus
- from order_master
- where order_status = 2 and order_type != '3'
- <if test=" orgId != null">
- and org_id = #{orgId}
- </if>
- <if test=" shopId != null">
- and shop_id = #{shopId}
- </if>
- <if test=" createBegin != null">
- and created_at >= #{createBegin}
- </if>
- <if test=" createEnd != null">
- and created_at <= #{createEnd}
- </if>
- ORDER BY created_at desc
- </select>
-
- </mapper>
|